alexcrichton transferred Issue #1146:
As noted in https://github.com/CraneStation/cranelift/pull/1120#discussion_r335156013, when moving a scalar value (
I32orI64) to a vector register in x86, the destination must be a aI64x2due 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 thebitcastinstruction) is to zero out the upper bits and only load the lower bits using the scalar value--it's more aI128x1than anything else.There are several options here, some of which are:
- leave as-is with
I64x2and remove the TODO comment- change the typing restrictions to allow
I128x1- use a different CLIF instruction altogether
- etc.
Last updated: Dec 06 2025 at 06:05 UTC