aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/floatop.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/floatop.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/floatop.zig')
-rw-r--r--test/behavior/floatop.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/behavior/floatop.zig b/test/behavior/floatop.zig
index 9baa42880b..179ba8a6cb 100644
--- a/test/behavior/floatop.zig
+++ b/test/behavior/floatop.zig
@@ -17,7 +17,7 @@ test "add f16" {
if (builtin.zig_backend == .stage2_riscv64) 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 testAdd(f16);
try comptime testAdd(f16);
@@ -129,7 +129,7 @@ test "cmp f16" {
if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
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 testCmp(f16);
try comptime testCmp(f16);
@@ -345,7 +345,7 @@ test "different sized float comparisons" {
if (builtin.zig_backend == .stage2_riscv64) 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 testDifferentSizedFloatComparisons();
try comptime testDifferentSizedFloatComparisons();
@@ -396,7 +396,7 @@ test "@sqrt f16" {
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 testSqrt(f16);
try comptime testSqrt(f16);
@@ -1140,7 +1140,7 @@ test "@abs f16" {
if (builtin.zig_backend == .stage2_riscv64) 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 testFabs(f16);
try comptime testFabs(f16);
@@ -1276,7 +1276,7 @@ test "@floor f32/f64" {
if (builtin.zig_backend == .stage2_riscv64) 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;
try testFloor(f32);
try comptime testFloor(f32);
@@ -1343,7 +1343,7 @@ test "@floor with vectors" {
if (builtin.zig_backend == .stage2_riscv64) 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;
try testFloorWithVectors();
try comptime testFloorWithVectors();
@@ -1377,7 +1377,7 @@ test "@ceil f32/f64" {
if (builtin.zig_backend == .stage2_riscv64) 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;
try testCeil(f32);
try comptime testCeil(f32);
@@ -1444,7 +1444,7 @@ test "@ceil with vectors" {
if (builtin.zig_backend == .stage2_riscv64) 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;
try testCeilWithVectors();
try comptime testCeilWithVectors();
@@ -1478,7 +1478,7 @@ test "@trunc f32/f64" {
if (builtin.zig_backend == .stage2_riscv64) 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;
try testTrunc(f32);
try comptime testTrunc(f32);
@@ -1545,7 +1545,7 @@ test "@trunc with vectors" {
if (builtin.zig_backend == .stage2_riscv64) 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;
try testTruncWithVectors();
try comptime testTruncWithVectors();
@@ -1568,7 +1568,7 @@ test "neg f16" {
if (builtin.zig_backend == .stage2_riscv64) 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;
if (builtin.os.tag == .freebsd) {
// TODO file issue to track this failure