dotcom07 opened PR #14522 from dotcom07:fix/ieee-float-zero-comparison to bytecodealliance:main:
Ieee16::partial_cmpandIeee128::partial_cmpreturnEqualwhenever either operand is zero. This makes the interpreter report that1 == 0and that1 > 0is false. Require both operands to be zero for the special case, preserving equality between positive and negative zero.Adds unit tests for both types covering signed zeros, positive and negative one, and the smallest positive and negative subnormals, with operands in both orders.
Tested with
cargo +1.97.0 test -p cranelift-codegen --lib --offline(214 tests passed).
dotcom07 requested cfallin for a review on PR #14522.
dotcom07 requested wasmtime-compiler-reviewers for a review on PR #14522.
github-actions[bot] added the label cranelift on PR #14522.
dotcom07 edited PR #14522:
Ieee16::partial_cmpandIeee128::partial_cmpreturnEqualwhenever either operand is zero. This makes the interpreter report that1 == 0and that1 > 0is false. Require both operands to be zero for the special case, preserving equality between positive and negative zero.Adds unit tests for both types covering signed zeros, positive and negative one, and the smallest positive and negative subnormals, with operands in both orders.
cfallin commented on PR #14522:
@dotcom07 thanks for this PR. I'm the assigned reviewer but I am quite underwater this week with a bunch of other things, so I will get to it probably early or mid next week.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #14522 cranelift: fix f16 and f128 comparisons with zero to the merge queue.
:check: cfallin merged PR #14522.
cfallin removed PR #14522 cranelift: fix f16 and f128 comparisons with zero from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC