authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-30 06:56:43+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-30 08:01:27+02:00
logb64fe53ad509a1f582483e886f8b740a59b379c3
tree7cfd0980566bdf6ff430ab9856b9e1ed4b1ecf12
parent197fb26da0b8bb068fc8b52931870f97661b797d
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.simd: Increase branch quota in suggestVectorLengthForCpu()

This does a bunch of CPU family and feature checks. It would be annoying to have to @setEvalBranchQuota() at every comptime use site.

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/simd.zig+2
......@@ -9,6 +9,8 @@ const std = @import("std");
99const builtin = @import("builtin");
1010
1111pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ?comptime_int {
12 @setEvalBranchQuota(2_000);
13
1214 // This is guesswork, if you have better suggestions can add it or edit the current here
1315 const element_bit_size = @max(8, std.math.ceilPowerOfTwo(u16, @bitSizeOf(T)) catch unreachable);
1416 const vector_bit_size: u16 = blk: {