Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cranelift: Support loading and storing vector types smaller than 128bit #10254

Open
bjorn3 opened this issue Feb 20, 2025 · 1 comment
Open

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Feb 20, 2025

Feature

While Cranelift can represent vector types smaller than 128bit, load and store operations for these smaller vector types are not implemented.

Benefit

Rustc has started passing vector types in vector registers on x86_64. Some of these vector types may be smaller than 128bit. Previously these vector types didn't need to be exposed to Cranelift as all vector operations are emulated by cg_clif using scalar operations. However now that they are passed in vector registers, cg_clif needs to use vector types at the ABI level and thus needs to support loading and storing small vectors.

Implementation

TODO: Do you have an implementation plan, and/or ideas for data structures or
algorithms to use?

Alternatives

Have a bunch of code in cg_clif dedicated to handling this. I probably need this anyway for the time being, but I prefer if I can get rid of it as soon as possible through native Cranelift support.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Feb 20, 2025

Looks like a workaround in cg_clif based on bitcast doesn't work.

Edit: Right, that is at the very least #6104.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant