[llvm] [X86][MC] Support encoding of EGPR for APX (PR #71909)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 06:52:32 PST 2023
================
@@ -168,11 +194,34 @@ class X86OpcodePrefixHelper {
setR(Encoding);
setR2(Encoding);
}
+ void setM(bool V) { M = V; }
+ void setXX2(const MCInst &MI, unsigned OpNum) {
+ unsigned Reg = MI.getOperand(OpNum).getReg();
+ unsigned Encoding = MRI.getEncodingValue(Reg);
+ setX(Encoding);
+ // Index can be a vector register while X2 is used to extend GPR only
+ if (Kind <= REX2 || X86II::isApxExtendedReg(Reg))
+ setX2(Encoding);
+ }
+ void setBB2(const MCInst &MI, unsigned OpNum) {
+ unsigned Reg = MI.getOperand(OpNum).getReg();
+ unsigned Encoding = MRI.getEncodingValue(Reg);
+ setB(Encoding);
+ // Base can be a vector register while B2 is used to extend GPR only
+ if (Kind <= REX2 || X86II::isApxExtendedReg(Reg))
+ setB2(Encoding);
+ }
void setZ(bool V) { EVEX_z = V; }
void setL2(bool V) { EVEX_L2 = V; }
void setEVEX_b(bool V) { EVEX_b = V; }
- void setV2(const MCInst &MI, unsigned OpNum) {
- setV2(getRegEncoding(MI, OpNum));
+ void setV2(const MCInst &MI, unsigned OpNum, bool HasVEX_4V) {
+ // Only needed with VSIB which don't use VVVV.
----------------
phoebewang wrote:
with -> by
https://github.com/llvm/llvm-project/pull/71909
More information about the llvm-commits
mailing list