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: Support scalar-vector bitcasts #8692

Merged

Conversation

afonso360
Copy link
Contributor

👋 Hey,

This PR Implements lowerings for casting between scalar types and vector types. This is split between two implementations.

For i128 to 128bit vectors, we have lowerings that correctly split or join the high and low halves.

Additionally, the RISC-V backend fully supports smaller (and larger) vectors, so for vectors 64bit or smaller, we also implement single instruction lowerings to move Vectors to the X and F registers, and vice-versa.

Bitcasting between larger vectors types should already be supported, since we don't actually need to do anything to the register.

cc: #6104

@afonso360 afonso360 added the cranelift:area:riscv64 Issues related to the RISC-V 64 backend. label May 25, 2024
@afonso360 afonso360 requested a review from a team as a code owner May 25, 2024 14:24
@afonso360 afonso360 requested review from cfallin and removed request for a team May 25, 2024 14:24
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label May 25, 2024
@alexcrichton alexcrichton added this pull request to the merge queue May 28, 2024
Merged via the queue into bytecodealliance:main with commit 9a443bc May 28, 2024
66 checks passed
afonso360 added a commit to afonso360/wasmtime that referenced this pull request Jun 20, 2024
This was accidentally broken in bytecodealliance#8692. It turns out bitcasts from i128 to i128 are legal, that PR accidentally reverted that use case.

This is now added to a runtest to ensure it works on all platforms.
afonso360 added a commit to afonso360/wasmtime that referenced this pull request Jun 20, 2024
This was accidentally broken in bytecodealliance#8692. It turns out bitcasts from i128 to i128 are legal, that PR accidentally reverted that use case.

This is now added to a runtest to ensure it works on all platforms.
github-merge-queue bot pushed a commit that referenced this pull request Jun 20, 2024
This was accidentally broken in #8692. It turns out bitcasts from i128 to i128 are legal, that PR accidentally reverted that use case.

This is now added to a runtest to ensure it works on all platforms.
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