aboutsummaryrefslogtreecommitdiff
path: root/src/Value.zig
diff options
context:
space:
mode:
authorkcbanner <kcbanner@gmail.com>2024-11-06 19:33:52 -0500
committerkcbanner <kcbanner@gmail.com>2025-03-03 15:35:07 -0500
commit981f84157ce9e37cdc7ea96ea736808b1273142e (patch)
tree664763af25eda9e0c9beeddd5eb7a21086205dbf /src/Value.zig
parentedabcf61927f9699f9b869f304e9aed97f2c4a47 (diff)
downloadzig-981f84157ce9e37cdc7ea96ea736808b1273142e.tar.gz
zig-981f84157ce9e37cdc7ea96ea736808b1273142e.zip
Value: fix comparison of NaN in compareHeteroAdvanaced
Sema: fix equality comparison of signed zeroes and NaN in compareScalar tests: add test coverage for vector float comparisons
Diffstat (limited to 'src/Value.zig')
-rw-r--r--src/Value.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Value.zig b/src/Value.zig
index be2c73c3e9..40e5331c4e 100644
--- a/src/Value.zig
+++ b/src/Value.zig
@@ -1132,6 +1132,8 @@ pub fn compareHeteroAdvanced(
else => {},
}
}
+
+ if (lhs.isNan(zcu) or rhs.isNan(zcu)) return op == .neq;
return (try orderAdvanced(lhs, rhs, strat, zcu, tid)).compare(op);
}