Fix undefined behavior in `decodeSImmOperand` where we were left shifting
a signed value.
int64_t Address,
const MCDisassembler *Decoder) {
assert(isUInt<N>(Imm) && "Invalid immediate");
- // Sign-extend the number in the bottom <N> bits of Imm, then shift left <S>
+ // Shift left Imm <S> bits, then sign-extend the number in the bottom <N+S>
// bits.
- Inst.addOperand(MCOperand::createImm(SignExtend64<N>(Imm) << S));
+ Inst.addOperand(MCOperand::createImm(SignExtend64<N + S>(Imm << S)));
return MCDisassembler::Success;
}