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

Figure out a better type during bitcast of a scalar to a vector #1140

Closed
abrown opened this issue Oct 15, 2019 · 2 comments
Closed

Figure out a better type during bitcast of a scalar to a vector #1140

abrown opened this issue Oct 15, 2019 · 2 comments
Labels
cranelift Issues related to the Cranelift code generator

Comments

@abrown
Copy link
Collaborator

abrown commented Oct 15, 2019

As noted in bytecodealliance/cranelift#1120 (comment), when moving a scalar value (I32 or I64) to a vector register in x86, the destination must be a a I64x2 due to typing restrictions that ensure vectors have more than one lane. This may be rather confusing when looking at CLIF IR because the intent of that move (using the bitcast instruction) is to zero out the upper bits and only load the lower bits using the scalar value--it's more a I128x1 than anything else.

There are several options here, some of which are:

  • leave as-is with I64x2 and remove the TODO comment
  • change the typing restrictions to allow I128x1
  • use a different CLIF instruction altogether
  • etc.
@abrown abrown changed the title Figure out a better types during bitcast of a scalar to a vector Figure out a better type during bitcast of a scalar to a vector Oct 17, 2019
@alexcrichton alexcrichton transferred this issue from bytecodealliance/cranelift Feb 28, 2020
@alexcrichton alexcrichton added the cranelift Issues related to the Cranelift code generator label Feb 28, 2020
@cfallin
Copy link
Member

cfallin commented May 4, 2022

Is this still a relevant issue with the new backends @abrown?

@abrown
Copy link
Collaborator Author

abrown commented May 4, 2022

Nope, closing.

@abrown abrown closed this as completed May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

3 participants