aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/math.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-02-18 05:25:36 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2025-06-05 06:12:00 +0200
commit9d534790ebc869ec933e932abe4be8b9e3593bbc (patch)
tree70652dde381fd0c0d536d8e7665e725e0924bb51 /test/behavior/math.zig
parent14873f9a3434a0d753ca8438f389a7931956cf26 (diff)
downloadzig-9d534790ebc869ec933e932abe4be8b9e3593bbc.tar.gz
zig-9d534790ebc869ec933e932abe4be8b9e3593bbc.zip
std.Target: Introduce Cpu convenience functions for feature tests.
Before: * std.Target.arm.featureSetHas(target.cpu.features, .has_v7) * std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov }) * std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory }) After: * target.cpu.has(.arm, .has_v7) * target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov }) * target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
Diffstat (limited to 'test/behavior/math.zig')
-rw-r--r--test/behavior/math.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index 232ba11eea..d77603f537 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -475,7 +475,7 @@ test "division" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt == .coff and
- !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .f16c)) return error.SkipZigTest;
+ !comptime builtin.cpu.has(.x86, .f16c)) return error.SkipZigTest;
try testIntDivision();
try comptime testIntDivision();
@@ -1930,7 +1930,7 @@ test "float vector division of comptime zero by runtime nan is nan" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt == .coff and
- !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .sse4_1)) return error.SkipZigTest;
+ !comptime builtin.cpu.has(.x86, .sse4_1)) return error.SkipZigTest;
const ct_zero: @Vector(1, f32) = .{0};
var rt_nan: @Vector(1, f32) = .{math.nan(f32)};