[llvm] [Xtensa] Implement Windowed Register Option. (PR #121118)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 25 19:33:29 PST 2024
================
@@ -210,6 +211,32 @@ static DecodeStatus decodeImm32n_95Operand(MCInst &Inst, uint64_t Imm,
return MCDisassembler::Success;
}
+static DecodeStatus decodeImm8n_7Operand(MCInst &Inst, uint64_t Imm,
+ int64_t Address, const void *Decoder) {
+ assert(isUInt<4>(Imm) && "Invalid immediate");
+ if (Imm > 7)
+ Inst.addOperand(MCOperand::createImm(Imm - 16));
+ else
+ Inst.addOperand(MCOperand::createImm(Imm));
----------------
arsenm wrote:
```suggestion
Inst.addOperand(MCOperand::createImm(Imm > 7 ? Imm - 16 : Imm));
```
https://github.com/llvm/llvm-project/pull/121118
More information about the llvm-commits
mailing list