[llvm] [Xtensa] Implement Windowed Register Option. (PR #121118)

Andrei Safronov via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 26 14:15:57 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()))
----------------
andreisfr wrote:

Thank you very much!

https://github.com/llvm/llvm-project/pull/121118


More information about the llvm-commits mailing list