-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add float comparison operators to Winch #7379
Add float comparison operators to Winch #7379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall -- one minor documentation change and I think we can land this.
winch/codegen/src/isa/x64/masm.rs
Outdated
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), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment here explaining why we use the comp kind complement? (e.g. Ge => LeU
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Action
This 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 |
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.ge
operators to Winch.Also renames the macroassembler
CmpKind
enum toIntCmpKind
due to the introduction of aFloatCmpKind
enum.