machinst x64: mask shift count too;
This commit is contained in:
@@ -655,12 +655,8 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let (count, rhs) = if let Some(cst) = ctx.get_input(insn, 1).constant {
|
let (count, rhs) = if let Some(cst) = ctx.get_input(insn, 1).constant {
|
||||||
let cst = if op == Opcode::Rotl || op == Opcode::Rotr {
|
// Mask count, according to Cranelift's semantics.
|
||||||
// Mask rotation count, according to Cranelift's semantics.
|
let cst = (cst as u8) & (dst_ty.bits() as u8 - 1);
|
||||||
(cst as u8) & (dst_ty.bits() as u8 - 1)
|
|
||||||
} else {
|
|
||||||
cst as u8
|
|
||||||
};
|
|
||||||
(Some(cst), None)
|
(Some(cst), None)
|
||||||
} else {
|
} else {
|
||||||
(None, Some(input_to_reg(ctx, inputs[1])))
|
(None, Some(input_to_reg(ctx, inputs[1])))
|
||||||
|
|||||||
Reference in New Issue
Block a user