| author | |
| committer | |
| log | 70c8e7f91dcfdc908bcb41311b24cb2e150182d0 |
| tree | b9db9bc2814383a2931175f13a7c514dcafe1438 |
| parent | 32e85d44eb72122d174de02d4020f149026dd787 |
8 files changed, 47 insertions(+), 2 deletions(-)
lib/compiler_rt/addf3_test.zig+3| ... | @@ -76,6 +76,9 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void { | ... | @@ -76,6 +76,9 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void { |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | test "subtf3" { | 78 | test "subtf3" { |
| 79 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 80 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 81 | |||
| 79 | // qNaN - any = qNaN | 82 | // qNaN - any = qNaN |
| 80 | try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); | 83 | try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); |
| 81 | 84 |
lib/compiler_rt/divtf3_test.zig+4| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 2 | const math = std.math; | 3 | const math = std.math; |
| 3 | const testing = std.testing; | 4 | const testing = std.testing; |
| 4 | 5 | ||
| ... | @@ -30,6 +31,9 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void { | ... | @@ -30,6 +31,9 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void { |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | test "divtf3" { | 33 | test "divtf3" { |
| 34 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 35 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 36 | |||
| 33 | // NaN / any = NaN | 37 | // NaN / any = NaN |
| 34 | try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0); | 38 | try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0); |
| 35 | // inf / any(except inf and nan) = inf | 39 | // inf / any(except inf and nan) = inf |
lib/compiler_rt/float_from_int_test.zig+22| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 2 | const testing = std.testing; | 3 | const testing = std.testing; |
| 3 | const math = std.math; | 4 | const math = std.math; |
| 4 | 5 | ||
| ... | @@ -125,6 +126,9 @@ fn test__floatuntisf(a: u128, expected: f32) !void { | ... | @@ -125,6 +126,9 @@ fn test__floatuntisf(a: u128, expected: f32) !void { |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | test "floattisf" { | 128 | test "floattisf" { |
| 129 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 130 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 131 | |||
| 128 | try test__floattisf(0, 0.0); | 132 | try test__floattisf(0, 0.0); |
| 129 | 133 | ||
| 130 | try test__floattisf(1, 1.0); | 134 | try test__floattisf(1, 1.0); |
| ... | @@ -171,6 +175,9 @@ test "floattisf" { | ... | @@ -171,6 +175,9 @@ test "floattisf" { |
| 171 | } | 175 | } |
| 172 | 176 | ||
| 173 | test "floatuntisf" { | 177 | test "floatuntisf" { |
| 178 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 179 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 180 | |||
| 174 | try test__floatuntisf(0, 0.0); | 181 | try test__floatuntisf(0, 0.0); |
| 175 | 182 | ||
| 176 | try test__floatuntisf(1, 1.0); | 183 | try test__floatuntisf(1, 1.0); |
| ... | @@ -367,6 +374,9 @@ fn test__floatuntidf(a: u128, expected: f64) !void { | ... | @@ -367,6 +374,9 @@ fn test__floatuntidf(a: u128, expected: f64) !void { |
| 367 | } | 374 | } |
| 368 | 375 | ||
| 369 | test "floattidf" { | 376 | test "floattidf" { |
| 377 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 378 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 379 | |||
| 370 | try test__floattidf(0, 0.0); | 380 | try test__floattidf(0, 0.0); |
| 371 | 381 | ||
| 372 | try test__floattidf(1, 1.0); | 382 | try test__floattidf(1, 1.0); |
| ... | @@ -437,6 +447,9 @@ test "floattidf" { | ... | @@ -437,6 +447,9 @@ test "floattidf" { |
| 437 | } | 447 | } |
| 438 | 448 | ||
| 439 | test "floatuntidf" { | 449 | test "floatuntidf" { |
| 450 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 451 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 452 | |||
| 440 | try test__floatuntidf(0, 0.0); | 453 | try test__floatuntidf(0, 0.0); |
| 441 | 454 | ||
| 442 | try test__floatuntidf(1, 1.0); | 455 | try test__floatuntidf(1, 1.0); |
| ... | @@ -582,6 +595,9 @@ test "floatditf" { | ... | @@ -582,6 +595,9 @@ test "floatditf" { |
| 582 | } | 595 | } |
| 583 | 596 | ||
| 584 | test "floatunditf" { | 597 | test "floatunditf" { |
| 598 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 599 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 600 | |||
| 585 | try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000); | 601 | try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000); |
| 586 | try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000); | 602 | try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000); |
| 587 | try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0); | 603 | try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0); |
| ... | @@ -603,6 +619,9 @@ fn test__floatuntitf(a: u128, expected: f128) !void { | ... | @@ -603,6 +619,9 @@ fn test__floatuntitf(a: u128, expected: f128) !void { |
| 603 | } | 619 | } |
| 604 | 620 | ||
| 605 | test "floattitf" { | 621 | test "floattitf" { |
| 622 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 623 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 624 | |||
| 606 | try test__floattitf(0, 0.0); | 625 | try test__floattitf(0, 0.0); |
| 607 | 626 | ||
| 608 | try test__floattitf(1, 1.0); | 627 | try test__floattitf(1, 1.0); |
| ... | @@ -685,6 +704,9 @@ test "floattitf" { | ... | @@ -685,6 +704,9 @@ test "floattitf" { |
| 685 | } | 704 | } |
| 686 | 705 | ||
| 687 | test "floatuntitf" { | 706 | test "floatuntitf" { |
| 707 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 708 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 709 | |||
| 688 | try test__floatuntitf(0, 0.0); | 710 | try test__floatuntitf(0, 0.0); |
| 689 | 711 | ||
| 690 | try test__floatuntitf(1, 1.0); | 712 | try test__floatuntitf(1, 1.0); |
lib/compiler_rt/fma.zig+3| ... | @@ -343,6 +343,9 @@ test "64" { | ... | @@ -343,6 +343,9 @@ test "64" { |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | test "128" { | 345 | test "128" { |
| 346 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 347 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 348 | |||
| 346 | const epsilon = 0.000001; | 349 | const epsilon = 0.000001; |
| 347 | 350 | ||
| 348 | try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon)); | 351 | try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon)); |
lib/compiler_rt/fmodx_test.zig+4| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 2 | const fmod = @import("fmod.zig"); | 3 | const fmod = @import("fmod.zig"); |
| 3 | const testing = std.testing; | 4 | const testing = std.testing; |
| 4 | 5 | ||
| ... | @@ -22,6 +23,9 @@ fn test_fmodx_infs() !void { | ... | @@ -22,6 +23,9 @@ fn test_fmodx_infs() !void { |
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | test "fmodx" { | 25 | test "fmodx" { |
| 26 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 27 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 28 | |||
| 25 | try test_fmodx(6.4, 4.0, 2.4); | 29 | try test_fmodx(6.4, 4.0, 2.4); |
| 26 | try test_fmodx(6.4, -4.0, 2.4); | 30 | try test_fmodx(6.4, -4.0, 2.4); |
| 27 | try test_fmodx(-6.4, 4.0, -2.4); | 31 | try test_fmodx(-6.4, 4.0, -2.4); |
lib/compiler_rt/mulf3_test.zig+4| ... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
| 3 | // https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c | 3 | // https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c |
| 4 | 4 | ||
| 5 | const std = @import("std"); | 5 | const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | ||
| 6 | const math = std.math; | 7 | const math = std.math; |
| 7 | const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64); | 8 | const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64); |
| 8 | const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64); | 9 | const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64); |
| ... | @@ -48,6 +49,9 @@ fn makeNaN128(rand: u64) f128 { | ... | @@ -48,6 +49,9 @@ fn makeNaN128(rand: u64) f128 { |
| 48 | return @bitCast(int_result); | 49 | return @bitCast(int_result); |
| 49 | } | 50 | } |
| 50 | test "multf3" { | 51 | test "multf3" { |
| 52 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 53 | !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest; | ||
| 54 | |||
| 51 | // qNaN * any = qNaN | 55 | // qNaN * any = qNaN |
| 52 | try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); | 56 | try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0); |
| 53 | 57 |
lib/compiler_rt/powiXf2_test.zig+3| ... | @@ -34,6 +34,9 @@ fn test__powixf2(a: f80, b: i32, expected: f80) !void { | ... | @@ -34,6 +34,9 @@ fn test__powixf2(a: f80, b: i32, expected: f80) !void { |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | test "powihf2" { | 36 | test "powihf2" { |
| 37 | if (builtin.zig_backend == .stage2_x86_64 and | ||
| 38 | !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .f16c)) return error.SkipZigTest; | ||
| 39 | |||
| 37 | const inf_f16 = math.inf(f16); | 40 | const inf_f16 = math.inf(f16); |
| 38 | try test__powisf2(0, 0, 1); | 41 | try test__powisf2(0, 0, 1); |
| 39 | try test__powihf2(1, 0, 1); | 42 | try test__powihf2(1, 0, 1); |
test/tests.zig+4-2| ... | @@ -985,7 +985,9 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { | ... | @@ -985,7 +985,9 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 985 | continue; | 985 | continue; |
| 986 | 986 | ||
| 987 | // TODO get compiler-rt tests passing for self-hosted backends. | 987 | // TODO get compiler-rt tests passing for self-hosted backends. |
| 988 | if (test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt")) | 988 | if ((test_target.target.getCpuArch() != .x86_64 or |
| 989 | test_target.target.getObjectFormat() != .elf) and | ||
| 990 | test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt")) | ||
| 989 | continue; | 991 | continue; |
| 990 | 992 | ||
| 991 | // TODO get compiler-rt tests passing for wasm32-wasi | 993 | // TODO get compiler-rt tests passing for wasm32-wasi |
| ... | @@ -1004,7 +1006,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { | ... | @@ -1004,7 +1006,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1004 | 1006 | ||
| 1005 | // TODO get std lib tests passing for other self-hosted backends. | 1007 | // TODO get std lib tests passing for other self-hosted backends. |
| 1006 | if ((test_target.target.getCpuArch() != .x86_64 or | 1008 | if ((test_target.target.getCpuArch() != .x86_64 or |
| 1007 | test_target.target.os_tag != .linux) and | 1009 | test_target.target.getObjectFormat() != .elf) and |
| 1008 | test_target.use_llvm == false and mem.eql(u8, options.name, "std")) | 1010 | test_target.use_llvm == false and mem.eql(u8, options.name, "std")) |
| 1009 | continue; | 1011 | continue; |
| 1010 | 1012 |