Add float comparison operators to Winch#7379
Merged
saulecabrera merged 2 commits intobytecodealliance:mainfrom Oct 26, 2023
Merged
Add float comparison operators to Winch#7379saulecabrera merged 2 commits intobytecodealliance:mainfrom
saulecabrera merged 2 commits intobytecodealliance:mainfrom
Conversation
saulecabrera
approved these changes
Oct 26, 2023
Member
saulecabrera
left a comment
There was a problem hiding this comment.
Looks good to me overall -- one minor documentation change and I think we can land this.
Comment on lines
+682
to
+689
| let (src1, src2, set_kind) = match kind { | ||
| FloatCmpKind::Eq => (src1, src2, IntCmpKind::Eq), | ||
| FloatCmpKind::Ne => (src1, src2, IntCmpKind::Ne), | ||
| FloatCmpKind::Lt => (src2, src1, IntCmpKind::GtU), | ||
| FloatCmpKind::Le => (src2, src1, IntCmpKind::GeU), | ||
| FloatCmpKind::Gt => (src2, src1, IntCmpKind::LtU), | ||
| FloatCmpKind::Ge => (src2, src1, IntCmpKind::LeU), | ||
| }; |
Member
There was a problem hiding this comment.
Can we add a comment here explaining why we use the comp kind complement? (e.g. Ge => LeU)
Contributor
Author
There was a problem hiding this comment.
Yeah that's fair. I realized when writing the comments that we only need to perform the complementary comparisons for lt and le given we need to have the PF checks for gt and ge so we're not saving any instructions by swapping those so we no longer swap those.
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "fuzzing", "winch"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #6528. Adds support for the
f32.eq,f64.eq,f32.ne,f64.ne,f32.lt,f64.lt,f32.gt,f64.gt,f32.le,f64.le,f32.ge, andf64.geoperators to Winch.Also renames the macroassembler
CmpKindenum toIntCmpKinddue to the introduction of aFloatCmpKindenum.