Commit 70c8e7f91d
Changed files (8)
lib/compiler_rt/addf3_test.zig
@@ -76,6 +76,9 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void {
}
test "subtf3" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
// qNaN - any = qNaN
try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);
lib/compiler_rt/divtf3_test.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const builtin = @import("builtin");
const math = std.math;
const testing = std.testing;
@@ -30,6 +31,9 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void {
}
test "divtf3" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
// NaN / any = NaN
try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0);
// inf / any(except inf and nan) = inf
lib/compiler_rt/float_from_int_test.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const builtin = @import("builtin");
const testing = std.testing;
const math = std.math;
@@ -125,6 +126,9 @@ fn test__floatuntisf(a: u128, expected: f32) !void {
}
test "floattisf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floattisf(0, 0.0);
try test__floattisf(1, 1.0);
@@ -171,6 +175,9 @@ test "floattisf" {
}
test "floatuntisf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floatuntisf(0, 0.0);
try test__floatuntisf(1, 1.0);
@@ -367,6 +374,9 @@ fn test__floatuntidf(a: u128, expected: f64) !void {
}
test "floattidf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floattidf(0, 0.0);
try test__floattidf(1, 1.0);
@@ -437,6 +447,9 @@ test "floattidf" {
}
test "floatuntidf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floatuntidf(0, 0.0);
try test__floatuntidf(1, 1.0);
@@ -582,6 +595,9 @@ test "floatditf" {
}
test "floatunditf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000);
try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000);
try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0);
@@ -603,6 +619,9 @@ fn test__floatuntitf(a: u128, expected: f128) !void {
}
test "floattitf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floattitf(0, 0.0);
try test__floattitf(1, 1.0);
@@ -685,6 +704,9 @@ test "floattitf" {
}
test "floatuntitf" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test__floatuntitf(0, 0.0);
try test__floatuntitf(1, 1.0);
lib/compiler_rt/fma.zig
@@ -343,6 +343,9 @@ test "64" {
}
test "128" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
const epsilon = 0.000001;
try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon));
lib/compiler_rt/fmodx_test.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const builtin = @import("builtin");
const fmod = @import("fmod.zig");
const testing = std.testing;
@@ -22,6 +23,9 @@ fn test_fmodx_infs() !void {
}
test "fmodx" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
try test_fmodx(6.4, 4.0, 2.4);
try test_fmodx(6.4, -4.0, 2.4);
try test_fmodx(-6.4, 4.0, -2.4);
lib/compiler_rt/mulf3_test.zig
@@ -3,6 +3,7 @@
// https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c
const std = @import("std");
+const builtin = @import("builtin");
const math = std.math;
const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64);
const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64);
@@ -48,6 +49,9 @@ fn makeNaN128(rand: u64) f128 {
return @bitCast(int_result);
}
test "multf3" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
+
// qNaN * any = qNaN
try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);
lib/compiler_rt/powiXf2_test.zig
@@ -34,6 +34,9 @@ fn test__powixf2(a: f80, b: i32, expected: f80) !void {
}
test "powihf2" {
+ if (builtin.zig_backend == .stage2_x86_64 and
+ !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .f16c)) return error.SkipZigTest;
+
const inf_f16 = math.inf(f16);
try test__powisf2(0, 0, 1);
try test__powihf2(1, 0, 1);
test/tests.zig
@@ -985,7 +985,9 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
continue;
// TODO get compiler-rt tests passing for self-hosted backends.
- if (test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))
+ if ((test_target.target.getCpuArch() != .x86_64 or
+ test_target.target.getObjectFormat() != .elf) and
+ test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))
continue;
// TODO get compiler-rt tests passing for wasm32-wasi
@@ -1004,7 +1006,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
// TODO get std lib tests passing for other self-hosted backends.
if ((test_target.target.getCpuArch() != .x86_64 or
- test_target.target.os_tag != .linux) and
+ test_target.target.getObjectFormat() != .elf) and
test_target.use_llvm == false and mem.eql(u8, options.name, "std"))
continue;