[llvm] [X86] Support EGPR (R16-R31) for APX (PR #67702)
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 30 20:28:29 PDT 2023
================
@@ -1208,6 +1208,44 @@ namespace X86II {
return false;
}
+ inline bool canUseApxExtendedReg(const MCInstrDesc &Desc) {
+ uint64_t TSFlags = Desc.TSFlags;
+ uint64_t Encoding = TSFlags & EncodingMask;
+ // EVEX can always use egpr.
+ if (Encoding == X86II::EVEX)
+ return true;
+
+ // MAP OB/TB in legacy encoding space can always use egpr except
+ // XSAVE*/XRSTOR*.
+ unsigned Opcode = Desc.Opcode;
+ bool IsSpecial = false;
+ switch (Opcode) {
+ default:
+ // To be conservative, egpr is not used for all pseudo instructions
+ // because we are not sure what instruction it will become.
+ // FIXME: Could we improve it in X86ExpandPseudo?
+ IsSpecial = isPseudo(TSFlags);
+ break;
+ case X86::XSAVE:
+ case X86::XSAVE64:
+ case X86::XSAVEOPT:
+ case X86::XSAVEOPT64:
+ case X86::XSAVEC:
+ case X86::XSAVEC64:
+ case X86::XSAVES:
+ case X86::XSAVES64:
+ case X86::XRSTOR:
+ case X86::XRSTOR64:
+ case X86::XRSTORS:
+ case X86::XRSTORS64:
+ IsSpecial = true;
----------------
KanRobert wrote:
Will do
https://github.com/llvm/llvm-project/pull/67702
More information about the llvm-commits
mailing list