From b64fe53ad509a1f582483e886f8b740a59b379c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 30 Jun 2025 06:56:43 +0200 Subject: [PATCH] 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. --- lib/std/simd.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/simd.zig b/lib/std/simd.zig index 94abb436a4..7854c9d126 100644 --- a/lib/std/simd.zig +++ b/lib/std/simd.zig @@ -9,6 +9,8 @@ const std = @import("std"); const builtin = @import("builtin"); pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ?comptime_int { + @setEvalBranchQuota(2_000); + // This is guesswork, if you have better suggestions can add it or edit the current here const element_bit_size = @max(8, std.math.ceilPowerOfTwo(u16, @bitSizeOf(T)) catch unreachable); const vector_bit_size: u16 = blk: {