================
@@ -535,6 +535,19 @@ static DecodeStatus decodeRTZArg(MCInst &Inst, uint32_t
Imm, int64_t Address,
Inst.addOperand(MCOperand::createImm(Imm));
return MCDisassembler::Success;
}
+template <int Bits>
+static DecodeStatus DecodeSImm(MCInst &Inst, uint64_t Imm, uint64_t Address,
+ const MCDisassembler *Decoder) {
+ if (Imm & ~((1LL << Bits) - 1))
+ return MCDisassembler::Fail;
+
+ // Imm is a signed immediate, so sign extend it.
+ if (Imm & (1 << (Bits - 1)))
+ Imm |= ~((1LL << Bits) - 1);
----------------
topperc wrote:
Please use the SignExtend utility in MathExtras.h
https://github.com/llvm/llvm-project/pull/145647
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits