From 354ea625e5d9adcdac3c015f1eccf14c694ec03f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 2 Oct 2024 04:07:14 +0200 Subject: [PATCH 1/3] test: Re-enable "bitcast nan float does not modify signaling bit" for LLVM + arm. This now passes on all targets that we test in CI. See: https://github.com/ziglang/zig/issues/14366 --- test/behavior/bitcast.zig | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/behavior/bitcast.zig b/test/behavior/bitcast.zig index 32ea5a62e6..2ef97c8310 100644 --- a/test/behavior/bitcast.zig +++ b/test/behavior/bitcast.zig @@ -429,9 +429,6 @@ test "bitcast nan float does not modify signaling bit" { if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; - // TODO: https://github.com/ziglang/zig/issues/14366 - if (builtin.zig_backend == .stage2_llvm and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest; - const snan_u16: u16 = 0x7D00; const snan_u32: u32 = 0x7FA00000; const snan_u64: u64 = 0x7FF4000000000000; From c13713dd02ccd6ae21a508ec43bc1725199d2ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 2 Oct 2024 04:04:40 +0200 Subject: [PATCH 2/3] std.math: Re-enable snan() test. This now passes on all targets that we test in CI. See: https://github.com/ziglang/zig/issues/14366 --- lib/std/math/float.zig | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/std/math/float.zig b/lib/std/math/float.zig index a10332f863..b7269b3ba9 100644 --- a/lib/std/math/float.zig +++ b/lib/std/math/float.zig @@ -172,9 +172,6 @@ test nan { } test snan { - // TODO: https://github.com/ziglang/zig/issues/14366 - if (builtin.zig_backend == .stage2_llvm and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest; - const snan_u16: u16 = 0x7D00; const snan_u32: u32 = 0x7FA00000; const snan_u64: u64 = 0x7FF4000000000000; From 1e838eba7543db06b2e57919c94d740188a11bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 2 Oct 2024 04:05:40 +0200 Subject: [PATCH 3/3] std.math: Re-enable isSignalNan test on most targets. This remains disabled on arm, aarch64, and powerpc, as well as for the C backend, as it still fails for these targets. See: https://github.com/ziglang/zig/issues/14366 --- lib/std/math/isnan.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/std/math/isnan.zig b/lib/std/math/isnan.zig index cb929e5890..a85100ba90 100644 --- a/lib/std/math/isnan.zig +++ b/lib/std/math/isnan.zig @@ -32,7 +32,13 @@ test isSignalNan { // TODO: Signalling NaN values get converted to quiet NaN values in // some cases where they shouldn't such that this can fail. // See https://github.com/ziglang/zig/issues/14366 - // try expect(isSignalNan(math.snan(T))); + if (!builtin.cpu.arch.isArmOrThumb() and + !builtin.cpu.arch.isAARCH64() and + !builtin.cpu.arch.isPowerPC() and + builtin.zig_backend != .stage2_c) + { + try expect(isSignalNan(math.snan(T))); + } try expect(!isSignalNan(math.nan(T))); try expect(!isSignalNan(@as(T, 1.0))); try expect(!isSignalNan(math.inf(T)));