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 SIMD floating point conversion instructions #6924

Merged
merged 4 commits into from
Aug 30, 2023

Conversation

afonso360
Copy link
Contributor

@afonso360 afonso360 commented Aug 29, 2023

👋 Hey,

This PR implements the floating point conversion instructions (fvdemote, fvpromote_low, fcvt_{to,from}_{u,s}int{,_sat}) on the RISC-V backend.

Almost all instructions match 1-to-1 with the WASM spec, except fcvt_to_{u,s}int_sat, where NaN's need to be manually zeroed out. And on fvdemote RISC-V leaves the upper lanes undefined, so we also zero them out manually.


🎉 With this PR we now have SIMD fully implemented for RISC-V🎉

There is 1 test that is not passing yet, but I think that is due to a NaN payload bit mismatch that is allowed by the spec. But I'm going to open a separate issue to confirm that.

(This PR is built on top of #6920 so we need to merge that one first)

@afonso360 afonso360 added the cranelift:area:riscv64 Issues related to the RISC-V 64 backend. label Aug 29, 2023
@afonso360 afonso360 requested review from a team as code owners August 29, 2023 16:49
@afonso360 afonso360 requested review from elliottt and removed request for a team August 29, 2023 16:49
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Aug 29, 2023
@github-actions
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "cranelift", "cranelift:area:riscv64", "isle"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

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.

🎊 nice!

You've done quite a lot of work on this backend and it's very much appreciated, thank you!

@alexcrichton alexcrichton enabled auto-merge August 30, 2023 20:37
@alexcrichton alexcrichton added this pull request to the merge queue Aug 30, 2023
Merged via the queue into bytecodealliance:main with commit 55fa2e7 Aug 30, 2023
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Sep 6, 2023
…odealliance#6924)

* riscv64: Implement SIMD `fvpromote_low`/`fvdemote`

* riscv64: Implement SIMD `fcvt_from_{u,s}int`

* riscv64: Implement SIMD `fcvt_to_{u,s}int_sat`

* riscv64: Use `i8_to_imm5` constructor
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 isle Related to the ISLE domain-specific language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants