Skip to content
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

riscv64: Implement various SIMD float ops #6657

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

afonso360
Copy link
Contributor

👋 Hey,

This PR implements a few SIMD float ops. These are:

  • fabs
  • fcopysign
  • fmin_pseudo
  • fmax_pseudo
  • fmin
  • fmax

f{min,max} are slightly complicated since we don't have a instruction that exactly matches the required semantics. The implementation here builds a mask for the inputs that are NaN and returns the canonical NaN in these cases. This is the same lowering that V8 uses.

I've had to alter the simd-fmax-fmin tests since they were expecting the sign bit of the resulting NaN to be unchanged, however this seems not to be required as per our documentation. I've moved these tests to the nondeterministic testsuites that we have.

@afonso360 afonso360 added the cranelift:area:riscv64 Issues related to the RISC-V 64 backend. label Jun 28, 2023
@afonso360 afonso360 requested review from a team as code owners June 28, 2023 13:17
@afonso360 afonso360 requested review from fitzgen and removed request for a team June 28, 2023 13:17
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Jun 28, 2023
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alexcrichton alexcrichton added this pull request to the merge queue Jun 28, 2023
Merged via the queue into bytecodealliance:main with commit 6755f35 Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:riscv64 Issues related to the RISC-V 64 backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants