[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:23 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);
----------------
KanRobert wrote:
Will do.
https://github.com/llvm/llvm-project/pull/67702
More information about the llvm-commits
mailing list