diff --git a/lib/std/crypto/25519/edwards25519.zig b/lib/std/crypto/25519/edwards25519.zig index 7b95fa9315..1eeb64a86d 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 aae53e9081..57371d8290 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 2a81492c8a..43d5be1f22 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 658b3b97ce..6c5ea84ace 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 ffc9ef41ae..1c55564e39 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 a74704d1ae..8848334dae 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 739c057178..a775094c48 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 68828ad24c..d988665996 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 a2d6ed429c..c222075559 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 e4bc307642..82521a70e7 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 213cd2b503..a803b2a6dd 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 3ad2b75efb..5b8abc27fb 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{