xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/VOPCInstructions.td (revision 6966ac055c3b7a39266fb982493330df7a097997)
1//===-- VOPCInstructions.td - Vector Instruction Defintions ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9//===----------------------------------------------------------------------===//
10// Encodings
11//===----------------------------------------------------------------------===//
12
13class VOPCe <bits<8> op> : Enc32 {
14  bits<9> src0;
15  bits<8> src1;
16
17  let Inst{8-0} = src0;
18  let Inst{16-9} = src1;
19  let Inst{24-17} = op;
20  let Inst{31-25} = 0x3e;
21}
22
23class VOPC_SDWAe <bits<8> op, VOPProfile P> : VOP_SDWAe <P> {
24  bits<8> src1;
25
26  let Inst{8-0}   = 0xf9; // sdwa
27  let Inst{16-9}  = !if(P.HasSrc1, src1{7-0}, 0);
28  let Inst{24-17} = op;
29  let Inst{31-25} = 0x3e; // encoding
30
31  // VOPC disallows dst_sel and dst_unused as they have no effect on destination
32  let Inst{42-40} = 0;
33  let Inst{44-43} = 0;
34}
35
36class VOPC_SDWA9e <bits<8> op, VOPProfile P> : VOP_SDWA9Be <P> {
37  bits<9> src1;
38
39  let Inst{8-0}   = 0xf9; // sdwa
40  let Inst{16-9}  = !if(P.HasSrc1, src1{7-0}, 0);
41  let Inst{24-17} = op;
42  let Inst{31-25} = 0x3e; // encoding
43  let Inst{63}    = !if(P.HasSrc1, src1{8}, 0); // src1_sgpr
44}
45
46
47//===----------------------------------------------------------------------===//
48// VOPC classes
49//===----------------------------------------------------------------------===//
50
51// VOPC instructions are a special case because for the 32-bit
52// encoding, we want to display the implicit vcc write as if it were
53// an explicit $dst.
54class VOPC_Profile<list<SchedReadWrite> sched, ValueType vt0, ValueType vt1 = vt0> :
55  VOPProfile <[i1, vt0, vt1, untyped]> {
56  let Asm32 = "$src0, $src1";
57  // The destination for 32-bit encoding is implicit.
58  let HasDst32 = 0;
59  let Outs64 = (outs VOPDstS64orS32:$sdst);
60  list<SchedReadWrite> Schedule = sched;
61}
62
63class VOPC_NoSdst_Profile<list<SchedReadWrite> sched, ValueType vt0,
64                          ValueType vt1 = vt0> :
65  VOPC_Profile<sched, vt0, vt1> {
66  let Outs64 = (outs );
67  let OutsSDWA = (outs );
68  let InsSDWA = (ins Src0ModSDWA:$src0_modifiers, Src0SDWA:$src0,
69                     Src1ModSDWA:$src1_modifiers, Src1SDWA:$src1,
70                     src0_sel:$src0_sel, src1_sel:$src1_sel);
71  let Asm64 = !if(isFloatType<Src0VT>.ret, "$src0_modifiers, $src1_modifiers$clamp",
72                                           "$src0, $src1");
73  let AsmSDWA9 = "$src0_modifiers, $src1_modifiers $src0_sel $src1_sel";
74  let EmitDst = 0;
75}
76
77class VOPC_Pseudo <string opName, VOPC_Profile P, list<dag> pattern=[],
78                   bit DefVcc = 1> :
79  InstSI<(outs), P.Ins32, "", pattern>,
80  VOP <opName>,
81  SIMCInstr<opName#"_e32", SIEncodingFamily.NONE> {
82
83  let isPseudo = 1;
84  let isCodeGenOnly = 1;
85  let UseNamedOperandTable = 1;
86
87  string Mnemonic = opName;
88  string AsmOperands = P.Asm32;
89
90  let Size = 4;
91  let mayLoad = 0;
92  let mayStore = 0;
93  let hasSideEffects = 0;
94
95  let VALU = 1;
96  let VOPC = 1;
97  let Uses = [EXEC];
98  let Defs = !if(DefVcc, [VCC], []);
99
100  VOPProfile Pfl = P;
101}
102
103class VOPC_Real <VOPC_Pseudo ps, int EncodingFamily> :
104  InstSI <ps.OutOperandList, ps.InOperandList, ps.PseudoInstr # " " # ps.AsmOperands, []>,
105  SIMCInstr <ps.PseudoInstr, EncodingFamily> {
106
107  let isPseudo = 0;
108  let isCodeGenOnly = 0;
109
110  let Constraints     = ps.Constraints;
111  let DisableEncoding = ps.DisableEncoding;
112
113  // copy relevant pseudo op flags
114  let SubtargetPredicate = ps.SubtargetPredicate;
115  let AsmMatchConverter  = ps.AsmMatchConverter;
116  let Constraints        = ps.Constraints;
117  let DisableEncoding    = ps.DisableEncoding;
118  let TSFlags            = ps.TSFlags;
119  let UseNamedOperandTable = ps.UseNamedOperandTable;
120  let Uses                 = ps.Uses;
121  let Defs                 = ps.Defs;
122}
123
124class VOPC_SDWA_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[]> :
125  VOP_SDWA_Pseudo <OpName, P, pattern> {
126  let AsmMatchConverter = "cvtSdwaVOPC";
127}
128
129// This class is used only with VOPC instructions. Use $sdst for out operand
130class VOPCInstAlias <VOP3_Pseudo ps, Instruction inst,
131                     string Asm32 = ps.Pfl.Asm32, VOPProfile p = ps.Pfl> :
132  InstAlias <ps.OpName#" "#Asm32, (inst)>, PredicateControl {
133
134  field bit isCompare;
135  field bit isCommutable;
136
137  let ResultInst =
138    !if (p.HasDst32,
139      !if (!eq(p.NumSrcArgs, 0),
140        // 1 dst, 0 src
141        (inst p.DstRC:$sdst),
142      !if (!eq(p.NumSrcArgs, 1),
143        // 1 dst, 1 src
144        (inst p.DstRC:$sdst, p.Src0RC32:$src0),
145      !if (!eq(p.NumSrcArgs, 2),
146        // 1 dst, 2 src
147        (inst p.DstRC:$sdst, p.Src0RC32:$src0, p.Src1RC32:$src1),
148      // else - unreachable
149        (inst)))),
150    // else
151      !if (!eq(p.NumSrcArgs, 2),
152        // 0 dst, 2 src
153        (inst p.Src0RC32:$src0, p.Src1RC32:$src1),
154      !if (!eq(p.NumSrcArgs, 1),
155        // 0 dst, 1 src
156        (inst p.Src0RC32:$src1),
157      // else
158        // 0 dst, 0 src
159        (inst))));
160
161  let AsmVariantName = AMDGPUAsmVariants.Default;
162  let SubtargetPredicate = AssemblerPredicate;
163}
164
165multiclass VOPCInstAliases <string OpName, string Arch> {
166  def : VOPCInstAlias <!cast<VOP3_Pseudo>(OpName#"_e64"),
167                       !cast<Instruction>(OpName#"_e32_"#Arch)>;
168  let WaveSizePredicate = isWave32 in {
169    def : VOPCInstAlias <!cast<VOP3_Pseudo>(OpName#"_e64"),
170                         !cast<Instruction>(OpName#"_e32_"#Arch),
171                         "vcc_lo, "#!cast<VOP3_Pseudo>(OpName#"_e64").Pfl.Asm32>;
172  }
173  let WaveSizePredicate = isWave64 in {
174    def : VOPCInstAlias <!cast<VOP3_Pseudo>(OpName#"_e64"),
175                         !cast<Instruction>(OpName#"_e32_"#Arch),
176                         "vcc, "#!cast<VOP3_Pseudo>(OpName#"_e64").Pfl.Asm32>;
177  }
178}
179
180multiclass VOPCXInstAliases <string OpName, string Arch> {
181  def : VOPCInstAlias <!cast<VOP3_Pseudo>(OpName#"_e64"),
182                       !cast<Instruction>(OpName#"_e32_"#Arch)>;
183}
184
185
186class getVOPCPat64 <PatLeaf cond, VOPProfile P> : LetDummies {
187  list<dag> ret = !if(P.HasModifiers,
188      [(set i1:$sdst,
189        (setcc (P.Src0VT
190                  !if(P.HasOMod,
191                    (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod),
192                    (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp))),
193               (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers)),
194               cond))],
195      [(set i1:$sdst, (setcc P.Src0VT:$src0, P.Src1VT:$src1, cond))]);
196}
197
198class VCMPXNoSDstTable <bit has_sdst, string Name> {
199  bit HasSDst = has_sdst;
200  string NoSDstOp = Name;
201}
202
203multiclass VOPC_Pseudos <string opName,
204                         VOPC_Profile P,
205                         PatLeaf cond = COND_NULL,
206                         string revOp = opName,
207                         bit DefExec = 0> {
208
209  def _e32 : VOPC_Pseudo <opName, P>,
210             Commutable_REV<revOp#"_e32", !eq(revOp, opName)>,
211             VCMPXNoSDstTable<1, opName#"_e32"> {
212    let Defs = !if(DefExec, [VCC, EXEC], [VCC]);
213    let SchedRW = P.Schedule;
214    let isConvergent = DefExec;
215    let isCompare = 1;
216    let isCommutable = 1;
217  }
218
219  def _e64 : VOP3_Pseudo<opName, P, getVOPCPat64<cond, P>.ret>,
220    Commutable_REV<revOp#"_e64", !eq(revOp, opName)>,
221    VCMPXNoSDstTable<1, opName#"_e64"> {
222    let Defs = !if(DefExec, [EXEC], []);
223    let SchedRW = P.Schedule;
224    let isCompare = 1;
225    let isCommutable = 1;
226  }
227
228  def _sdwa : VOPC_SDWA_Pseudo <opName, P> {
229    let Defs = !if(DefExec, [VCC, EXEC], [VCC]);
230    let SchedRW = P.Schedule;
231    let isConvergent = DefExec;
232    let isCompare = 1;
233  }
234}
235
236let SubtargetPredicate = HasSdstCMPX in {
237multiclass VOPCX_Pseudos <string opName,
238                          VOPC_Profile P, VOPC_Profile P_NoSDst,
239                          PatLeaf cond = COND_NULL,
240                          string revOp = opName> :
241           VOPC_Pseudos <opName, P, cond, revOp, 1> {
242
243  def _nosdst_e32 : VOPC_Pseudo <opName#"_nosdst", P_NoSDst, [], 0>,
244             Commutable_REV<revOp#"_nosdst_e32", !eq(revOp, opName)>,
245             VCMPXNoSDstTable<0, opName#"_e32"> {
246    let Defs = [EXEC];
247    let SchedRW = P_NoSDst.Schedule;
248    let isConvergent = 1;
249    let isCompare = 1;
250    let isCommutable = 1;
251    let SubtargetPredicate = HasNoSdstCMPX;
252  }
253
254  def _nosdst_e64 : VOP3_Pseudo<opName#"_nosdst", P_NoSDst>,
255    Commutable_REV<revOp#"_nosdst_e64", !eq(revOp, opName)>,
256    VCMPXNoSDstTable<0, opName#"_e64"> {
257    let Defs = [EXEC];
258    let SchedRW = P_NoSDst.Schedule;
259    let isCompare = 1;
260    let isCommutable = 1;
261    let SubtargetPredicate = HasNoSdstCMPX;
262  }
263
264  def _nosdst_sdwa : VOPC_SDWA_Pseudo <opName#"_nosdst", P_NoSDst> {
265    let Defs = [EXEC];
266    let SchedRW = P_NoSDst.Schedule;
267    let isConvergent = 1;
268    let isCompare = 1;
269    let SubtargetPredicate = HasNoSdstCMPX;
270  }
271}
272} // End SubtargetPredicate = HasSdstCMPX
273
274def VOPC_I1_F16_F16 : VOPC_Profile<[Write32Bit], f16>;
275def VOPC_I1_F32_F32 : VOPC_Profile<[Write32Bit], f32>;
276def VOPC_I1_F64_F64 : VOPC_Profile<[WriteDoubleAdd], f64>;
277def VOPC_I1_I16_I16 : VOPC_Profile<[Write32Bit], i16>;
278def VOPC_I1_I32_I32 : VOPC_Profile<[Write32Bit], i32>;
279def VOPC_I1_I64_I64 : VOPC_Profile<[Write64Bit], i64>;
280
281def VOPC_F16_F16 : VOPC_NoSdst_Profile<[Write32Bit], f16>;
282def VOPC_F32_F32 : VOPC_NoSdst_Profile<[Write32Bit], f32>;
283def VOPC_F64_F64 : VOPC_NoSdst_Profile<[Write64Bit], f64>;
284def VOPC_I16_I16 : VOPC_NoSdst_Profile<[Write32Bit], i16>;
285def VOPC_I32_I32 : VOPC_NoSdst_Profile<[Write32Bit], i32>;
286def VOPC_I64_I64 : VOPC_NoSdst_Profile<[Write64Bit], i64>;
287
288multiclass VOPC_F16 <string opName, PatLeaf cond = COND_NULL, string revOp = opName> :
289  VOPC_Pseudos <opName, VOPC_I1_F16_F16, cond, revOp, 0>;
290
291multiclass VOPC_F32 <string opName, PatLeaf cond = COND_NULL, string revOp = opName> :
292  VOPC_Pseudos <opName, VOPC_I1_F32_F32, cond, revOp, 0>;
293
294multiclass VOPC_F64 <string opName, PatLeaf cond = COND_NULL, string revOp = opName> :
295  VOPC_Pseudos <opName, VOPC_I1_F64_F64, cond, revOp, 0>;
296
297multiclass VOPC_I16 <string opName, PatLeaf cond = COND_NULL, string revOp = opName> :
298  VOPC_Pseudos <opName, VOPC_I1_I16_I16, cond, revOp, 0>;
299
300multiclass VOPC_I32 <string opName, PatLeaf cond = COND_NULL, string revOp = opName> :
301  VOPC_Pseudos <opName, VOPC_I1_I32_I32, cond, revOp, 0>;
302
303multiclass VOPC_I64 <string opName, PatLeaf cond = COND_NULL, string revOp = opName> :
304  VOPC_Pseudos <opName, VOPC_I1_I64_I64, cond, revOp, 0>;
305
306multiclass VOPCX_F16 <string opName, string revOp = opName> :
307  VOPCX_Pseudos <opName, VOPC_I1_F16_F16, VOPC_F16_F16, COND_NULL, revOp>;
308
309multiclass VOPCX_F32 <string opName, string revOp = opName> :
310  VOPCX_Pseudos <opName, VOPC_I1_F32_F32, VOPC_F32_F32, COND_NULL, revOp>;
311
312multiclass VOPCX_F64 <string opName, string revOp = opName> :
313  VOPCX_Pseudos <opName, VOPC_I1_F64_F64, VOPC_F64_F64, COND_NULL, revOp>;
314
315multiclass VOPCX_I16 <string opName, string revOp = opName> :
316  VOPCX_Pseudos <opName, VOPC_I1_I16_I16, VOPC_I16_I16, COND_NULL, revOp>;
317
318multiclass VOPCX_I32 <string opName, string revOp = opName> :
319  VOPCX_Pseudos <opName, VOPC_I1_I32_I32, VOPC_I32_I32, COND_NULL, revOp>;
320
321multiclass VOPCX_I64 <string opName, string revOp = opName> :
322  VOPCX_Pseudos <opName, VOPC_I1_I64_I64, VOPC_I64_I64, COND_NULL, revOp>;
323
324
325//===----------------------------------------------------------------------===//
326// Compare instructions
327//===----------------------------------------------------------------------===//
328
329defm V_CMP_F_F32 : VOPC_F32 <"v_cmp_f_f32">;
330defm V_CMP_LT_F32 : VOPC_F32 <"v_cmp_lt_f32", COND_OLT, "v_cmp_gt_f32">;
331defm V_CMP_EQ_F32 : VOPC_F32 <"v_cmp_eq_f32", COND_OEQ>;
332defm V_CMP_LE_F32 : VOPC_F32 <"v_cmp_le_f32", COND_OLE, "v_cmp_ge_f32">;
333defm V_CMP_GT_F32 : VOPC_F32 <"v_cmp_gt_f32", COND_OGT>;
334defm V_CMP_LG_F32 : VOPC_F32 <"v_cmp_lg_f32", COND_ONE>;
335defm V_CMP_GE_F32 : VOPC_F32 <"v_cmp_ge_f32", COND_OGE>;
336defm V_CMP_O_F32 : VOPC_F32 <"v_cmp_o_f32", COND_O>;
337defm V_CMP_U_F32 : VOPC_F32 <"v_cmp_u_f32", COND_UO>;
338defm V_CMP_NGE_F32 : VOPC_F32 <"v_cmp_nge_f32",  COND_ULT, "v_cmp_nle_f32">;
339defm V_CMP_NLG_F32 : VOPC_F32 <"v_cmp_nlg_f32", COND_UEQ>;
340defm V_CMP_NGT_F32 : VOPC_F32 <"v_cmp_ngt_f32", COND_ULE, "v_cmp_nlt_f32">;
341defm V_CMP_NLE_F32 : VOPC_F32 <"v_cmp_nle_f32", COND_UGT>;
342defm V_CMP_NEQ_F32 : VOPC_F32 <"v_cmp_neq_f32", COND_UNE>;
343defm V_CMP_NLT_F32 : VOPC_F32 <"v_cmp_nlt_f32", COND_UGE>;
344defm V_CMP_TRU_F32 : VOPC_F32 <"v_cmp_tru_f32">;
345
346defm V_CMPX_F_F32 : VOPCX_F32 <"v_cmpx_f_f32">;
347defm V_CMPX_LT_F32 : VOPCX_F32 <"v_cmpx_lt_f32", "v_cmpx_gt_f32">;
348defm V_CMPX_EQ_F32 : VOPCX_F32 <"v_cmpx_eq_f32">;
349defm V_CMPX_LE_F32 : VOPCX_F32 <"v_cmpx_le_f32", "v_cmpx_ge_f32">;
350defm V_CMPX_GT_F32 : VOPCX_F32 <"v_cmpx_gt_f32">;
351defm V_CMPX_LG_F32 : VOPCX_F32 <"v_cmpx_lg_f32">;
352defm V_CMPX_GE_F32 : VOPCX_F32 <"v_cmpx_ge_f32">;
353defm V_CMPX_O_F32 : VOPCX_F32 <"v_cmpx_o_f32">;
354defm V_CMPX_U_F32 : VOPCX_F32 <"v_cmpx_u_f32">;
355defm V_CMPX_NGE_F32 : VOPCX_F32 <"v_cmpx_nge_f32", "v_cmpx_nle_f32">;
356defm V_CMPX_NLG_F32 : VOPCX_F32 <"v_cmpx_nlg_f32">;
357defm V_CMPX_NGT_F32 : VOPCX_F32 <"v_cmpx_ngt_f32", "v_cmpx_nlt_f32">;
358defm V_CMPX_NLE_F32 : VOPCX_F32 <"v_cmpx_nle_f32">;
359defm V_CMPX_NEQ_F32 : VOPCX_F32 <"v_cmpx_neq_f32">;
360defm V_CMPX_NLT_F32 : VOPCX_F32 <"v_cmpx_nlt_f32">;
361defm V_CMPX_TRU_F32 : VOPCX_F32 <"v_cmpx_tru_f32">;
362
363defm V_CMP_F_F64 : VOPC_F64 <"v_cmp_f_f64">;
364defm V_CMP_LT_F64 : VOPC_F64 <"v_cmp_lt_f64", COND_OLT, "v_cmp_gt_f64">;
365defm V_CMP_EQ_F64 : VOPC_F64 <"v_cmp_eq_f64", COND_OEQ>;
366defm V_CMP_LE_F64 : VOPC_F64 <"v_cmp_le_f64", COND_OLE, "v_cmp_ge_f64">;
367defm V_CMP_GT_F64 : VOPC_F64 <"v_cmp_gt_f64", COND_OGT>;
368defm V_CMP_LG_F64 : VOPC_F64 <"v_cmp_lg_f64", COND_ONE>;
369defm V_CMP_GE_F64 : VOPC_F64 <"v_cmp_ge_f64", COND_OGE>;
370defm V_CMP_O_F64 : VOPC_F64 <"v_cmp_o_f64", COND_O>;
371defm V_CMP_U_F64 : VOPC_F64 <"v_cmp_u_f64", COND_UO>;
372defm V_CMP_NGE_F64 : VOPC_F64 <"v_cmp_nge_f64", COND_ULT, "v_cmp_nle_f64">;
373defm V_CMP_NLG_F64 : VOPC_F64 <"v_cmp_nlg_f64", COND_UEQ>;
374defm V_CMP_NGT_F64 : VOPC_F64 <"v_cmp_ngt_f64", COND_ULE, "v_cmp_nlt_f64">;
375defm V_CMP_NLE_F64 : VOPC_F64 <"v_cmp_nle_f64", COND_UGT>;
376defm V_CMP_NEQ_F64 : VOPC_F64 <"v_cmp_neq_f64", COND_UNE>;
377defm V_CMP_NLT_F64 : VOPC_F64 <"v_cmp_nlt_f64", COND_UGE>;
378defm V_CMP_TRU_F64 : VOPC_F64 <"v_cmp_tru_f64">;
379
380defm V_CMPX_F_F64 : VOPCX_F64 <"v_cmpx_f_f64">;
381defm V_CMPX_LT_F64 : VOPCX_F64 <"v_cmpx_lt_f64", "v_cmpx_gt_f64">;
382defm V_CMPX_EQ_F64 : VOPCX_F64 <"v_cmpx_eq_f64">;
383defm V_CMPX_LE_F64 : VOPCX_F64 <"v_cmpx_le_f64", "v_cmpx_ge_f64">;
384defm V_CMPX_GT_F64 : VOPCX_F64 <"v_cmpx_gt_f64">;
385defm V_CMPX_LG_F64 : VOPCX_F64 <"v_cmpx_lg_f64">;
386defm V_CMPX_GE_F64 : VOPCX_F64 <"v_cmpx_ge_f64">;
387defm V_CMPX_O_F64 : VOPCX_F64 <"v_cmpx_o_f64">;
388defm V_CMPX_U_F64 : VOPCX_F64 <"v_cmpx_u_f64">;
389defm V_CMPX_NGE_F64 : VOPCX_F64 <"v_cmpx_nge_f64", "v_cmpx_nle_f64">;
390defm V_CMPX_NLG_F64 : VOPCX_F64 <"v_cmpx_nlg_f64">;
391defm V_CMPX_NGT_F64 : VOPCX_F64 <"v_cmpx_ngt_f64", "v_cmpx_nlt_f64">;
392defm V_CMPX_NLE_F64 : VOPCX_F64 <"v_cmpx_nle_f64">;
393defm V_CMPX_NEQ_F64 : VOPCX_F64 <"v_cmpx_neq_f64">;
394defm V_CMPX_NLT_F64 : VOPCX_F64 <"v_cmpx_nlt_f64">;
395defm V_CMPX_TRU_F64 : VOPCX_F64 <"v_cmpx_tru_f64">;
396
397let SubtargetPredicate = isGFX6GFX7 in {
398
399defm V_CMPS_F_F32 : VOPC_F32 <"v_cmps_f_f32">;
400defm V_CMPS_LT_F32 : VOPC_F32 <"v_cmps_lt_f32", COND_NULL, "v_cmps_gt_f32">;
401defm V_CMPS_EQ_F32 : VOPC_F32 <"v_cmps_eq_f32">;
402defm V_CMPS_LE_F32 : VOPC_F32 <"v_cmps_le_f32", COND_NULL, "v_cmps_ge_f32">;
403defm V_CMPS_GT_F32 : VOPC_F32 <"v_cmps_gt_f32">;
404defm V_CMPS_LG_F32 : VOPC_F32 <"v_cmps_lg_f32">;
405defm V_CMPS_GE_F32 : VOPC_F32 <"v_cmps_ge_f32">;
406defm V_CMPS_O_F32 : VOPC_F32 <"v_cmps_o_f32">;
407defm V_CMPS_U_F32 : VOPC_F32 <"v_cmps_u_f32">;
408defm V_CMPS_NGE_F32 : VOPC_F32 <"v_cmps_nge_f32", COND_NULL, "v_cmps_nle_f32">;
409defm V_CMPS_NLG_F32 : VOPC_F32 <"v_cmps_nlg_f32">;
410defm V_CMPS_NGT_F32 : VOPC_F32 <"v_cmps_ngt_f32", COND_NULL, "v_cmps_nlt_f32">;
411defm V_CMPS_NLE_F32 : VOPC_F32 <"v_cmps_nle_f32">;
412defm V_CMPS_NEQ_F32 : VOPC_F32 <"v_cmps_neq_f32">;
413defm V_CMPS_NLT_F32 : VOPC_F32 <"v_cmps_nlt_f32">;
414defm V_CMPS_TRU_F32 : VOPC_F32 <"v_cmps_tru_f32">;
415
416defm V_CMPSX_F_F32 : VOPCX_F32 <"v_cmpsx_f_f32">;
417defm V_CMPSX_LT_F32 : VOPCX_F32 <"v_cmpsx_lt_f32", "v_cmpsx_gt_f32">;
418defm V_CMPSX_EQ_F32 : VOPCX_F32 <"v_cmpsx_eq_f32">;
419defm V_CMPSX_LE_F32 : VOPCX_F32 <"v_cmpsx_le_f32", "v_cmpsx_ge_f32">;
420defm V_CMPSX_GT_F32 : VOPCX_F32 <"v_cmpsx_gt_f32">;
421defm V_CMPSX_LG_F32 : VOPCX_F32 <"v_cmpsx_lg_f32">;
422defm V_CMPSX_GE_F32 : VOPCX_F32 <"v_cmpsx_ge_f32">;
423defm V_CMPSX_O_F32 : VOPCX_F32 <"v_cmpsx_o_f32">;
424defm V_CMPSX_U_F32 : VOPCX_F32 <"v_cmpsx_u_f32">;
425defm V_CMPSX_NGE_F32 : VOPCX_F32 <"v_cmpsx_nge_f32", "v_cmpsx_nle_f32">;
426defm V_CMPSX_NLG_F32 : VOPCX_F32 <"v_cmpsx_nlg_f32">;
427defm V_CMPSX_NGT_F32 : VOPCX_F32 <"v_cmpsx_ngt_f32", "v_cmpsx_nlt_f32">;
428defm V_CMPSX_NLE_F32 : VOPCX_F32 <"v_cmpsx_nle_f32">;
429defm V_CMPSX_NEQ_F32 : VOPCX_F32 <"v_cmpsx_neq_f32">;
430defm V_CMPSX_NLT_F32 : VOPCX_F32 <"v_cmpsx_nlt_f32">;
431defm V_CMPSX_TRU_F32 : VOPCX_F32 <"v_cmpsx_tru_f32">;
432
433defm V_CMPS_F_F64 : VOPC_F64 <"v_cmps_f_f64">;
434defm V_CMPS_LT_F64 : VOPC_F64 <"v_cmps_lt_f64", COND_NULL, "v_cmps_gt_f64">;
435defm V_CMPS_EQ_F64 : VOPC_F64 <"v_cmps_eq_f64">;
436defm V_CMPS_LE_F64 : VOPC_F64 <"v_cmps_le_f64", COND_NULL, "v_cmps_ge_f64">;
437defm V_CMPS_GT_F64 : VOPC_F64 <"v_cmps_gt_f64">;
438defm V_CMPS_LG_F64 : VOPC_F64 <"v_cmps_lg_f64">;
439defm V_CMPS_GE_F64 : VOPC_F64 <"v_cmps_ge_f64">;
440defm V_CMPS_O_F64 : VOPC_F64 <"v_cmps_o_f64">;
441defm V_CMPS_U_F64 : VOPC_F64 <"v_cmps_u_f64">;
442defm V_CMPS_NGE_F64 : VOPC_F64 <"v_cmps_nge_f64", COND_NULL, "v_cmps_nle_f64">;
443defm V_CMPS_NLG_F64 : VOPC_F64 <"v_cmps_nlg_f64">;
444defm V_CMPS_NGT_F64 : VOPC_F64 <"v_cmps_ngt_f64", COND_NULL, "v_cmps_nlt_f64">;
445defm V_CMPS_NLE_F64 : VOPC_F64 <"v_cmps_nle_f64">;
446defm V_CMPS_NEQ_F64 : VOPC_F64 <"v_cmps_neq_f64">;
447defm V_CMPS_NLT_F64 : VOPC_F64 <"v_cmps_nlt_f64">;
448defm V_CMPS_TRU_F64 : VOPC_F64 <"v_cmps_tru_f64">;
449
450defm V_CMPSX_F_F64 : VOPCX_F64 <"v_cmpsx_f_f64">;
451defm V_CMPSX_LT_F64 : VOPCX_F64 <"v_cmpsx_lt_f64", "v_cmpsx_gt_f64">;
452defm V_CMPSX_EQ_F64 : VOPCX_F64 <"v_cmpsx_eq_f64">;
453defm V_CMPSX_LE_F64 : VOPCX_F64 <"v_cmpsx_le_f64", "v_cmpsx_ge_f64">;
454defm V_CMPSX_GT_F64 : VOPCX_F64 <"v_cmpsx_gt_f64">;
455defm V_CMPSX_LG_F64 : VOPCX_F64 <"v_cmpsx_lg_f64">;
456defm V_CMPSX_GE_F64 : VOPCX_F64 <"v_cmpsx_ge_f64">;
457defm V_CMPSX_O_F64 : VOPCX_F64 <"v_cmpsx_o_f64">;
458defm V_CMPSX_U_F64 : VOPCX_F64 <"v_cmpsx_u_f64">;
459defm V_CMPSX_NGE_F64 : VOPCX_F64 <"v_cmpsx_nge_f64", "v_cmpsx_nle_f64">;
460defm V_CMPSX_NLG_F64 : VOPCX_F64 <"v_cmpsx_nlg_f64">;
461defm V_CMPSX_NGT_F64 : VOPCX_F64 <"v_cmpsx_ngt_f64", "v_cmpsx_nlt_f64">;
462defm V_CMPSX_NLE_F64 : VOPCX_F64 <"v_cmpsx_nle_f64">;
463defm V_CMPSX_NEQ_F64 : VOPCX_F64 <"v_cmpsx_neq_f64">;
464defm V_CMPSX_NLT_F64 : VOPCX_F64 <"v_cmpsx_nlt_f64">;
465defm V_CMPSX_TRU_F64 : VOPCX_F64 <"v_cmpsx_tru_f64">;
466
467} // End SubtargetPredicate = isGFX6GFX7
468
469let SubtargetPredicate = Has16BitInsts in {
470
471defm V_CMP_F_F16    : VOPC_F16 <"v_cmp_f_f16">;
472defm V_CMP_LT_F16   : VOPC_F16 <"v_cmp_lt_f16", COND_OLT, "v_cmp_gt_f16">;
473defm V_CMP_EQ_F16   : VOPC_F16 <"v_cmp_eq_f16", COND_OEQ>;
474defm V_CMP_LE_F16   : VOPC_F16 <"v_cmp_le_f16", COND_OLE, "v_cmp_ge_f16">;
475defm V_CMP_GT_F16   : VOPC_F16 <"v_cmp_gt_f16", COND_OGT>;
476defm V_CMP_LG_F16   : VOPC_F16 <"v_cmp_lg_f16", COND_ONE>;
477defm V_CMP_GE_F16   : VOPC_F16 <"v_cmp_ge_f16", COND_OGE>;
478defm V_CMP_O_F16    : VOPC_F16 <"v_cmp_o_f16", COND_O>;
479defm V_CMP_U_F16    : VOPC_F16 <"v_cmp_u_f16", COND_UO>;
480defm V_CMP_NGE_F16  : VOPC_F16 <"v_cmp_nge_f16", COND_ULT, "v_cmp_nle_f16">;
481defm V_CMP_NLG_F16  : VOPC_F16 <"v_cmp_nlg_f16", COND_UEQ>;
482defm V_CMP_NGT_F16  : VOPC_F16 <"v_cmp_ngt_f16", COND_ULE, "v_cmp_nlt_f16">;
483defm V_CMP_NLE_F16  : VOPC_F16 <"v_cmp_nle_f16", COND_UGT>;
484defm V_CMP_NEQ_F16  : VOPC_F16 <"v_cmp_neq_f16", COND_UNE>;
485defm V_CMP_NLT_F16  : VOPC_F16 <"v_cmp_nlt_f16", COND_UGE>;
486defm V_CMP_TRU_F16  : VOPC_F16 <"v_cmp_tru_f16">;
487
488defm V_CMPX_F_F16   : VOPCX_F16 <"v_cmpx_f_f16">;
489defm V_CMPX_LT_F16  : VOPCX_F16 <"v_cmpx_lt_f16", "v_cmpx_gt_f16">;
490defm V_CMPX_EQ_F16  : VOPCX_F16 <"v_cmpx_eq_f16">;
491defm V_CMPX_LE_F16  : VOPCX_F16 <"v_cmpx_le_f16", "v_cmpx_ge_f16">;
492defm V_CMPX_GT_F16  : VOPCX_F16 <"v_cmpx_gt_f16">;
493defm V_CMPX_LG_F16  : VOPCX_F16 <"v_cmpx_lg_f16">;
494defm V_CMPX_GE_F16  : VOPCX_F16 <"v_cmpx_ge_f16">;
495defm V_CMPX_O_F16   : VOPCX_F16 <"v_cmpx_o_f16">;
496defm V_CMPX_U_F16   : VOPCX_F16 <"v_cmpx_u_f16">;
497defm V_CMPX_NGE_F16 : VOPCX_F16 <"v_cmpx_nge_f16", "v_cmpx_nle_f16">;
498defm V_CMPX_NLG_F16 : VOPCX_F16 <"v_cmpx_nlg_f16">;
499defm V_CMPX_NGT_F16 : VOPCX_F16 <"v_cmpx_ngt_f16", "v_cmpx_nlt_f16">;
500defm V_CMPX_NLE_F16 : VOPCX_F16 <"v_cmpx_nle_f16">;
501defm V_CMPX_NEQ_F16 : VOPCX_F16 <"v_cmpx_neq_f16">;
502defm V_CMPX_NLT_F16 : VOPCX_F16 <"v_cmpx_nlt_f16">;
503defm V_CMPX_TRU_F16 : VOPCX_F16 <"v_cmpx_tru_f16">;
504
505defm V_CMP_F_I16 : VOPC_I16 <"v_cmp_f_i16">;
506defm V_CMP_LT_I16 : VOPC_I16 <"v_cmp_lt_i16", COND_SLT, "v_cmp_gt_i16">;
507defm V_CMP_EQ_I16 : VOPC_I16 <"v_cmp_eq_i16">;
508defm V_CMP_LE_I16 : VOPC_I16 <"v_cmp_le_i16", COND_SLE, "v_cmp_ge_i16">;
509defm V_CMP_GT_I16 : VOPC_I16 <"v_cmp_gt_i16", COND_SGT>;
510defm V_CMP_NE_I16 : VOPC_I16 <"v_cmp_ne_i16">;
511defm V_CMP_GE_I16 : VOPC_I16 <"v_cmp_ge_i16", COND_SGE>;
512defm V_CMP_T_I16 : VOPC_I16 <"v_cmp_t_i16">;
513
514defm V_CMP_F_U16 : VOPC_I16 <"v_cmp_f_u16">;
515defm V_CMP_LT_U16 : VOPC_I16 <"v_cmp_lt_u16", COND_ULT, "v_cmp_gt_u16">;
516defm V_CMP_EQ_U16 : VOPC_I16 <"v_cmp_eq_u16", COND_EQ>;
517defm V_CMP_LE_U16 : VOPC_I16 <"v_cmp_le_u16", COND_ULE, "v_cmp_ge_u16">;
518defm V_CMP_GT_U16 : VOPC_I16 <"v_cmp_gt_u16", COND_UGT>;
519defm V_CMP_NE_U16 : VOPC_I16 <"v_cmp_ne_u16", COND_NE>;
520defm V_CMP_GE_U16 : VOPC_I16 <"v_cmp_ge_u16", COND_UGE>;
521defm V_CMP_T_U16 : VOPC_I16 <"v_cmp_t_u16">;
522
523defm V_CMPX_F_I16 : VOPCX_I16 <"v_cmpx_f_i16">;
524defm V_CMPX_LT_I16 : VOPCX_I16 <"v_cmpx_lt_i16", "v_cmpx_gt_i16">;
525defm V_CMPX_EQ_I16 : VOPCX_I16 <"v_cmpx_eq_i16">;
526defm V_CMPX_LE_I16 : VOPCX_I16 <"v_cmpx_le_i16", "v_cmpx_ge_i16">;
527defm V_CMPX_GT_I16 : VOPCX_I16 <"v_cmpx_gt_i16">;
528defm V_CMPX_NE_I16 : VOPCX_I16 <"v_cmpx_ne_i16">;
529defm V_CMPX_GE_I16 : VOPCX_I16 <"v_cmpx_ge_i16">;
530defm V_CMPX_T_I16 : VOPCX_I16 <"v_cmpx_t_i16">;
531defm V_CMPX_F_U16 : VOPCX_I16 <"v_cmpx_f_u16">;
532
533defm V_CMPX_LT_U16 : VOPCX_I16 <"v_cmpx_lt_u16", "v_cmpx_gt_u16">;
534defm V_CMPX_EQ_U16 : VOPCX_I16 <"v_cmpx_eq_u16">;
535defm V_CMPX_LE_U16 : VOPCX_I16 <"v_cmpx_le_u16", "v_cmpx_ge_u16">;
536defm V_CMPX_GT_U16 : VOPCX_I16 <"v_cmpx_gt_u16">;
537defm V_CMPX_NE_U16 : VOPCX_I16 <"v_cmpx_ne_u16">;
538defm V_CMPX_GE_U16 : VOPCX_I16 <"v_cmpx_ge_u16">;
539defm V_CMPX_T_U16 : VOPCX_I16 <"v_cmpx_t_u16">;
540
541} // End SubtargetPredicate = Has16BitInsts
542
543defm V_CMP_F_I32 : VOPC_I32 <"v_cmp_f_i32">;
544defm V_CMP_LT_I32 : VOPC_I32 <"v_cmp_lt_i32", COND_SLT, "v_cmp_gt_i32">;
545defm V_CMP_EQ_I32 : VOPC_I32 <"v_cmp_eq_i32">;
546defm V_CMP_LE_I32 : VOPC_I32 <"v_cmp_le_i32", COND_SLE, "v_cmp_ge_i32">;
547defm V_CMP_GT_I32 : VOPC_I32 <"v_cmp_gt_i32", COND_SGT>;
548defm V_CMP_NE_I32 : VOPC_I32 <"v_cmp_ne_i32">;
549defm V_CMP_GE_I32 : VOPC_I32 <"v_cmp_ge_i32", COND_SGE>;
550defm V_CMP_T_I32 : VOPC_I32 <"v_cmp_t_i32">;
551
552defm V_CMPX_F_I32 : VOPCX_I32 <"v_cmpx_f_i32">;
553defm V_CMPX_LT_I32 : VOPCX_I32 <"v_cmpx_lt_i32", "v_cmpx_gt_i32">;
554defm V_CMPX_EQ_I32 : VOPCX_I32 <"v_cmpx_eq_i32">;
555defm V_CMPX_LE_I32 : VOPCX_I32 <"v_cmpx_le_i32", "v_cmpx_ge_i32">;
556defm V_CMPX_GT_I32 : VOPCX_I32 <"v_cmpx_gt_i32">;
557defm V_CMPX_NE_I32 : VOPCX_I32 <"v_cmpx_ne_i32">;
558defm V_CMPX_GE_I32 : VOPCX_I32 <"v_cmpx_ge_i32">;
559defm V_CMPX_T_I32 : VOPCX_I32 <"v_cmpx_t_i32">;
560
561defm V_CMP_F_I64 : VOPC_I64 <"v_cmp_f_i64">;
562defm V_CMP_LT_I64 : VOPC_I64 <"v_cmp_lt_i64", COND_SLT, "v_cmp_gt_i64">;
563defm V_CMP_EQ_I64 : VOPC_I64 <"v_cmp_eq_i64">;
564defm V_CMP_LE_I64 : VOPC_I64 <"v_cmp_le_i64", COND_SLE, "v_cmp_ge_i64">;
565defm V_CMP_GT_I64 : VOPC_I64 <"v_cmp_gt_i64", COND_SGT>;
566defm V_CMP_NE_I64 : VOPC_I64 <"v_cmp_ne_i64">;
567defm V_CMP_GE_I64 : VOPC_I64 <"v_cmp_ge_i64", COND_SGE>;
568defm V_CMP_T_I64 : VOPC_I64 <"v_cmp_t_i64">;
569
570defm V_CMPX_F_I64 : VOPCX_I64 <"v_cmpx_f_i64">;
571defm V_CMPX_LT_I64 : VOPCX_I64 <"v_cmpx_lt_i64", "v_cmpx_gt_i64">;
572defm V_CMPX_EQ_I64 : VOPCX_I64 <"v_cmpx_eq_i64">;
573defm V_CMPX_LE_I64 : VOPCX_I64 <"v_cmpx_le_i64", "v_cmpx_ge_i64">;
574defm V_CMPX_GT_I64 : VOPCX_I64 <"v_cmpx_gt_i64">;
575defm V_CMPX_NE_I64 : VOPCX_I64 <"v_cmpx_ne_i64">;
576defm V_CMPX_GE_I64 : VOPCX_I64 <"v_cmpx_ge_i64">;
577defm V_CMPX_T_I64 : VOPCX_I64 <"v_cmpx_t_i64">;
578
579defm V_CMP_F_U32 : VOPC_I32 <"v_cmp_f_u32">;
580defm V_CMP_LT_U32 : VOPC_I32 <"v_cmp_lt_u32", COND_ULT, "v_cmp_gt_u32">;
581defm V_CMP_EQ_U32 : VOPC_I32 <"v_cmp_eq_u32", COND_EQ>;
582defm V_CMP_LE_U32 : VOPC_I32 <"v_cmp_le_u32", COND_ULE, "v_cmp_ge_u32">;
583defm V_CMP_GT_U32 : VOPC_I32 <"v_cmp_gt_u32", COND_UGT>;
584defm V_CMP_NE_U32 : VOPC_I32 <"v_cmp_ne_u32", COND_NE>;
585defm V_CMP_GE_U32 : VOPC_I32 <"v_cmp_ge_u32", COND_UGE>;
586defm V_CMP_T_U32 : VOPC_I32 <"v_cmp_t_u32">;
587
588defm V_CMPX_F_U32 : VOPCX_I32 <"v_cmpx_f_u32">;
589defm V_CMPX_LT_U32 : VOPCX_I32 <"v_cmpx_lt_u32", "v_cmpx_gt_u32">;
590defm V_CMPX_EQ_U32 : VOPCX_I32 <"v_cmpx_eq_u32">;
591defm V_CMPX_LE_U32 : VOPCX_I32 <"v_cmpx_le_u32", "v_cmpx_le_u32">;
592defm V_CMPX_GT_U32 : VOPCX_I32 <"v_cmpx_gt_u32">;
593defm V_CMPX_NE_U32 : VOPCX_I32 <"v_cmpx_ne_u32">;
594defm V_CMPX_GE_U32 : VOPCX_I32 <"v_cmpx_ge_u32">;
595defm V_CMPX_T_U32 : VOPCX_I32 <"v_cmpx_t_u32">;
596
597defm V_CMP_F_U64 : VOPC_I64 <"v_cmp_f_u64">;
598defm V_CMP_LT_U64 : VOPC_I64 <"v_cmp_lt_u64", COND_ULT, "v_cmp_gt_u64">;
599defm V_CMP_EQ_U64 : VOPC_I64 <"v_cmp_eq_u64", COND_EQ>;
600defm V_CMP_LE_U64 : VOPC_I64 <"v_cmp_le_u64", COND_ULE, "v_cmp_ge_u64">;
601defm V_CMP_GT_U64 : VOPC_I64 <"v_cmp_gt_u64", COND_UGT>;
602defm V_CMP_NE_U64 : VOPC_I64 <"v_cmp_ne_u64", COND_NE>;
603defm V_CMP_GE_U64 : VOPC_I64 <"v_cmp_ge_u64", COND_UGE>;
604defm V_CMP_T_U64 : VOPC_I64 <"v_cmp_t_u64">;
605
606defm V_CMPX_F_U64 : VOPCX_I64 <"v_cmpx_f_u64">;
607defm V_CMPX_LT_U64 : VOPCX_I64 <"v_cmpx_lt_u64", "v_cmpx_gt_u64">;
608defm V_CMPX_EQ_U64 : VOPCX_I64 <"v_cmpx_eq_u64">;
609defm V_CMPX_LE_U64 : VOPCX_I64 <"v_cmpx_le_u64", "v_cmpx_ge_u64">;
610defm V_CMPX_GT_U64 : VOPCX_I64 <"v_cmpx_gt_u64">;
611defm V_CMPX_NE_U64 : VOPCX_I64 <"v_cmpx_ne_u64">;
612defm V_CMPX_GE_U64 : VOPCX_I64 <"v_cmpx_ge_u64">;
613defm V_CMPX_T_U64 : VOPCX_I64 <"v_cmpx_t_u64">;
614
615//===----------------------------------------------------------------------===//
616// Class instructions
617//===----------------------------------------------------------------------===//
618
619class VOPC_Class_Profile<list<SchedReadWrite> sched, ValueType vt> :
620  VOPC_Profile<sched, vt, i32> {
621  let Ins64 = (ins Src0Mod:$src0_modifiers, Src0RC64:$src0, Src1RC64:$src1);
622  let Asm64 = "$sdst, $src0_modifiers, $src1";
623
624  let InsSDWA = (ins Src0ModSDWA:$src0_modifiers, Src0SDWA:$src0,
625                     Src1ModSDWA:$src1_modifiers, Src1SDWA:$src1,
626                     clampmod:$clamp, src0_sel:$src0_sel, src1_sel:$src1_sel);
627
628  let AsmSDWA = " vcc, $src0_modifiers, $src1_modifiers$clamp $src0_sel $src1_sel";
629  let HasSrc1Mods = 0;
630  let HasClamp = 0;
631  let HasOMod = 0;
632}
633
634class VOPC_Class_NoSdst_Profile<list<SchedReadWrite> sched, ValueType vt> :
635  VOPC_Class_Profile<sched, vt> {
636  let Outs64 = (outs );
637  let OutsSDWA = (outs );
638  let InsSDWA = (ins Src0ModSDWA:$src0_modifiers, Src0SDWA:$src0,
639                     Src1ModSDWA:$src1_modifiers, Src1SDWA:$src1,
640                     src0_sel:$src0_sel, src1_sel:$src1_sel);
641  let Asm64 = "$src0_modifiers, $src1";
642  let AsmSDWA9 = "$src0_modifiers, $src1_modifiers $src0_sel $src1_sel";
643  let EmitDst = 0;
644}
645
646class getVOPCClassPat64 <VOPProfile P> {
647  list<dag> ret =
648    [(set i1:$sdst,
649      (AMDGPUfp_class
650        (P.Src0VT (VOP3Mods0Clamp0OMod P.Src0VT:$src0, i32:$src0_modifiers)),
651        P.Src1VT:$src1))];
652}
653
654// Special case for class instructions which only have modifiers on
655// the 1st source operand.
656multiclass VOPC_Class_Pseudos <string opName, VOPC_Profile p, bit DefExec,
657                               bit DefVcc = 1> {
658  def _e32 : VOPC_Pseudo <opName, p>,
659             VCMPXNoSDstTable<1, opName#"_e32"> {
660    let Defs = !if(DefExec, !if(DefVcc, [VCC, EXEC], [EXEC]),
661                            !if(DefVcc, [VCC], []));
662    let SchedRW = p.Schedule;
663    let isConvergent = DefExec;
664  }
665
666  def _e64 : VOP3_Pseudo<opName, p, getVOPCClassPat64<p>.ret>,
667             VCMPXNoSDstTable<1, opName#"_e64"> {
668    let Defs = !if(DefExec, [EXEC], []);
669    let SchedRW = p.Schedule;
670  }
671
672  def _sdwa : VOPC_SDWA_Pseudo <opName, p> {
673    let Defs = !if(DefExec, !if(DefVcc, [VCC, EXEC], [EXEC]),
674                            !if(DefVcc, [VCC], []));
675    let SchedRW = p.Schedule;
676    let isConvergent = DefExec;
677  }
678}
679
680let SubtargetPredicate = HasSdstCMPX in {
681multiclass VOPCX_Class_Pseudos <string opName,
682                                VOPC_Profile P,
683                                VOPC_Profile P_NoSDst> :
684           VOPC_Class_Pseudos <opName, P, 1, 1> {
685
686  def _nosdst_e32 : VOPC_Pseudo <opName#"_nosdst", P_NoSDst, [], 0>,
687                    VCMPXNoSDstTable<0, opName#"_e32"> {
688    let Defs = [EXEC];
689    let SchedRW = P_NoSDst.Schedule;
690    let isConvergent = 1;
691    let SubtargetPredicate = HasNoSdstCMPX;
692  }
693
694  def _nosdst_e64 : VOP3_Pseudo<opName#"_nosdst", P_NoSDst>,
695                    VCMPXNoSDstTable<0, opName#"_e64"> {
696    let Defs = [EXEC];
697    let SchedRW = P_NoSDst.Schedule;
698    let SubtargetPredicate = HasNoSdstCMPX;
699  }
700
701  def _nosdst_sdwa : VOPC_SDWA_Pseudo <opName#"_nosdst", P_NoSDst> {
702    let Defs = [EXEC];
703    let SchedRW = P_NoSDst.Schedule;
704    let isConvergent = 1;
705    let SubtargetPredicate = HasNoSdstCMPX;
706  }
707}
708} // End SubtargetPredicate = HasSdstCMPX
709
710def VOPC_I1_F16_I32 : VOPC_Class_Profile<[Write32Bit], f16>;
711def VOPC_I1_F32_I32 : VOPC_Class_Profile<[Write32Bit], f32>;
712def VOPC_I1_F64_I32 : VOPC_Class_Profile<[WriteDoubleAdd], f64>;
713
714def VOPC_F16_I32 : VOPC_Class_NoSdst_Profile<[Write32Bit], f16>;
715def VOPC_F32_I32 : VOPC_Class_NoSdst_Profile<[Write32Bit], f32>;
716def VOPC_F64_I32 : VOPC_Class_NoSdst_Profile<[Write64Bit], f64>;
717
718multiclass VOPC_CLASS_F16 <string opName> :
719  VOPC_Class_Pseudos <opName, VOPC_I1_F16_I32, 0>;
720
721multiclass VOPCX_CLASS_F16 <string opName> :
722  VOPCX_Class_Pseudos <opName, VOPC_I1_F16_I32, VOPC_F16_I32>;
723
724multiclass VOPC_CLASS_F32 <string opName> :
725  VOPC_Class_Pseudos <opName, VOPC_I1_F32_I32, 0>;
726
727multiclass VOPCX_CLASS_F32 <string opName> :
728  VOPCX_Class_Pseudos <opName, VOPC_I1_F32_I32, VOPC_F32_I32>;
729
730multiclass VOPC_CLASS_F64 <string opName> :
731  VOPC_Class_Pseudos <opName, VOPC_I1_F64_I32, 0>;
732
733multiclass VOPCX_CLASS_F64 <string opName> :
734  VOPCX_Class_Pseudos <opName, VOPC_I1_F64_I32, VOPC_F64_I32>;
735
736defm V_CMP_CLASS_F32 : VOPC_CLASS_F32 <"v_cmp_class_f32">;
737defm V_CMPX_CLASS_F32 : VOPCX_CLASS_F32 <"v_cmpx_class_f32">;
738defm V_CMP_CLASS_F64 : VOPC_CLASS_F64 <"v_cmp_class_f64">;
739defm V_CMPX_CLASS_F64 : VOPCX_CLASS_F64 <"v_cmpx_class_f64">;
740defm V_CMP_CLASS_F16  : VOPC_CLASS_F16 <"v_cmp_class_f16">;
741defm V_CMPX_CLASS_F16 : VOPCX_CLASS_F16 <"v_cmpx_class_f16">;
742
743//===----------------------------------------------------------------------===//
744// V_ICMPIntrinsic Pattern.
745//===----------------------------------------------------------------------===//
746
747// We need to use COPY_TO_REGCLASS to w/a the problem when ReplaceAllUsesWith()
748// complaints it cannot replace i1 <-> i64/i32 if node was not morphed in place.
749multiclass ICMP_Pattern <PatLeaf cond, Instruction inst, ValueType vt> {
750  let WaveSizePredicate = isWave64 in
751  def : GCNPat <
752    (i64 (AMDGPUsetcc vt:$src0, vt:$src1, cond)),
753    (i64 (COPY_TO_REGCLASS (inst $src0, $src1), SReg_64))
754  >;
755
756  let WaveSizePredicate = isWave32 in
757  def : GCNPat <
758    (i32 (AMDGPUsetcc vt:$src0, vt:$src1, cond)),
759    (i32 (COPY_TO_REGCLASS (inst $src0, $src1), SReg_32))
760  >;
761}
762
763defm : ICMP_Pattern <COND_EQ, V_CMP_EQ_U32_e64, i32>;
764defm : ICMP_Pattern <COND_NE, V_CMP_NE_U32_e64, i32>;
765defm : ICMP_Pattern <COND_UGT, V_CMP_GT_U32_e64, i32>;
766defm : ICMP_Pattern <COND_UGE, V_CMP_GE_U32_e64, i32>;
767defm : ICMP_Pattern <COND_ULT, V_CMP_LT_U32_e64, i32>;
768defm : ICMP_Pattern <COND_ULE, V_CMP_LE_U32_e64, i32>;
769defm : ICMP_Pattern <COND_SGT, V_CMP_GT_I32_e64, i32>;
770defm : ICMP_Pattern <COND_SGE, V_CMP_GE_I32_e64, i32>;
771defm : ICMP_Pattern <COND_SLT, V_CMP_LT_I32_e64, i32>;
772defm : ICMP_Pattern <COND_SLE, V_CMP_LE_I32_e64, i32>;
773
774defm : ICMP_Pattern <COND_EQ, V_CMP_EQ_U64_e64, i64>;
775defm : ICMP_Pattern <COND_NE, V_CMP_NE_U64_e64, i64>;
776defm : ICMP_Pattern <COND_UGT, V_CMP_GT_U64_e64, i64>;
777defm : ICMP_Pattern <COND_UGE, V_CMP_GE_U64_e64, i64>;
778defm : ICMP_Pattern <COND_ULT, V_CMP_LT_U64_e64, i64>;
779defm : ICMP_Pattern <COND_ULE, V_CMP_LE_U64_e64, i64>;
780defm : ICMP_Pattern <COND_SGT, V_CMP_GT_I64_e64, i64>;
781defm : ICMP_Pattern <COND_SGE, V_CMP_GE_I64_e64, i64>;
782defm : ICMP_Pattern <COND_SLT, V_CMP_LT_I64_e64, i64>;
783defm : ICMP_Pattern <COND_SLE, V_CMP_LE_I64_e64, i64>;
784
785defm : ICMP_Pattern <COND_EQ, V_CMP_EQ_U16_e64, i16>;
786defm : ICMP_Pattern <COND_NE, V_CMP_NE_U16_e64, i16>;
787defm : ICMP_Pattern <COND_UGT, V_CMP_GT_U16_e64, i16>;
788defm : ICMP_Pattern <COND_UGE, V_CMP_GE_U16_e64, i16>;
789defm : ICMP_Pattern <COND_ULT, V_CMP_LT_U16_e64, i16>;
790defm : ICMP_Pattern <COND_ULE, V_CMP_LE_U16_e64, i16>;
791defm : ICMP_Pattern <COND_SGT, V_CMP_GT_I16_e64, i16>;
792defm : ICMP_Pattern <COND_SGE, V_CMP_GE_I16_e64, i16>;
793defm : ICMP_Pattern <COND_SLT, V_CMP_LT_I16_e64, i16>;
794defm : ICMP_Pattern <COND_SLE, V_CMP_LE_I16_e64, i16>;
795
796multiclass FCMP_Pattern <PatLeaf cond, Instruction inst, ValueType vt> {
797  let WaveSizePredicate = isWave64 in
798  def : GCNPat <
799    (i64 (AMDGPUsetcc (vt (VOP3Mods vt:$src0, i32:$src0_modifiers)),
800                 (vt (VOP3Mods vt:$src1, i32:$src1_modifiers)), cond)),
801    (i64 (COPY_TO_REGCLASS (inst $src0_modifiers, $src0, $src1_modifiers, $src1,
802                           DSTCLAMP.NONE), SReg_64))
803  >;
804
805  let WaveSizePredicate = isWave32 in
806  def : GCNPat <
807    (i32 (AMDGPUsetcc (vt (VOP3Mods vt:$src0, i32:$src0_modifiers)),
808                 (vt (VOP3Mods vt:$src1, i32:$src1_modifiers)), cond)),
809    (i32 (COPY_TO_REGCLASS (inst $src0_modifiers, $src0, $src1_modifiers, $src1,
810                           DSTCLAMP.NONE), SReg_32))
811  >;
812}
813
814defm : FCMP_Pattern <COND_OEQ, V_CMP_EQ_F32_e64, f32>;
815defm : FCMP_Pattern <COND_ONE, V_CMP_NEQ_F32_e64, f32>;
816defm : FCMP_Pattern <COND_OGT, V_CMP_GT_F32_e64, f32>;
817defm : FCMP_Pattern <COND_OGE, V_CMP_GE_F32_e64, f32>;
818defm : FCMP_Pattern <COND_OLT, V_CMP_LT_F32_e64, f32>;
819defm : FCMP_Pattern <COND_OLE, V_CMP_LE_F32_e64, f32>;
820
821defm : FCMP_Pattern <COND_OEQ, V_CMP_EQ_F64_e64, f64>;
822defm : FCMP_Pattern <COND_ONE, V_CMP_NEQ_F64_e64, f64>;
823defm : FCMP_Pattern <COND_OGT, V_CMP_GT_F64_e64, f64>;
824defm : FCMP_Pattern <COND_OGE, V_CMP_GE_F64_e64, f64>;
825defm : FCMP_Pattern <COND_OLT, V_CMP_LT_F64_e64, f64>;
826defm : FCMP_Pattern <COND_OLE, V_CMP_LE_F64_e64, f64>;
827
828defm : FCMP_Pattern <COND_OEQ, V_CMP_EQ_F16_e64, f16>;
829defm : FCMP_Pattern <COND_ONE, V_CMP_NEQ_F16_e64, f16>;
830defm : FCMP_Pattern <COND_OGT, V_CMP_GT_F16_e64, f16>;
831defm : FCMP_Pattern <COND_OGE, V_CMP_GE_F16_e64, f16>;
832defm : FCMP_Pattern <COND_OLT, V_CMP_LT_F16_e64, f16>;
833defm : FCMP_Pattern <COND_OLE, V_CMP_LE_F16_e64, f16>;
834
835
836defm : FCMP_Pattern <COND_UEQ, V_CMP_NLG_F32_e64, f32>;
837defm : FCMP_Pattern <COND_UNE, V_CMP_NEQ_F32_e64, f32>;
838defm : FCMP_Pattern <COND_UGT, V_CMP_NLE_F32_e64, f32>;
839defm : FCMP_Pattern <COND_UGE, V_CMP_NLT_F32_e64, f32>;
840defm : FCMP_Pattern <COND_ULT, V_CMP_NGE_F32_e64, f32>;
841defm : FCMP_Pattern <COND_ULE, V_CMP_NGT_F32_e64, f32>;
842
843defm : FCMP_Pattern <COND_UEQ, V_CMP_NLG_F64_e64, f64>;
844defm : FCMP_Pattern <COND_UNE, V_CMP_NEQ_F64_e64, f64>;
845defm : FCMP_Pattern <COND_UGT, V_CMP_NLE_F64_e64, f64>;
846defm : FCMP_Pattern <COND_UGE, V_CMP_NLT_F64_e64, f64>;
847defm : FCMP_Pattern <COND_ULT, V_CMP_NGE_F64_e64, f64>;
848defm : FCMP_Pattern <COND_ULE, V_CMP_NGT_F64_e64, f64>;
849
850defm : FCMP_Pattern <COND_UEQ, V_CMP_NLG_F16_e64, f16>;
851defm : FCMP_Pattern <COND_UNE, V_CMP_NEQ_F16_e64, f16>;
852defm : FCMP_Pattern <COND_UGT, V_CMP_NLE_F16_e64, f16>;
853defm : FCMP_Pattern <COND_UGE, V_CMP_NLT_F16_e64, f16>;
854defm : FCMP_Pattern <COND_ULT, V_CMP_NGE_F16_e64, f16>;
855defm : FCMP_Pattern <COND_ULE, V_CMP_NGT_F16_e64, f16>;
856
857//===----------------------------------------------------------------------===//
858// Target-specific instruction encodings.
859//===----------------------------------------------------------------------===//
860
861//===----------------------------------------------------------------------===//
862// GFX10.
863//===----------------------------------------------------------------------===//
864
865let AssemblerPredicate = isGFX10Plus in {
866  multiclass VOPC_Real_gfx10<bits<9> op> {
867    let DecoderNamespace = "GFX10" in {
868      def _e32_gfx10 :
869        VOPC_Real<!cast<VOPC_Pseudo>(NAME#"_e32"), SIEncodingFamily.GFX10>,
870        VOPCe<op{7-0}>;
871      def _e64_gfx10 :
872        VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.GFX10>,
873        VOP3a_gfx10<{0, op}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl> {
874        // Encoding used for VOPC instructions encoded as VOP3 differs from
875        // VOP3e by destination name (sdst) as VOPC doesn't have vector dst.
876        bits<8> sdst;
877        let Inst{7-0} = sdst;
878      }
879    } // End DecoderNamespace = "GFX10"
880
881    def _sdwa_gfx10 :
882      VOP_SDWA10_Real<!cast<VOPC_SDWA_Pseudo>(NAME#"_sdwa")>,
883      VOPC_SDWA9e<op{7-0}, !cast<VOPC_SDWA_Pseudo>(NAME#"_sdwa").Pfl>;
884
885    defm : VOPCInstAliases<NAME, "gfx10">;
886  }
887
888  multiclass VOPCX_Real_gfx10<bits<9> op> {
889    let DecoderNamespace = "GFX10" in {
890      def _e32_gfx10 :
891        VOPC_Real<!cast<VOPC_Pseudo>(NAME#"_nosdst_e32"), SIEncodingFamily.GFX10>,
892        VOPCe<op{7-0}> {
893          let AsmString = !subst("_nosdst", "", !cast<VOPC_Pseudo>(NAME#"_nosdst_e32").PseudoInstr)
894                          # " " # !cast<VOPC_Pseudo>(NAME#"_nosdst_e32").AsmOperands;
895        }
896
897      def _e64_gfx10 :
898        VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_nosdst_e64"), SIEncodingFamily.GFX10>,
899        VOP3a_gfx10<{0, op}, !cast<VOP3_Pseudo>(NAME#"_nosdst_e64").Pfl> {
900          let Inst{7-0} = ?; // sdst
901          let AsmString = !subst("_nosdst", "", !cast<VOP3_Pseudo>(NAME#"_nosdst_e64").Mnemonic)
902                          # "{_e64} " # !cast<VOP3_Pseudo>(NAME#"_nosdst_e64").AsmOperands;
903        }
904    } // End DecoderNamespace = "GFX10"
905
906    def _sdwa_gfx10 :
907      VOP_SDWA10_Real<!cast<VOPC_SDWA_Pseudo>(NAME#"_nosdst_sdwa")>,
908      VOPC_SDWA9e<op{7-0}, !cast<VOPC_SDWA_Pseudo>(NAME#"_nosdst_sdwa").Pfl> {
909        let AsmString = !subst("_nosdst", "", !cast<VOPC_SDWA_Pseudo>(NAME#"_nosdst_sdwa").Mnemonic)
910                        # "{_sdwa} " # !cast<VOPC_SDWA_Pseudo>(NAME#"_nosdst_sdwa").AsmOperands9;
911      }
912
913    defm : VOPCXInstAliases<NAME, "gfx10">;
914  }
915} // End AssemblerPredicate = isGFX10Plus
916
917defm V_CMP_LT_I16     : VOPC_Real_gfx10<0x089>;
918defm V_CMP_EQ_I16     : VOPC_Real_gfx10<0x08a>;
919defm V_CMP_LE_I16     : VOPC_Real_gfx10<0x08b>;
920defm V_CMP_GT_I16     : VOPC_Real_gfx10<0x08c>;
921defm V_CMP_NE_I16     : VOPC_Real_gfx10<0x08d>;
922defm V_CMP_GE_I16     : VOPC_Real_gfx10<0x08e>;
923defm V_CMP_CLASS_F16  : VOPC_Real_gfx10<0x08f>;
924defm V_CMPX_LT_I16    : VOPCX_Real_gfx10<0x099>;
925defm V_CMPX_EQ_I16    : VOPCX_Real_gfx10<0x09a>;
926defm V_CMPX_LE_I16    : VOPCX_Real_gfx10<0x09b>;
927defm V_CMPX_GT_I16    : VOPCX_Real_gfx10<0x09c>;
928defm V_CMPX_NE_I16    : VOPCX_Real_gfx10<0x09d>;
929defm V_CMPX_GE_I16    : VOPCX_Real_gfx10<0x09e>;
930defm V_CMPX_CLASS_F16 : VOPCX_Real_gfx10<0x09f>;
931defm V_CMP_LT_U16     : VOPC_Real_gfx10<0x0a9>;
932defm V_CMP_EQ_U16     : VOPC_Real_gfx10<0x0aa>;
933defm V_CMP_LE_U16     : VOPC_Real_gfx10<0x0ab>;
934defm V_CMP_GT_U16     : VOPC_Real_gfx10<0x0ac>;
935defm V_CMP_NE_U16     : VOPC_Real_gfx10<0x0ad>;
936defm V_CMP_GE_U16     : VOPC_Real_gfx10<0x0ae>;
937defm V_CMPX_LT_U16    : VOPCX_Real_gfx10<0x0b9>;
938defm V_CMPX_EQ_U16    : VOPCX_Real_gfx10<0x0ba>;
939defm V_CMPX_LE_U16    : VOPCX_Real_gfx10<0x0bb>;
940defm V_CMPX_GT_U16    : VOPCX_Real_gfx10<0x0bc>;
941defm V_CMPX_NE_U16    : VOPCX_Real_gfx10<0x0bd>;
942defm V_CMPX_GE_U16    : VOPCX_Real_gfx10<0x0be>;
943defm V_CMP_F_F16      : VOPC_Real_gfx10<0x0c8>;
944defm V_CMP_LT_F16     : VOPC_Real_gfx10<0x0c9>;
945defm V_CMP_EQ_F16     : VOPC_Real_gfx10<0x0ca>;
946defm V_CMP_LE_F16     : VOPC_Real_gfx10<0x0cb>;
947defm V_CMP_GT_F16     : VOPC_Real_gfx10<0x0cc>;
948defm V_CMP_LG_F16     : VOPC_Real_gfx10<0x0cd>;
949defm V_CMP_GE_F16     : VOPC_Real_gfx10<0x0ce>;
950defm V_CMP_O_F16      : VOPC_Real_gfx10<0x0cf>;
951defm V_CMPX_F_F16     : VOPCX_Real_gfx10<0x0d8>;
952defm V_CMPX_LT_F16    : VOPCX_Real_gfx10<0x0d9>;
953defm V_CMPX_EQ_F16    : VOPCX_Real_gfx10<0x0da>;
954defm V_CMPX_LE_F16    : VOPCX_Real_gfx10<0x0db>;
955defm V_CMPX_GT_F16    : VOPCX_Real_gfx10<0x0dc>;
956defm V_CMPX_LG_F16    : VOPCX_Real_gfx10<0x0dd>;
957defm V_CMPX_GE_F16    : VOPCX_Real_gfx10<0x0de>;
958defm V_CMPX_O_F16     : VOPCX_Real_gfx10<0x0df>;
959defm V_CMP_U_F16      : VOPC_Real_gfx10<0x0e8>;
960defm V_CMP_NGE_F16    : VOPC_Real_gfx10<0x0e9>;
961defm V_CMP_NLG_F16    : VOPC_Real_gfx10<0x0ea>;
962defm V_CMP_NGT_F16    : VOPC_Real_gfx10<0x0eb>;
963defm V_CMP_NLE_F16    : VOPC_Real_gfx10<0x0ec>;
964defm V_CMP_NEQ_F16    : VOPC_Real_gfx10<0x0ed>;
965defm V_CMP_NLT_F16    : VOPC_Real_gfx10<0x0ee>;
966defm V_CMP_TRU_F16    : VOPC_Real_gfx10<0x0ef>;
967defm V_CMPX_U_F16     : VOPCX_Real_gfx10<0x0f8>;
968defm V_CMPX_NGE_F16   : VOPCX_Real_gfx10<0x0f9>;
969defm V_CMPX_NLG_F16   : VOPCX_Real_gfx10<0x0fa>;
970defm V_CMPX_NGT_F16   : VOPCX_Real_gfx10<0x0fb>;
971defm V_CMPX_NLE_F16   : VOPCX_Real_gfx10<0x0fc>;
972defm V_CMPX_NEQ_F16   : VOPCX_Real_gfx10<0x0fd>;
973defm V_CMPX_NLT_F16   : VOPCX_Real_gfx10<0x0fe>;
974defm V_CMPX_TRU_F16   : VOPCX_Real_gfx10<0x0ff>;
975
976//===----------------------------------------------------------------------===//
977// GFX6, GFX7, GFX10.
978//===----------------------------------------------------------------------===//
979
980let AssemblerPredicate = isGFX6GFX7 in {
981  multiclass VOPC_Real_gfx6_gfx7<bits<9> op> {
982    let DecoderNamespace = "GFX6GFX7" in {
983      def _e32_gfx6_gfx7 :
984        VOPC_Real<!cast<VOPC_Pseudo>(NAME#"_e32"), SIEncodingFamily.SI>,
985        VOPCe<op{7-0}>;
986      def _e64_gfx6_gfx7 :
987        VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.SI>,
988        VOP3a_gfx6_gfx7<op, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl> {
989        // Encoding used for VOPC instructions encoded as VOP3 differs from
990        // VOP3e by destination name (sdst) as VOPC doesn't have vector dst.
991        bits<8> sdst;
992        let Inst{7-0} = sdst;
993      }
994    } // End DecoderNamespace = "GFX6GFX7"
995
996    defm : VOPCInstAliases<NAME, "gfx6_gfx7">;
997  }
998} // End AssemblerPredicate = isGFX6GFX7
999
1000multiclass VOPC_Real_gfx6_gfx7_gfx10<bits<9> op> :
1001  VOPC_Real_gfx6_gfx7<op>, VOPC_Real_gfx10<op>;
1002
1003multiclass VOPCX_Real_gfx6_gfx7<bits<9> op> :
1004  VOPC_Real_gfx6_gfx7<op>;
1005
1006multiclass VOPCX_Real_gfx6_gfx7_gfx10 <bits<9> op> :
1007  VOPC_Real_gfx6_gfx7<op>, VOPCX_Real_gfx10<op>;
1008
1009defm V_CMP_F_F32      : VOPC_Real_gfx6_gfx7_gfx10<0x000>;
1010defm V_CMP_LT_F32     : VOPC_Real_gfx6_gfx7_gfx10<0x001>;
1011defm V_CMP_EQ_F32     : VOPC_Real_gfx6_gfx7_gfx10<0x002>;
1012defm V_CMP_LE_F32     : VOPC_Real_gfx6_gfx7_gfx10<0x003>;
1013defm V_CMP_GT_F32     : VOPC_Real_gfx6_gfx7_gfx10<0x004>;
1014defm V_CMP_LG_F32     : VOPC_Real_gfx6_gfx7_gfx10<0x005>;
1015defm V_CMP_GE_F32     : VOPC_Real_gfx6_gfx7_gfx10<0x006>;
1016defm V_CMP_O_F32      : VOPC_Real_gfx6_gfx7_gfx10<0x007>;
1017defm V_CMP_U_F32      : VOPC_Real_gfx6_gfx7_gfx10<0x008>;
1018defm V_CMP_NGE_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x009>;
1019defm V_CMP_NLG_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x00a>;
1020defm V_CMP_NGT_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x00b>;
1021defm V_CMP_NLE_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x00c>;
1022defm V_CMP_NEQ_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x00d>;
1023defm V_CMP_NLT_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x00e>;
1024defm V_CMP_TRU_F32    : VOPC_Real_gfx6_gfx7_gfx10<0x00f>;
1025defm V_CMPX_F_F32     : VOPCX_Real_gfx6_gfx7_gfx10<0x010>;
1026defm V_CMPX_LT_F32    : VOPCX_Real_gfx6_gfx7_gfx10<0x011>;
1027defm V_CMPX_EQ_F32    : VOPCX_Real_gfx6_gfx7_gfx10<0x012>;
1028defm V_CMPX_LE_F32    : VOPCX_Real_gfx6_gfx7_gfx10<0x013>;
1029defm V_CMPX_GT_F32    : VOPCX_Real_gfx6_gfx7_gfx10<0x014>;
1030defm V_CMPX_LG_F32    : VOPCX_Real_gfx6_gfx7_gfx10<0x015>;
1031defm V_CMPX_GE_F32    : VOPCX_Real_gfx6_gfx7_gfx10<0x016>;
1032defm V_CMPX_O_F32     : VOPCX_Real_gfx6_gfx7_gfx10<0x017>;
1033defm V_CMPX_U_F32     : VOPCX_Real_gfx6_gfx7_gfx10<0x018>;
1034defm V_CMPX_NGE_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x019>;
1035defm V_CMPX_NLG_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x01a>;
1036defm V_CMPX_NGT_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x01b>;
1037defm V_CMPX_NLE_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x01c>;
1038defm V_CMPX_NEQ_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x01d>;
1039defm V_CMPX_NLT_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x01e>;
1040defm V_CMPX_TRU_F32   : VOPCX_Real_gfx6_gfx7_gfx10<0x01f>;
1041defm V_CMP_F_F64      : VOPC_Real_gfx6_gfx7_gfx10<0x020>;
1042defm V_CMP_LT_F64     : VOPC_Real_gfx6_gfx7_gfx10<0x021>;
1043defm V_CMP_EQ_F64     : VOPC_Real_gfx6_gfx7_gfx10<0x022>;
1044defm V_CMP_LE_F64     : VOPC_Real_gfx6_gfx7_gfx10<0x023>;
1045defm V_CMP_GT_F64     : VOPC_Real_gfx6_gfx7_gfx10<0x024>;
1046defm V_CMP_LG_F64     : VOPC_Real_gfx6_gfx7_gfx10<0x025>;
1047defm V_CMP_GE_F64     : VOPC_Real_gfx6_gfx7_gfx10<0x026>;
1048defm V_CMP_O_F64      : VOPC_Real_gfx6_gfx7_gfx10<0x027>;
1049defm V_CMP_U_F64      : VOPC_Real_gfx6_gfx7_gfx10<0x028>;
1050defm V_CMP_NGE_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x029>;
1051defm V_CMP_NLG_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x02a>;
1052defm V_CMP_NGT_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x02b>;
1053defm V_CMP_NLE_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x02c>;
1054defm V_CMP_NEQ_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x02d>;
1055defm V_CMP_NLT_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x02e>;
1056defm V_CMP_TRU_F64    : VOPC_Real_gfx6_gfx7_gfx10<0x02f>;
1057defm V_CMPX_F_F64     : VOPCX_Real_gfx6_gfx7_gfx10<0x030>;
1058defm V_CMPX_LT_F64    : VOPCX_Real_gfx6_gfx7_gfx10<0x031>;
1059defm V_CMPX_EQ_F64    : VOPCX_Real_gfx6_gfx7_gfx10<0x032>;
1060defm V_CMPX_LE_F64    : VOPCX_Real_gfx6_gfx7_gfx10<0x033>;
1061defm V_CMPX_GT_F64    : VOPCX_Real_gfx6_gfx7_gfx10<0x034>;
1062defm V_CMPX_LG_F64    : VOPCX_Real_gfx6_gfx7_gfx10<0x035>;
1063defm V_CMPX_GE_F64    : VOPCX_Real_gfx6_gfx7_gfx10<0x036>;
1064defm V_CMPX_O_F64     : VOPCX_Real_gfx6_gfx7_gfx10<0x037>;
1065defm V_CMPX_U_F64     : VOPCX_Real_gfx6_gfx7_gfx10<0x038>;
1066defm V_CMPX_NGE_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x039>;
1067defm V_CMPX_NLG_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x03a>;
1068defm V_CMPX_NGT_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x03b>;
1069defm V_CMPX_NLE_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x03c>;
1070defm V_CMPX_NEQ_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x03d>;
1071defm V_CMPX_NLT_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x03e>;
1072defm V_CMPX_TRU_F64   : VOPCX_Real_gfx6_gfx7_gfx10<0x03f>;
1073defm V_CMPS_F_F32     : VOPC_Real_gfx6_gfx7<0x040>;
1074defm V_CMPS_LT_F32    : VOPC_Real_gfx6_gfx7<0x041>;
1075defm V_CMPS_EQ_F32    : VOPC_Real_gfx6_gfx7<0x042>;
1076defm V_CMPS_LE_F32    : VOPC_Real_gfx6_gfx7<0x043>;
1077defm V_CMPS_GT_F32    : VOPC_Real_gfx6_gfx7<0x044>;
1078defm V_CMPS_LG_F32    : VOPC_Real_gfx6_gfx7<0x045>;
1079defm V_CMPS_GE_F32    : VOPC_Real_gfx6_gfx7<0x046>;
1080defm V_CMPS_O_F32     : VOPC_Real_gfx6_gfx7<0x047>;
1081defm V_CMPS_U_F32     : VOPC_Real_gfx6_gfx7<0x048>;
1082defm V_CMPS_NGE_F32   : VOPC_Real_gfx6_gfx7<0x049>;
1083defm V_CMPS_NLG_F32   : VOPC_Real_gfx6_gfx7<0x04a>;
1084defm V_CMPS_NGT_F32   : VOPC_Real_gfx6_gfx7<0x04b>;
1085defm V_CMPS_NLE_F32   : VOPC_Real_gfx6_gfx7<0x04c>;
1086defm V_CMPS_NEQ_F32   : VOPC_Real_gfx6_gfx7<0x04d>;
1087defm V_CMPS_NLT_F32   : VOPC_Real_gfx6_gfx7<0x04e>;
1088defm V_CMPS_TRU_F32   : VOPC_Real_gfx6_gfx7<0x04f>;
1089defm V_CMPSX_F_F32    : VOPCX_Real_gfx6_gfx7<0x050>;
1090defm V_CMPSX_LT_F32   : VOPCX_Real_gfx6_gfx7<0x051>;
1091defm V_CMPSX_EQ_F32   : VOPCX_Real_gfx6_gfx7<0x052>;
1092defm V_CMPSX_LE_F32   : VOPCX_Real_gfx6_gfx7<0x053>;
1093defm V_CMPSX_GT_F32   : VOPCX_Real_gfx6_gfx7<0x054>;
1094defm V_CMPSX_LG_F32   : VOPCX_Real_gfx6_gfx7<0x055>;
1095defm V_CMPSX_GE_F32   : VOPCX_Real_gfx6_gfx7<0x056>;
1096defm V_CMPSX_O_F32    : VOPCX_Real_gfx6_gfx7<0x057>;
1097defm V_CMPSX_U_F32    : VOPCX_Real_gfx6_gfx7<0x058>;
1098defm V_CMPSX_NGE_F32  : VOPCX_Real_gfx6_gfx7<0x059>;
1099defm V_CMPSX_NLG_F32  : VOPCX_Real_gfx6_gfx7<0x05a>;
1100defm V_CMPSX_NGT_F32  : VOPCX_Real_gfx6_gfx7<0x05b>;
1101defm V_CMPSX_NLE_F32  : VOPCX_Real_gfx6_gfx7<0x05c>;
1102defm V_CMPSX_NEQ_F32  : VOPCX_Real_gfx6_gfx7<0x05d>;
1103defm V_CMPSX_NLT_F32  : VOPCX_Real_gfx6_gfx7<0x05e>;
1104defm V_CMPSX_TRU_F32  : VOPCX_Real_gfx6_gfx7<0x05f>;
1105defm V_CMPS_F_F64     : VOPC_Real_gfx6_gfx7<0x060>;
1106defm V_CMPS_LT_F64    : VOPC_Real_gfx6_gfx7<0x061>;
1107defm V_CMPS_EQ_F64    : VOPC_Real_gfx6_gfx7<0x062>;
1108defm V_CMPS_LE_F64    : VOPC_Real_gfx6_gfx7<0x063>;
1109defm V_CMPS_GT_F64    : VOPC_Real_gfx6_gfx7<0x064>;
1110defm V_CMPS_LG_F64    : VOPC_Real_gfx6_gfx7<0x065>;
1111defm V_CMPS_GE_F64    : VOPC_Real_gfx6_gfx7<0x066>;
1112defm V_CMPS_O_F64     : VOPC_Real_gfx6_gfx7<0x067>;
1113defm V_CMPS_U_F64     : VOPC_Real_gfx6_gfx7<0x068>;
1114defm V_CMPS_NGE_F64   : VOPC_Real_gfx6_gfx7<0x069>;
1115defm V_CMPS_NLG_F64   : VOPC_Real_gfx6_gfx7<0x06a>;
1116defm V_CMPS_NGT_F64   : VOPC_Real_gfx6_gfx7<0x06b>;
1117defm V_CMPS_NLE_F64   : VOPC_Real_gfx6_gfx7<0x06c>;
1118defm V_CMPS_NEQ_F64   : VOPC_Real_gfx6_gfx7<0x06d>;
1119defm V_CMPS_NLT_F64   : VOPC_Real_gfx6_gfx7<0x06e>;
1120defm V_CMPS_TRU_F64   : VOPC_Real_gfx6_gfx7<0x06f>;
1121defm V_CMPSX_F_F64    : VOPCX_Real_gfx6_gfx7<0x070>;
1122defm V_CMPSX_LT_F64   : VOPCX_Real_gfx6_gfx7<0x071>;
1123defm V_CMPSX_EQ_F64   : VOPCX_Real_gfx6_gfx7<0x072>;
1124defm V_CMPSX_LE_F64   : VOPCX_Real_gfx6_gfx7<0x073>;
1125defm V_CMPSX_GT_F64   : VOPCX_Real_gfx6_gfx7<0x074>;
1126defm V_CMPSX_LG_F64   : VOPCX_Real_gfx6_gfx7<0x075>;
1127defm V_CMPSX_GE_F64   : VOPCX_Real_gfx6_gfx7<0x076>;
1128defm V_CMPSX_O_F64    : VOPCX_Real_gfx6_gfx7<0x077>;
1129defm V_CMPSX_U_F64    : VOPCX_Real_gfx6_gfx7<0x078>;
1130defm V_CMPSX_NGE_F64  : VOPCX_Real_gfx6_gfx7<0x079>;
1131defm V_CMPSX_NLG_F64  : VOPCX_Real_gfx6_gfx7<0x07a>;
1132defm V_CMPSX_NGT_F64  : VOPCX_Real_gfx6_gfx7<0x07b>;
1133defm V_CMPSX_NLE_F64  : VOPCX_Real_gfx6_gfx7<0x07c>;
1134defm V_CMPSX_NEQ_F64  : VOPCX_Real_gfx6_gfx7<0x07d>;
1135defm V_CMPSX_NLT_F64  : VOPCX_Real_gfx6_gfx7<0x07e>;
1136defm V_CMPSX_TRU_F64  : VOPCX_Real_gfx6_gfx7<0x07f>;
1137defm V_CMP_F_I32      : VOPC_Real_gfx6_gfx7_gfx10<0x080>;
1138defm V_CMP_LT_I32     : VOPC_Real_gfx6_gfx7_gfx10<0x081>;
1139defm V_CMP_EQ_I32     : VOPC_Real_gfx6_gfx7_gfx10<0x082>;
1140defm V_CMP_LE_I32     : VOPC_Real_gfx6_gfx7_gfx10<0x083>;
1141defm V_CMP_GT_I32     : VOPC_Real_gfx6_gfx7_gfx10<0x084>;
1142defm V_CMP_NE_I32     : VOPC_Real_gfx6_gfx7_gfx10<0x085>;
1143defm V_CMP_GE_I32     : VOPC_Real_gfx6_gfx7_gfx10<0x086>;
1144defm V_CMP_T_I32      : VOPC_Real_gfx6_gfx7_gfx10<0x087>;
1145defm V_CMP_CLASS_F32  : VOPC_Real_gfx6_gfx7_gfx10<0x088>;
1146defm V_CMPX_F_I32     : VOPCX_Real_gfx6_gfx7_gfx10<0x090>;
1147defm V_CMPX_LT_I32    : VOPCX_Real_gfx6_gfx7_gfx10<0x091>;
1148defm V_CMPX_EQ_I32    : VOPCX_Real_gfx6_gfx7_gfx10<0x092>;
1149defm V_CMPX_LE_I32    : VOPCX_Real_gfx6_gfx7_gfx10<0x093>;
1150defm V_CMPX_GT_I32    : VOPCX_Real_gfx6_gfx7_gfx10<0x094>;
1151defm V_CMPX_NE_I32    : VOPCX_Real_gfx6_gfx7_gfx10<0x095>;
1152defm V_CMPX_GE_I32    : VOPCX_Real_gfx6_gfx7_gfx10<0x096>;
1153defm V_CMPX_T_I32     : VOPCX_Real_gfx6_gfx7_gfx10<0x097>;
1154defm V_CMPX_CLASS_F32 : VOPCX_Real_gfx6_gfx7_gfx10<0x098>;
1155defm V_CMP_F_I64      : VOPC_Real_gfx6_gfx7_gfx10<0x0a0>;
1156defm V_CMP_LT_I64     : VOPC_Real_gfx6_gfx7_gfx10<0x0a1>;
1157defm V_CMP_EQ_I64     : VOPC_Real_gfx6_gfx7_gfx10<0x0a2>;
1158defm V_CMP_LE_I64     : VOPC_Real_gfx6_gfx7_gfx10<0x0a3>;
1159defm V_CMP_GT_I64     : VOPC_Real_gfx6_gfx7_gfx10<0x0a4>;
1160defm V_CMP_NE_I64     : VOPC_Real_gfx6_gfx7_gfx10<0x0a5>;
1161defm V_CMP_GE_I64     : VOPC_Real_gfx6_gfx7_gfx10<0x0a6>;
1162defm V_CMP_T_I64      : VOPC_Real_gfx6_gfx7_gfx10<0x0a7>;
1163defm V_CMP_CLASS_F64  : VOPC_Real_gfx6_gfx7_gfx10<0x0a8>;
1164defm V_CMPX_F_I64     : VOPCX_Real_gfx6_gfx7_gfx10<0x0b0>;
1165defm V_CMPX_LT_I64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0b1>;
1166defm V_CMPX_EQ_I64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0b2>;
1167defm V_CMPX_LE_I64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0b3>;
1168defm V_CMPX_GT_I64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0b4>;
1169defm V_CMPX_NE_I64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0b5>;
1170defm V_CMPX_GE_I64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0b6>;
1171defm V_CMPX_T_I64     : VOPCX_Real_gfx6_gfx7_gfx10<0x0b7>;
1172defm V_CMPX_CLASS_F64 : VOPCX_Real_gfx6_gfx7_gfx10<0x0b8>;
1173defm V_CMP_F_U32      : VOPC_Real_gfx6_gfx7_gfx10<0x0c0>;
1174defm V_CMP_LT_U32     : VOPC_Real_gfx6_gfx7_gfx10<0x0c1>;
1175defm V_CMP_EQ_U32     : VOPC_Real_gfx6_gfx7_gfx10<0x0c2>;
1176defm V_CMP_LE_U32     : VOPC_Real_gfx6_gfx7_gfx10<0x0c3>;
1177defm V_CMP_GT_U32     : VOPC_Real_gfx6_gfx7_gfx10<0x0c4>;
1178defm V_CMP_NE_U32     : VOPC_Real_gfx6_gfx7_gfx10<0x0c5>;
1179defm V_CMP_GE_U32     : VOPC_Real_gfx6_gfx7_gfx10<0x0c6>;
1180defm V_CMP_T_U32      : VOPC_Real_gfx6_gfx7_gfx10<0x0c7>;
1181defm V_CMPX_F_U32     : VOPCX_Real_gfx6_gfx7_gfx10<0x0d0>;
1182defm V_CMPX_LT_U32    : VOPCX_Real_gfx6_gfx7_gfx10<0x0d1>;
1183defm V_CMPX_EQ_U32    : VOPCX_Real_gfx6_gfx7_gfx10<0x0d2>;
1184defm V_CMPX_LE_U32    : VOPCX_Real_gfx6_gfx7_gfx10<0x0d3>;
1185defm V_CMPX_GT_U32    : VOPCX_Real_gfx6_gfx7_gfx10<0x0d4>;
1186defm V_CMPX_NE_U32    : VOPCX_Real_gfx6_gfx7_gfx10<0x0d5>;
1187defm V_CMPX_GE_U32    : VOPCX_Real_gfx6_gfx7_gfx10<0x0d6>;
1188defm V_CMPX_T_U32     : VOPCX_Real_gfx6_gfx7_gfx10<0x0d7>;
1189defm V_CMP_F_U64      : VOPC_Real_gfx6_gfx7_gfx10<0x0e0>;
1190defm V_CMP_LT_U64     : VOPC_Real_gfx6_gfx7_gfx10<0x0e1>;
1191defm V_CMP_EQ_U64     : VOPC_Real_gfx6_gfx7_gfx10<0x0e2>;
1192defm V_CMP_LE_U64     : VOPC_Real_gfx6_gfx7_gfx10<0x0e3>;
1193defm V_CMP_GT_U64     : VOPC_Real_gfx6_gfx7_gfx10<0x0e4>;
1194defm V_CMP_NE_U64     : VOPC_Real_gfx6_gfx7_gfx10<0x0e5>;
1195defm V_CMP_GE_U64     : VOPC_Real_gfx6_gfx7_gfx10<0x0e6>;
1196defm V_CMP_T_U64      : VOPC_Real_gfx6_gfx7_gfx10<0x0e7>;
1197defm V_CMPX_F_U64     : VOPCX_Real_gfx6_gfx7_gfx10<0x0f0>;
1198defm V_CMPX_LT_U64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0f1>;
1199defm V_CMPX_EQ_U64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0f2>;
1200defm V_CMPX_LE_U64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0f3>;
1201defm V_CMPX_GT_U64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0f4>;
1202defm V_CMPX_NE_U64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0f5>;
1203defm V_CMPX_GE_U64    : VOPCX_Real_gfx6_gfx7_gfx10<0x0f6>;
1204defm V_CMPX_T_U64     : VOPCX_Real_gfx6_gfx7_gfx10<0x0f7>;
1205
1206//===----------------------------------------------------------------------===//
1207// GFX8, GFX9 (VI).
1208//===----------------------------------------------------------------------===//
1209
1210multiclass VOPC_Real_vi <bits<10> op> {
1211  let AssemblerPredicates = [isGFX8GFX9], DecoderNamespace = "GFX8" in {
1212    def _e32_vi :
1213      VOPC_Real<!cast<VOPC_Pseudo>(NAME#"_e32"), SIEncodingFamily.VI>,
1214      VOPCe<op{7-0}>;
1215
1216    def _e64_vi :
1217      VOP3_Real<!cast<VOP3_Pseudo>(NAME#"_e64"), SIEncodingFamily.VI>,
1218      VOP3a_vi <op, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl> {
1219      // Encoding used for VOPC instructions encoded as VOP3
1220      // Differs from VOP3e by destination name (sdst) as VOPC doesn't have vector dst
1221      bits<8> sdst;
1222      let Inst{7-0} = sdst;
1223    }
1224  }
1225
1226  def _sdwa_vi :
1227    VOP_SDWA_Real <!cast<VOPC_SDWA_Pseudo>(NAME#"_sdwa")>,
1228    VOPC_SDWAe <op{7-0}, !cast<VOPC_SDWA_Pseudo>(NAME#"_sdwa").Pfl>;
1229
1230  def _sdwa_gfx9 :
1231    VOP_SDWA9_Real <!cast<VOPC_SDWA_Pseudo>(NAME#"_sdwa")>,
1232    VOPC_SDWA9e <op{7-0}, !cast<VOPC_SDWA_Pseudo>(NAME#"_sdwa").Pfl>;
1233
1234  let AssemblerPredicate = isGFX8GFX9 in {
1235    defm : VOPCInstAliases<NAME, "vi">;
1236  }
1237}
1238
1239defm V_CMP_CLASS_F32  : VOPC_Real_vi <0x10>;
1240defm V_CMPX_CLASS_F32 : VOPC_Real_vi <0x11>;
1241defm V_CMP_CLASS_F64  : VOPC_Real_vi <0x12>;
1242defm V_CMPX_CLASS_F64 : VOPC_Real_vi <0x13>;
1243defm V_CMP_CLASS_F16  : VOPC_Real_vi <0x14>;
1244defm V_CMPX_CLASS_F16 : VOPC_Real_vi <0x15>;
1245
1246defm V_CMP_F_F16      : VOPC_Real_vi <0x20>;
1247defm V_CMP_LT_F16     : VOPC_Real_vi <0x21>;
1248defm V_CMP_EQ_F16     : VOPC_Real_vi <0x22>;
1249defm V_CMP_LE_F16     : VOPC_Real_vi <0x23>;
1250defm V_CMP_GT_F16     : VOPC_Real_vi <0x24>;
1251defm V_CMP_LG_F16     : VOPC_Real_vi <0x25>;
1252defm V_CMP_GE_F16     : VOPC_Real_vi <0x26>;
1253defm V_CMP_O_F16      : VOPC_Real_vi <0x27>;
1254defm V_CMP_U_F16      : VOPC_Real_vi <0x28>;
1255defm V_CMP_NGE_F16    : VOPC_Real_vi <0x29>;
1256defm V_CMP_NLG_F16    : VOPC_Real_vi <0x2a>;
1257defm V_CMP_NGT_F16    : VOPC_Real_vi <0x2b>;
1258defm V_CMP_NLE_F16    : VOPC_Real_vi <0x2c>;
1259defm V_CMP_NEQ_F16    : VOPC_Real_vi <0x2d>;
1260defm V_CMP_NLT_F16    : VOPC_Real_vi <0x2e>;
1261defm V_CMP_TRU_F16    : VOPC_Real_vi <0x2f>;
1262
1263defm V_CMPX_F_F16     : VOPC_Real_vi <0x30>;
1264defm V_CMPX_LT_F16    : VOPC_Real_vi <0x31>;
1265defm V_CMPX_EQ_F16    : VOPC_Real_vi <0x32>;
1266defm V_CMPX_LE_F16    : VOPC_Real_vi <0x33>;
1267defm V_CMPX_GT_F16    : VOPC_Real_vi <0x34>;
1268defm V_CMPX_LG_F16    : VOPC_Real_vi <0x35>;
1269defm V_CMPX_GE_F16    : VOPC_Real_vi <0x36>;
1270defm V_CMPX_O_F16     : VOPC_Real_vi <0x37>;
1271defm V_CMPX_U_F16     : VOPC_Real_vi <0x38>;
1272defm V_CMPX_NGE_F16   : VOPC_Real_vi <0x39>;
1273defm V_CMPX_NLG_F16   : VOPC_Real_vi <0x3a>;
1274defm V_CMPX_NGT_F16   : VOPC_Real_vi <0x3b>;
1275defm V_CMPX_NLE_F16   : VOPC_Real_vi <0x3c>;
1276defm V_CMPX_NEQ_F16   : VOPC_Real_vi <0x3d>;
1277defm V_CMPX_NLT_F16   : VOPC_Real_vi <0x3e>;
1278defm V_CMPX_TRU_F16   : VOPC_Real_vi <0x3f>;
1279
1280defm V_CMP_F_F32      : VOPC_Real_vi <0x40>;
1281defm V_CMP_LT_F32     : VOPC_Real_vi <0x41>;
1282defm V_CMP_EQ_F32     : VOPC_Real_vi <0x42>;
1283defm V_CMP_LE_F32     : VOPC_Real_vi <0x43>;
1284defm V_CMP_GT_F32     : VOPC_Real_vi <0x44>;
1285defm V_CMP_LG_F32     : VOPC_Real_vi <0x45>;
1286defm V_CMP_GE_F32     : VOPC_Real_vi <0x46>;
1287defm V_CMP_O_F32      : VOPC_Real_vi <0x47>;
1288defm V_CMP_U_F32      : VOPC_Real_vi <0x48>;
1289defm V_CMP_NGE_F32    : VOPC_Real_vi <0x49>;
1290defm V_CMP_NLG_F32    : VOPC_Real_vi <0x4a>;
1291defm V_CMP_NGT_F32    : VOPC_Real_vi <0x4b>;
1292defm V_CMP_NLE_F32    : VOPC_Real_vi <0x4c>;
1293defm V_CMP_NEQ_F32    : VOPC_Real_vi <0x4d>;
1294defm V_CMP_NLT_F32    : VOPC_Real_vi <0x4e>;
1295defm V_CMP_TRU_F32    : VOPC_Real_vi <0x4f>;
1296
1297defm V_CMPX_F_F32     : VOPC_Real_vi <0x50>;
1298defm V_CMPX_LT_F32    : VOPC_Real_vi <0x51>;
1299defm V_CMPX_EQ_F32    : VOPC_Real_vi <0x52>;
1300defm V_CMPX_LE_F32    : VOPC_Real_vi <0x53>;
1301defm V_CMPX_GT_F32    : VOPC_Real_vi <0x54>;
1302defm V_CMPX_LG_F32    : VOPC_Real_vi <0x55>;
1303defm V_CMPX_GE_F32    : VOPC_Real_vi <0x56>;
1304defm V_CMPX_O_F32     : VOPC_Real_vi <0x57>;
1305defm V_CMPX_U_F32     : VOPC_Real_vi <0x58>;
1306defm V_CMPX_NGE_F32   : VOPC_Real_vi <0x59>;
1307defm V_CMPX_NLG_F32   : VOPC_Real_vi <0x5a>;
1308defm V_CMPX_NGT_F32   : VOPC_Real_vi <0x5b>;
1309defm V_CMPX_NLE_F32   : VOPC_Real_vi <0x5c>;
1310defm V_CMPX_NEQ_F32   : VOPC_Real_vi <0x5d>;
1311defm V_CMPX_NLT_F32   : VOPC_Real_vi <0x5e>;
1312defm V_CMPX_TRU_F32   : VOPC_Real_vi <0x5f>;
1313
1314defm V_CMP_F_F64      : VOPC_Real_vi <0x60>;
1315defm V_CMP_LT_F64     : VOPC_Real_vi <0x61>;
1316defm V_CMP_EQ_F64     : VOPC_Real_vi <0x62>;
1317defm V_CMP_LE_F64     : VOPC_Real_vi <0x63>;
1318defm V_CMP_GT_F64     : VOPC_Real_vi <0x64>;
1319defm V_CMP_LG_F64     : VOPC_Real_vi <0x65>;
1320defm V_CMP_GE_F64     : VOPC_Real_vi <0x66>;
1321defm V_CMP_O_F64      : VOPC_Real_vi <0x67>;
1322defm V_CMP_U_F64      : VOPC_Real_vi <0x68>;
1323defm V_CMP_NGE_F64    : VOPC_Real_vi <0x69>;
1324defm V_CMP_NLG_F64    : VOPC_Real_vi <0x6a>;
1325defm V_CMP_NGT_F64    : VOPC_Real_vi <0x6b>;
1326defm V_CMP_NLE_F64    : VOPC_Real_vi <0x6c>;
1327defm V_CMP_NEQ_F64    : VOPC_Real_vi <0x6d>;
1328defm V_CMP_NLT_F64    : VOPC_Real_vi <0x6e>;
1329defm V_CMP_TRU_F64    : VOPC_Real_vi <0x6f>;
1330
1331defm V_CMPX_F_F64     : VOPC_Real_vi <0x70>;
1332defm V_CMPX_LT_F64    : VOPC_Real_vi <0x71>;
1333defm V_CMPX_EQ_F64    : VOPC_Real_vi <0x72>;
1334defm V_CMPX_LE_F64    : VOPC_Real_vi <0x73>;
1335defm V_CMPX_GT_F64    : VOPC_Real_vi <0x74>;
1336defm V_CMPX_LG_F64    : VOPC_Real_vi <0x75>;
1337defm V_CMPX_GE_F64    : VOPC_Real_vi <0x76>;
1338defm V_CMPX_O_F64     : VOPC_Real_vi <0x77>;
1339defm V_CMPX_U_F64     : VOPC_Real_vi <0x78>;
1340defm V_CMPX_NGE_F64   : VOPC_Real_vi <0x79>;
1341defm V_CMPX_NLG_F64   : VOPC_Real_vi <0x7a>;
1342defm V_CMPX_NGT_F64   : VOPC_Real_vi <0x7b>;
1343defm V_CMPX_NLE_F64   : VOPC_Real_vi <0x7c>;
1344defm V_CMPX_NEQ_F64   : VOPC_Real_vi <0x7d>;
1345defm V_CMPX_NLT_F64   : VOPC_Real_vi <0x7e>;
1346defm V_CMPX_TRU_F64   : VOPC_Real_vi <0x7f>;
1347
1348defm V_CMP_F_I16      : VOPC_Real_vi <0xa0>;
1349defm V_CMP_LT_I16     : VOPC_Real_vi <0xa1>;
1350defm V_CMP_EQ_I16     : VOPC_Real_vi <0xa2>;
1351defm V_CMP_LE_I16     : VOPC_Real_vi <0xa3>;
1352defm V_CMP_GT_I16     : VOPC_Real_vi <0xa4>;
1353defm V_CMP_NE_I16     : VOPC_Real_vi <0xa5>;
1354defm V_CMP_GE_I16     : VOPC_Real_vi <0xa6>;
1355defm V_CMP_T_I16      : VOPC_Real_vi <0xa7>;
1356
1357defm V_CMP_F_U16      : VOPC_Real_vi <0xa8>;
1358defm V_CMP_LT_U16     : VOPC_Real_vi <0xa9>;
1359defm V_CMP_EQ_U16     : VOPC_Real_vi <0xaa>;
1360defm V_CMP_LE_U16     : VOPC_Real_vi <0xab>;
1361defm V_CMP_GT_U16     : VOPC_Real_vi <0xac>;
1362defm V_CMP_NE_U16     : VOPC_Real_vi <0xad>;
1363defm V_CMP_GE_U16     : VOPC_Real_vi <0xae>;
1364defm V_CMP_T_U16      : VOPC_Real_vi <0xaf>;
1365
1366defm V_CMPX_F_I16 : VOPC_Real_vi <0xb0>;
1367defm V_CMPX_LT_I16 : VOPC_Real_vi <0xb1>;
1368defm V_CMPX_EQ_I16 : VOPC_Real_vi <0xb2>;
1369defm V_CMPX_LE_I16 : VOPC_Real_vi <0xb3>;
1370defm V_CMPX_GT_I16 : VOPC_Real_vi <0xb4>;
1371defm V_CMPX_NE_I16 : VOPC_Real_vi <0xb5>;
1372defm V_CMPX_GE_I16 : VOPC_Real_vi <0xb6>;
1373defm V_CMPX_T_I16 : VOPC_Real_vi <0xb7>;
1374
1375defm V_CMPX_F_U16 : VOPC_Real_vi <0xb8>;
1376defm V_CMPX_LT_U16 : VOPC_Real_vi <0xb9>;
1377defm V_CMPX_EQ_U16 : VOPC_Real_vi <0xba>;
1378defm V_CMPX_LE_U16 : VOPC_Real_vi <0xbb>;
1379defm V_CMPX_GT_U16 : VOPC_Real_vi <0xbc>;
1380defm V_CMPX_NE_U16 : VOPC_Real_vi <0xbd>;
1381defm V_CMPX_GE_U16 : VOPC_Real_vi <0xbe>;
1382defm V_CMPX_T_U16 : VOPC_Real_vi <0xbf>;
1383
1384defm V_CMP_F_I32      : VOPC_Real_vi <0xc0>;
1385defm V_CMP_LT_I32     : VOPC_Real_vi <0xc1>;
1386defm V_CMP_EQ_I32     : VOPC_Real_vi <0xc2>;
1387defm V_CMP_LE_I32     : VOPC_Real_vi <0xc3>;
1388defm V_CMP_GT_I32     : VOPC_Real_vi <0xc4>;
1389defm V_CMP_NE_I32     : VOPC_Real_vi <0xc5>;
1390defm V_CMP_GE_I32     : VOPC_Real_vi <0xc6>;
1391defm V_CMP_T_I32      : VOPC_Real_vi <0xc7>;
1392
1393defm V_CMPX_F_I32     : VOPC_Real_vi <0xd0>;
1394defm V_CMPX_LT_I32    : VOPC_Real_vi <0xd1>;
1395defm V_CMPX_EQ_I32    : VOPC_Real_vi <0xd2>;
1396defm V_CMPX_LE_I32    : VOPC_Real_vi <0xd3>;
1397defm V_CMPX_GT_I32    : VOPC_Real_vi <0xd4>;
1398defm V_CMPX_NE_I32    : VOPC_Real_vi <0xd5>;
1399defm V_CMPX_GE_I32    : VOPC_Real_vi <0xd6>;
1400defm V_CMPX_T_I32     : VOPC_Real_vi <0xd7>;
1401
1402defm V_CMP_F_I64      : VOPC_Real_vi <0xe0>;
1403defm V_CMP_LT_I64     : VOPC_Real_vi <0xe1>;
1404defm V_CMP_EQ_I64     : VOPC_Real_vi <0xe2>;
1405defm V_CMP_LE_I64     : VOPC_Real_vi <0xe3>;
1406defm V_CMP_GT_I64     : VOPC_Real_vi <0xe4>;
1407defm V_CMP_NE_I64     : VOPC_Real_vi <0xe5>;
1408defm V_CMP_GE_I64     : VOPC_Real_vi <0xe6>;
1409defm V_CMP_T_I64      : VOPC_Real_vi <0xe7>;
1410
1411defm V_CMPX_F_I64     : VOPC_Real_vi <0xf0>;
1412defm V_CMPX_LT_I64    : VOPC_Real_vi <0xf1>;
1413defm V_CMPX_EQ_I64    : VOPC_Real_vi <0xf2>;
1414defm V_CMPX_LE_I64    : VOPC_Real_vi <0xf3>;
1415defm V_CMPX_GT_I64    : VOPC_Real_vi <0xf4>;
1416defm V_CMPX_NE_I64    : VOPC_Real_vi <0xf5>;
1417defm V_CMPX_GE_I64    : VOPC_Real_vi <0xf6>;
1418defm V_CMPX_T_I64     : VOPC_Real_vi <0xf7>;
1419
1420defm V_CMP_F_U32      : VOPC_Real_vi <0xc8>;
1421defm V_CMP_LT_U32     : VOPC_Real_vi <0xc9>;
1422defm V_CMP_EQ_U32     : VOPC_Real_vi <0xca>;
1423defm V_CMP_LE_U32     : VOPC_Real_vi <0xcb>;
1424defm V_CMP_GT_U32     : VOPC_Real_vi <0xcc>;
1425defm V_CMP_NE_U32     : VOPC_Real_vi <0xcd>;
1426defm V_CMP_GE_U32     : VOPC_Real_vi <0xce>;
1427defm V_CMP_T_U32      : VOPC_Real_vi <0xcf>;
1428
1429defm V_CMPX_F_U32     : VOPC_Real_vi <0xd8>;
1430defm V_CMPX_LT_U32    : VOPC_Real_vi <0xd9>;
1431defm V_CMPX_EQ_U32    : VOPC_Real_vi <0xda>;
1432defm V_CMPX_LE_U32    : VOPC_Real_vi <0xdb>;
1433defm V_CMPX_GT_U32    : VOPC_Real_vi <0xdc>;
1434defm V_CMPX_NE_U32    : VOPC_Real_vi <0xdd>;
1435defm V_CMPX_GE_U32    : VOPC_Real_vi <0xde>;
1436defm V_CMPX_T_U32     : VOPC_Real_vi <0xdf>;
1437
1438defm V_CMP_F_U64      : VOPC_Real_vi <0xe8>;
1439defm V_CMP_LT_U64     : VOPC_Real_vi <0xe9>;
1440defm V_CMP_EQ_U64     : VOPC_Real_vi <0xea>;
1441defm V_CMP_LE_U64     : VOPC_Real_vi <0xeb>;
1442defm V_CMP_GT_U64     : VOPC_Real_vi <0xec>;
1443defm V_CMP_NE_U64     : VOPC_Real_vi <0xed>;
1444defm V_CMP_GE_U64     : VOPC_Real_vi <0xee>;
1445defm V_CMP_T_U64      : VOPC_Real_vi <0xef>;
1446
1447defm V_CMPX_F_U64     : VOPC_Real_vi <0xf8>;
1448defm V_CMPX_LT_U64    : VOPC_Real_vi <0xf9>;
1449defm V_CMPX_EQ_U64    : VOPC_Real_vi <0xfa>;
1450defm V_CMPX_LE_U64    : VOPC_Real_vi <0xfb>;
1451defm V_CMPX_GT_U64    : VOPC_Real_vi <0xfc>;
1452defm V_CMPX_NE_U64    : VOPC_Real_vi <0xfd>;
1453defm V_CMPX_GE_U64    : VOPC_Real_vi <0xfe>;
1454defm V_CMPX_T_U64     : VOPC_Real_vi <0xff>;
1455