mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
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.
This commit is contained in:
parent
197fb26da0
commit
b64fe53ad5
1 changed files with 2 additions and 0 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue