diff --git a/lib/std/crypto/25519/edwards25519.zig b/lib/std/crypto/25519/edwards25519.zig index 7b95fa9315526d917a7b9a8cc847c3e06004476c..1eeb64a86d5d93d4d75f936bbdd27d65390a4943 100644 --- a/lib/std/crypto/25519/edwards25519.zig +++ b/lib/std/crypto/25519/edwards25519.zig @@ -226,12 +226,12 @@ pub const Edwards25519 = struct { return pc; } - const basePointPc = comptime pc: { + const basePointPc = pc: { @setEvalBranchQuota(10000); break :pc precompute(Edwards25519.basePoint, 15); }; - const basePointPc8 = comptime pc: { + const basePointPc8 = pc: { @setEvalBranchQuota(10000); break :pc precompute(Edwards25519.basePoint, 8); }; diff --git a/lib/std/crypto/25519/field.zig b/lib/std/crypto/25519/field.zig index aae53e9081ec8fc0088c7c3a2dc014e67b7b770d..57371d8290081def355476904ca881509a0e6761 100644 --- a/lib/std/crypto/25519/field.zig +++ b/lib/std/crypto/25519/field.zig @@ -292,7 +292,7 @@ pub const Fe = struct { return _carry128(&r); } - fn _sq(a: Fe, double: comptime bool) callconv(.Inline) Fe { + fn _sq(a: Fe, double: bool) callconv(.Inline) Fe { var ax: [5]u128 = undefined; var r: [5]u128 = undefined; comptime var i = 0; diff --git a/lib/std/crypto/aes.zig b/lib/std/crypto/aes.zig index 2a81492c8a4df9fc206c1c70abc197f5d14a1b1b..43d5be1f22c495da12ccae933a662cee8b6bf3df 100644 --- a/lib/std/crypto/aes.zig +++ b/lib/std/crypto/aes.zig @@ -8,9 +8,9 @@ const std = @import("../std.zig"); const testing = std.testing; const builtin = std.builtin; -const has_aesni = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); -const has_avx = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); -const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); +const has_aesni = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); +const has_avx = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); +const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); const impl = if (std.Target.current.cpu.arch == .x86_64 and has_aesni and has_avx) impl: { break :impl @import("aes/aesni.zig"); } else if (std.Target.current.cpu.arch == .aarch64 and has_armaes) diff --git a/lib/std/crypto/aes_ocb.zig b/lib/std/crypto/aes_ocb.zig index 658b3b97ce0d14735720b1bdced4c39ec13370aa..6c5ea84acef5b416af4a5bf296a803fad442abb2 100644 --- a/lib/std/crypto/aes_ocb.zig +++ b/lib/std/crypto/aes_ocb.zig @@ -106,8 +106,8 @@ fn AesOcb(comptime Aes: anytype) type { return offset; } - const has_aesni = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); - const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); + const has_aesni = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); + const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); const wb: usize = if ((std.Target.current.cpu.arch == .x86_64 and has_aesni) or (std.Target.current.cpu.arch == .aarch64 and has_armaes)) 4 else 0; /// c: ciphertext: output buffer should be of size m.len diff --git a/lib/std/crypto/ghash.zig b/lib/std/crypto/ghash.zig index ffc9ef41ae3a29a91c7b931c1efb8f20fb61f25a..1c55564e39498c17e61f0d8c0203ed1757a415e5 100644 --- a/lib/std/crypto/ghash.zig +++ b/lib/std/crypto/ghash.zig @@ -137,9 +137,9 @@ pub const Ghash = struct { return z0 | z1 | z2 | z3; } - const has_pclmul = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .pclmul); - const has_avx = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); - const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); + const has_pclmul = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .pclmul); + const has_avx = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); + const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); const clmul = if (std.Target.current.cpu.arch == .x86_64 and has_pclmul and has_avx) impl: { break :impl clmul_pclmul; } else if (std.Target.current.cpu.arch == .aarch64 and has_armaes) impl: { diff --git a/lib/std/crypto/modes.zig b/lib/std/crypto/modes.zig index a74704d1aea1868345e0a0d48fff82cd8a6f5031..8848334dae7e3e0630ec6e9407a8f7041f657f98 100644 --- a/lib/std/crypto/modes.zig +++ b/lib/std/crypto/modes.zig @@ -16,7 +16,7 @@ const debug = std.debug; /// /// Important: the counter mode doesn't provide authenticated encryption: the ciphertext can be trivially modified without this being detected. /// As a result, applications should generally never use it directly, but only in a construction that includes a MAC. -pub fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: comptime builtin.Endian) void { +pub fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: builtin.Endian) void { debug.assert(dst.len >= src.len); const block_length = BlockCipher.block_length; var counter: [BlockCipher.block_length]u8 = undefined; diff --git a/lib/std/crypto/poly1305.zig b/lib/std/crypto/poly1305.zig index 739c057178c306f886e856169592d6efb1987da6..a775094c4889acf8b6e212fd57b657c71d5dd049 100644 --- a/lib/std/crypto/poly1305.zig +++ b/lib/std/crypto/poly1305.zig @@ -39,7 +39,7 @@ pub const Poly1305 = struct { }; } - fn blocks(st: *Poly1305, m: []const u8, last: comptime bool) void { + fn blocks(st: *Poly1305, m: []const u8, last: bool) void { const hibit: u64 = if (last) 0 else 1 << 40; const r0 = st.r[0]; const r1 = st.r[1]; diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 68828ad24c9e5442c968967eadc0c70dc07efd06..d988665996cc4a8c1914f53fd1e18012420cac1a 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -353,18 +353,18 @@ pub const StackIterator = struct { } // Offset of the saved BP wrt the frame pointer. - const fp_offset = if (comptime native_arch.isRISCV()) + const fp_offset = if (native_arch.isRISCV()) // On RISC-V the frame pointer points to the top of the saved register // area, on pretty much every other architecture it points to the stack // slot where the previous frame pointer is saved. 2 * @sizeOf(usize) - else if (comptime native_arch.isSPARC()) + else if (native_arch.isSPARC()) // On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS. 14 * @sizeOf(usize) else 0; - const fp_bias = if (comptime native_arch.isSPARC()) + const fp_bias = if (native_arch.isSPARC()) // On SPARC frame pointers are biased by a constant. 2047 else diff --git a/lib/std/hash/crc.zig b/lib/std/hash/crc.zig index a2d6ed429ccd1202a5b1d7e2e99294a4f44b563a..c222075559c14187c721eb7734bbf4ab1b7458bd 100644 --- a/lib/std/hash/crc.zig +++ b/lib/std/hash/crc.zig @@ -28,7 +28,7 @@ pub const Crc32 = Crc32WithPoly(.IEEE); pub fn Crc32WithPoly(comptime poly: Polynomial) type { return struct { const Self = @This(); - const lookup_tables = comptime block: { + const lookup_tables = block: { @setEvalBranchQuota(20000); var tables: [8][256]u32 = undefined; @@ -128,7 +128,7 @@ test "crc32 castagnoli" { pub fn Crc32SmallWithPoly(comptime poly: Polynomial) type { return struct { const Self = @This(); - const lookup_table = comptime block: { + const lookup_table = block: { var table: [16]u32 = undefined; for (table) |*e, i| { diff --git a/lib/std/heap.zig b/lib/std/heap.zig index e4bc307642c2fe5e3730536e9c6d9a941e08b5aa..82521a70e7bb221d4c9d860ffd2f35544ccff08f 100644 --- a/lib/std/heap.zig +++ b/lib/std/heap.zig @@ -28,17 +28,17 @@ const CAllocator = struct { } } - usingnamespace if (comptime @hasDecl(c, "malloc_size")) + usingnamespace if (@hasDecl(c, "malloc_size")) struct { pub const supports_malloc_size = true; pub const malloc_size = c.malloc_size; } - else if (comptime @hasDecl(c, "malloc_usable_size")) + else if (@hasDecl(c, "malloc_usable_size")) struct { pub const supports_malloc_size = true; pub const malloc_size = c.malloc_usable_size; } - else if (comptime @hasDecl(c, "_msize")) + else if (@hasDecl(c, "_msize")) struct { pub const supports_malloc_size = true; pub const malloc_size = c._msize; diff --git a/lib/std/io/bit_reader.zig b/lib/std/io/bit_reader.zig index 213cd2b5037c9367fe1f06d37ed395481985c5ae..a803b2a6dd6a9f2b49178b47c6c2b3ad28ded9a8 100644 --- a/lib/std/io/bit_reader.zig +++ b/lib/std/io/bit_reader.zig @@ -23,9 +23,9 @@ pub fn BitReader(endian: builtin.Endian, comptime ReaderType: type) type { pub const Reader = io.Reader(*Self, Error, read); const Self = @This(); - const u8_bit_count = comptime meta.bitCount(u8); - const u7_bit_count = comptime meta.bitCount(u7); - const u4_bit_count = comptime meta.bitCount(u4); + const u8_bit_count = meta.bitCount(u8); + const u7_bit_count = meta.bitCount(u7); + const u4_bit_count = meta.bitCount(u4); pub fn init(forward_reader: ReaderType) Self { return Self{ diff --git a/lib/std/io/bit_writer.zig b/lib/std/io/bit_writer.zig index 3ad2b75efb8d87c8a00f09cc9a2c36ecd67555cd..5b8abc27fb24d7b2e07b6208ae97e646deb665d6 100644 --- a/lib/std/io/bit_writer.zig +++ b/lib/std/io/bit_writer.zig @@ -23,8 +23,8 @@ pub fn BitWriter(endian: builtin.Endian, comptime WriterType: type) type { pub const Writer = io.Writer(*Self, Error, write); const Self = @This(); - const u8_bit_count = comptime meta.bitCount(u8); - const u4_bit_count = comptime meta.bitCount(u4); + const u8_bit_count = meta.bitCount(u8); + const u4_bit_count = meta.bitCount(u4); pub fn init(forward_writer: WriterType) Self { return Self{