-
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
winch: Support abs and neg for f32 and f64 on x64 #6982
winch: Support abs and neg for f32 and f64 on x64 #6982
Conversation
Co-authored-by: Nick Fitzgerald <[email protected]>
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.
Generally LGTM, thanks! A couple of minor comments:
- Spec tests: we could copy the
<f32|f64>.abs
test cases fromtests/spec_testsuite/<f32|f64>_bitwise.wast
intotests/misc_testsuite/winch/<f32|f64>_bitwise.wast
to get test for these instructions additional to the filetests. This process is a bit manual at the moment, unfortunately, but the idea is that once Winch reaches support for Core Wasm this process should go away almost entirely. - Add
f32.abs
andf64.abs
to the list of supported instructions to the differential fuzzer in https://github.com/bytecodealliance/wasmtime/blob/main/fuzz/fuzz_targets/differential.rs#L289 (I run the differential fuzzer locally from time to time. The idea is to enable fuzzing by default once Winch reaches parity with Core Wasm).
Subscribe to Label Action
This issue or pull request has been labeled: "winch"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
405d17c
to
bf65152
Compare
Subscribe to Label Actioncc @fitzgen
This issue or pull request has been labeled: "fuzzing"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
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.
LGTM, thanks!
This change is a small refactoring to some of the MacroAssembler functions to use `Reg` instead of `RegImm` where appropriate (e.g. when the operand is a destination). @elliottt pointed this out while working on bytecodealliance#6982 This change also changes the signature of `float_abs` and `float_neg`, which can be simplified to take a single register.
This change is a small refactoring to some of the MacroAssembler functions to use `Reg` instead of `RegImm` where appropriate (e.g. when the operand is a destination). @elliottt pointed this out while working on #6982 This change also changes the signature of `float_abs` and `float_neg`, which can be simplified to take a single register.
* winch: Support f32.abs and f64.abs on x64 Co-authored-by: Nick Fitzgerald <[email protected]> * Add an implementation of f32.neg and f64.neg * Enable spec tests for winch with f{32,64}.{neg,abs} * Enable differential fuzzing for f{32,64}.{neg,abs} for winch * Comments from code review --------- Co-authored-by: Nick Fitzgerald <[email protected]>
) * winch: Support f32.abs and f64.abs on x64 Co-authored-by: Nick Fitzgerald <[email protected]> * Add an implementation of f32.neg and f64.neg * Enable spec tests for winch with f{32,64}.{neg,abs} * Enable differential fuzzing for f{32,64}.{neg,abs} for winch * Comments from code review --------- Co-authored-by: Nick Fitzgerald <[email protected]>
This change is a small refactoring to some of the MacroAssembler functions to use `Reg` instead of `RegImm` where appropriate (e.g. when the operand is a destination). @elliottt pointed this out while working on bytecodealliance#6982 This change also changes the signature of `float_abs` and `float_neg`, which can be simplified to take a single register.
Adds support for
f32.abs
,f64.abs
,f32.neg
, andf64.neg
to winch. Additionally, this adds agpr_to_xmm
function to the x64 backend to allow loading a constant and moving it to an xmm register. It also reservesxmm15
as the scratch xmm register.