[llvm] [Xtensa] Implement Windowed Register Option. (PR #121118)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 09:08:31 PST 2025
================
@@ -73,17 +74,22 @@ static DecodeStatus DecodeARRegisterClass(MCInst &Inst, uint64_t RegNo,
return MCDisassembler::Success;
}
-static const unsigned SRDecoderTable[] = {Xtensa::SAR, 3};
+static const unsigned SRDecoderTable[] = {
+ Xtensa::SAR, 3, Xtensa::WINDOWBASE, 72, Xtensa::WINDOWSTART, 73};
static DecodeStatus DecodeSRRegisterClass(MCInst &Inst, uint64_t RegNo,
uint64_t Address,
- const void *Decoder) {
+ const MCDisassembler *Decoder) {
if (RegNo > 255)
return MCDisassembler::Fail;
for (unsigned i = 0; i < std::size(SRDecoderTable); i += 2) {
if (SRDecoderTable[i + 1] == RegNo) {
unsigned Reg = SRDecoderTable[i];
+
+ if (!checkRegister(Reg, Decoder->getSubtargetInfo().getFeatureBits()))
----------------
MaskRay wrote:
XtensaDisassembler cannot use functions defined in XtensaCodeGen (Xtensa/CMakeFiles.txt).
After #123969 , you can place checkRegister in MCTargetDesc/
https://github.com/llvm/llvm-project/pull/121118
More information about the llvm-commits
mailing list