Skip to content

cranelift: fix f16 and f128 comparisons with zero - #14522

Open
dotcom07 wants to merge 1 commit into
bytecodealliance:mainfrom
dotcom07:fix/ieee-float-zero-comparison
Open

dotcom07 wants to merge 1 commit into
bytecodealliance:mainfrom
dotcom07:fix/ieee-float-zero-comparison

Conversation

@dotcom07

@dotcom07 dotcom07 commented Oct 4, 2026 •

Copy link
Copy Markdown

Ieee16::partial_cmp and Ieee128::partial_cmp return Equal whenever either operand is zero. This makes the interpreter report that 1 == 0 and that 1 > 0 is 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.

@dotcom07
dotcom07 requested a review from a team as a code owner October 4, 2026 11:09
@dotcom07
dotcom07 requested review from cfallin and removed request for a team October 4, 2026 11:09
@github-actions github-actions Bot added the cranelift Issues related to the Cranelift code generator label Oct 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant