Fix scalar_to_vector: move not wide enough for 64-bit values (#1287)
Previously, the use of `enc_x86_64` emitted two 64-bit mode encodings for `scalar_to_vector.i64`, neither of which contained the REX.W bit telling `MOVD/MOVQ` to move 64 bits of data instead of 32 bits. Now, `scalar_to_vector.i64` will always use a sole 64-bit mode REX.W encoding and `scalar_to_vector` with other widths will have three encodings: a 32-bit mode move, a 64-bit mode move with no REX, and a 64-bit mode move with REX (but not REX.W).
This commit is contained in:
@@ -1746,10 +1746,13 @@ pub(crate) fn define(
|
||||
} else {
|
||||
let template = rec_frurm.opcodes(&MOVD_LOAD_XMM);
|
||||
if ty.lane_bits() < 64 {
|
||||
// no 32-bit encodings for 64-bit widths
|
||||
e.enc32(instruction.clone(), template.clone());
|
||||
e.enc_x86_64(instruction, template);
|
||||
} else {
|
||||
// No 32-bit encodings for 64-bit widths.
|
||||
assert_eq!(ty.lane_bits(), 64);
|
||||
e.enc64(instruction, template.rex().w());
|
||||
}
|
||||
e.enc_x86_64(instruction, template);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user