diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-10-13 16:57:50 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2023-10-13 16:58:05 +0300 |
| commit | c919e9a2806aed62f8fe7cb23da4aa14808daea8 (patch) | |
| tree | 53922621121f0798550b4a21f76658909d6c37b6 /lib/std/simd.zig | |
| parent | f09313dbc46ae9dc6165cbfb3d0b18760db55752 (diff) | |
| download | zig-c919e9a2806aed62f8fe7cb23da4aa14808daea8.tar.gz zig-c919e9a2806aed62f8fe7cb23da4aa14808daea8.zip | |
std.simd: return comptime_int from `suggestVectorSize`
Diffstat (limited to 'lib/std/simd.zig')
| -rw-r--r-- | lib/std/simd.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/simd.zig b/lib/std/simd.zig index 5a966c53e5..93e8534f4a 100644 --- a/lib/std/simd.zig +++ b/lib/std/simd.zig @@ -6,7 +6,7 @@ const std = @import("std"); const builtin = @import("builtin"); -pub fn suggestVectorSizeForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ?usize { +pub fn suggestVectorSizeForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ?comptime_int { // This is guesswork, if you have better suggestions can add it or edit the current here // This can run in comptime only, but stage 1 fails at it, stage 2 can understand it const element_bit_size = @max(8, std.math.ceilPowerOfTwo(u16, @bitSizeOf(T)) catch unreachable); @@ -55,7 +55,7 @@ pub fn suggestVectorSizeForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ? /// Suggests a target-dependant vector size for a given type, or null if scalars are recommended. /// Not yet implemented for every CPU architecture. -pub fn suggestVectorSize(comptime T: type) ?usize { +pub fn suggestVectorSize(comptime T: type) ?comptime_int { return suggestVectorSizeForCpu(T, builtin.cpu); } |
