Skip to content

Commit 04a7ec6

Browse files
committed
[X86][NFC] Remove VEX_W1X after 80dbf60
1 parent 80dbf60 commit 04a7ec6

6 files changed

+271
-45
lines changed

llvm/lib/Target/X86/X86InstrAVX512.td

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ multiclass vinsert_for_type<ValueType EltVT32, int Opcode128,
448448
X86VectorVTInfo< 2, EltVT64, VR128X>,
449449
X86VectorVTInfo< 4, EltVT64, VR256X>,
450450
null_frag, vinsert128_insert, sched>,
451-
VEX_W1X, EVEX_V256;
451+
EVEX_V256, REX_W;
452452

453453
// Even with DQI we'd like to only use these instructions for masking.
454454
let Predicates = [HasDQI] in {
@@ -750,7 +750,7 @@ multiclass vextract_for_type<ValueType EltVT32, int Opcode128,
750750
X86VectorVTInfo< 4, EltVT64, VR256X>,
751751
X86VectorVTInfo< 2, EltVT64, VR128X>,
752752
null_frag, vextract128_extract, SchedRR, SchedMR>,
753-
VEX_W1X, EVEX_V256, EVEX_CD8<64, CD8VT2>;
753+
EVEX_V256, EVEX_CD8<64, CD8VT2>, REX_W;
754754

755755
// Even with DQI we'd like to only use these instructions for masking.
756756
let Predicates = [HasDQI] in {
@@ -1161,7 +1161,7 @@ multiclass avx512_fp_broadcast_ss<bits<8> opc, string OpcodeStr,
11611161
defm VBROADCASTSS : avx512_fp_broadcast_ss<0x18, "vbroadcastss",
11621162
avx512vl_f32_info>;
11631163
defm VBROADCASTSD : avx512_fp_broadcast_sd<0x19, "vbroadcastsd",
1164-
avx512vl_f64_info>, VEX_W1X;
1164+
avx512vl_f64_info>, REX_W;
11651165

11661166
multiclass avx512_int_broadcast_reg<bits<8> opc, SchedWrite SchedRR,
11671167
X86VectorVTInfo _, SDPatternOperator OpNode,
@@ -1267,7 +1267,7 @@ defm VPBROADCASTW : avx512_int_broadcast_rm_vl<0x79, "vpbroadcastw",
12671267
defm VPBROADCASTD : avx512_int_broadcast_rm_vl<0x58, "vpbroadcastd",
12681268
avx512vl_i32_info, HasAVX512, 1>;
12691269
defm VPBROADCASTQ : avx512_int_broadcast_rm_vl<0x59, "vpbroadcastq",
1270-
avx512vl_i64_info, HasAVX512, 1>, VEX_W1X;
1270+
avx512vl_i64_info, HasAVX512, 1>, REX_W;
12711271

12721272
multiclass avx512_subvec_broadcast_rm<bits<8> opc, string OpcodeStr,
12731273
SDPatternOperator OpNode,
@@ -1460,11 +1460,11 @@ let Predicates = [HasBF16, HasVLX] in
14601460

14611461
let Predicates = [HasVLX, HasDQI] in {
14621462
defm VBROADCASTI64X2Z128 : avx512_subvec_broadcast_rm_dq<0x5a, "vbroadcasti64x2",
1463-
X86SubVBroadcastld128, v4i64x_info, v2i64x_info>, VEX_W1X,
1464-
EVEX_V256, EVEX_CD8<64, CD8VT2>;
1463+
X86SubVBroadcastld128, v4i64x_info, v2i64x_info>,
1464+
EVEX_V256, EVEX_CD8<64, CD8VT2>, REX_W;
14651465
defm VBROADCASTF64X2Z128 : avx512_subvec_broadcast_rm_dq<0x1a, "vbroadcastf64x2",
1466-
X86SubVBroadcastld128, v4f64x_info, v2f64x_info>, VEX_W1X,
1467-
EVEX_V256, EVEX_CD8<64, CD8VT2>;
1466+
X86SubVBroadcastld128, v4f64x_info, v2f64x_info>,
1467+
EVEX_V256, EVEX_CD8<64, CD8VT2>, REX_W;
14681468

14691469
// Patterns for selects of bitcasted operations.
14701470
def : Pat<(vselect_mask VK4WM:$mask,
@@ -6396,7 +6396,7 @@ defm VPERMILPS : avx512_permil<"vpermilps", 0x04, 0x0C, avx512vl_f32_info,
63966396
avx512vl_i32_info>;
63976397
let ExeDomain = SSEPackedDouble in
63986398
defm VPERMILPD : avx512_permil<"vpermilpd", 0x05, 0x0D, avx512vl_f64_info,
6399-
avx512vl_i64_info>, VEX_W1X;
6399+
avx512vl_i64_info>, REX_W;
64006400

64016401
//===----------------------------------------------------------------------===//
64026402
// AVX-512 - VPSHUFD, VPSHUFLW, VPSHUFHW

llvm/lib/Target/X86/X86InstrFormats.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins,
247247
bit hasREPPrefix = 0; // Does this inst have a REP prefix?
248248
bits<2> OpEncBits = OpEnc.Value;
249249
bit IgnoresW = 0; // Does this inst ignore REX_W field?
250-
bit EVEX_W1_VEX_W0 = 0; // This EVEX inst with VEX.W==1 can become a VEX
251-
// instruction with VEX.W == 0.
252250
bit hasVEX_4V = 0; // Does this inst require the VEX.VVVV field?
253251
bit hasVEX_L = 0; // Does this inst use large (256-bit) registers?
254252
bit ignoresVEX_L = 0; // Does this instruction ignore the L-bit

llvm/lib/Target/X86/X86InstrUtils.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class XOP { Encoding OpEnc = EncXOP; }
4343
class VEX { Encoding OpEnc = EncVEX; }
4444
class EVEX { Encoding OpEnc = EncEVEX; }
4545
class WIG { bit IgnoresW = 1; }
46-
// Special version of REX_W that can be changed to VEX.W==0 for EVEX2VEX.
47-
class VEX_W1X { bit hasREX_W = 1; bit EVEX_W1_VEX_W0 = 1; }
4846
class VEX_L { bit hasVEX_L = 1; }
4947
class VEX_LIG { bit ignoresVEX_L = 1; }
5048
class VVVV { bit hasVEX_4V = 1; }

llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,23 @@ static inline uint64_t getValueFromBitsInit(const BitsInit *B) {
9595
return Value;
9696
}
9797

98-
// Function object - Operator() returns true if the given VEX instruction
99-
// matches the EVEX instruction of this object.
10098
class IsMatch {
101-
const CodeGenInstruction *EVEXInst;
99+
const CodeGenInstruction *OldInst;
102100

103101
public:
104-
IsMatch(const CodeGenInstruction *EVEXInst) : EVEXInst(EVEXInst) {}
105-
106-
bool operator()(const CodeGenInstruction *VEXInst) {
107-
RecognizableInstrBase VEXRI(*VEXInst);
108-
RecognizableInstrBase EVEXRI(*EVEXInst);
109-
bool VEX_W = VEXRI.HasREX_W;
110-
bool EVEX_W = EVEXRI.HasREX_W;
111-
bool VEX_WIG = VEXRI.IgnoresW;
112-
bool EVEX_WIG = EVEXRI.IgnoresW;
113-
bool EVEX_W1_VEX_W0 = EVEXInst->TheDef->getValueAsBit("EVEX_W1_VEX_W0");
114-
115-
if (VEXRI.IsCodeGenOnly != EVEXRI.IsCodeGenOnly ||
116-
// VEX/EVEX fields
117-
VEXRI.OpPrefix != EVEXRI.OpPrefix || VEXRI.OpMap != EVEXRI.OpMap ||
118-
VEXRI.HasVEX_4V != EVEXRI.HasVEX_4V ||
119-
VEXRI.HasVEX_L != EVEXRI.HasVEX_L ||
120-
// Match is allowed if either is VEX_WIG, or they match, or EVEX
121-
// is VEX_W1X and VEX is VEX_W0.
122-
(!(VEX_WIG || (!EVEX_WIG && EVEX_W == VEX_W) ||
123-
(EVEX_W1_VEX_W0 && EVEX_W && !VEX_W))) ||
124-
// Instruction's format
125-
VEXRI.Form != EVEXRI.Form)
102+
IsMatch(const CodeGenInstruction *OldInst) : OldInst(OldInst) {}
103+
104+
bool operator()(const CodeGenInstruction *NewInst) {
105+
RecognizableInstrBase NewRI(*NewInst);
106+
RecognizableInstrBase OldRI(*OldInst);
107+
108+
// Return false if any of the following fields of does not match.
109+
if (std::make_tuple(OldRI.IsCodeGenOnly, OldRI.OpMap, NewRI.OpPrefix,
110+
OldRI.HasVEX_4V, OldRI.HasVEX_L, OldRI.HasREX_W,
111+
OldRI.Form) !=
112+
std::make_tuple(NewRI.IsCodeGenOnly, NewRI.OpMap, OldRI.OpPrefix,
113+
NewRI.HasVEX_4V, NewRI.HasVEX_L, NewRI.HasREX_W,
114+
NewRI.Form))
126115
return false;
127116

128117
// This is needed for instructions with intrinsic version (_Int).
@@ -131,9 +120,9 @@ class IsMatch {
131120
// Also for instructions that their EVEX version was upgraded to work with
132121
// k-registers. For example VPCMPEQBrm (xmm output register) and
133122
// VPCMPEQBZ128rm (k register output register).
134-
for (unsigned i = 0, e = EVEXInst->Operands.size(); i < e; i++) {
135-
Record *OpRec1 = EVEXInst->Operands[i].Rec;
136-
Record *OpRec2 = VEXInst->Operands[i].Rec;
123+
for (unsigned i = 0, e = OldInst->Operands.size(); i < e; i++) {
124+
Record *OpRec1 = OldInst->Operands[i].Rec;
125+
Record *OpRec2 = NewInst->Operands[i].Rec;
137126

138127
if (OpRec1 == OpRec2)
139128
continue;

llvm/utils/TableGen/X86FoldTablesEmitter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,17 +374,15 @@ class IsMatch {
374374
RegRI.HasEVEX_L2, RegRI.HasEVEX_NF,
375375
RegRec->getValueAsBit("hasEVEX_RC"),
376376
RegRec->getValueAsBit("hasLockPrefix"),
377-
RegRec->getValueAsBit("hasNoTrackPrefix"),
378-
RegRec->getValueAsBit("EVEX_W1_VEX_W0")) !=
377+
RegRec->getValueAsBit("hasNoTrackPrefix")) !=
379378
std::make_tuple(MemRI.Encoding, MemRI.Opcode, MemRI.OpPrefix,
380379
MemRI.OpMap, MemRI.OpSize, MemRI.AdSize, MemRI.HasREX_W,
381380
MemRI.HasVEX_4V, MemRI.HasVEX_L, MemRI.IgnoresVEX_L,
382381
MemRI.IgnoresW, MemRI.HasEVEX_K, MemRI.HasEVEX_KZ,
383382
MemRI.HasEVEX_L2, MemRI.HasEVEX_NF,
384383
MemRec->getValueAsBit("hasEVEX_RC"),
385384
MemRec->getValueAsBit("hasLockPrefix"),
386-
MemRec->getValueAsBit("hasNoTrackPrefix"),
387-
MemRec->getValueAsBit("EVEX_W1_VEX_W0")))
385+
MemRec->getValueAsBit("hasNoTrackPrefix")))
388386
return false;
389387

390388
// Make sure the sizes of the operands of both instructions suit each other.

0 commit comments

Comments
 (0)