]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td
Merge libc++ r291274, and update the library Makefile.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AMDGPU / VOP3Instructions.td
1 //===-- VOP3Instructions.td - Vector Instruction Defintions ---------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // VOP3 Classes
12 //===----------------------------------------------------------------------===//
13
14 class getVOP3ModPat<VOPProfile P, SDPatternOperator node> {
15   list<dag> ret3 = [(set P.DstVT:$vdst,
16     (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod)),
17           (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers)),
18           (P.Src2VT (VOP3Mods P.Src2VT:$src2, i32:$src2_modifiers))))];
19
20   list<dag> ret2 = [(set P.DstVT:$vdst,
21     (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod)),
22           (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers))))];
23
24   list<dag> ret1 = [(set P.DstVT:$vdst,
25     (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod))))];
26
27   list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
28                   !if(!eq(P.NumSrcArgs, 2), ret2,
29                   ret1));
30 }
31
32 class getVOP3Pat<VOPProfile P, SDPatternOperator node> {
33   list<dag> ret3 = [(set P.DstVT:$vdst, (node P.Src0VT:$src0, P.Src1VT:$src1, P.Src2VT:$src2))];
34   list<dag> ret2 = [(set P.DstVT:$vdst, (node P.Src0VT:$src0, P.Src1VT:$src1))];
35   list<dag> ret1 = [(set P.DstVT:$vdst, (node P.Src0VT:$src0))];
36   list<dag> ret = !if(!eq(P.NumSrcArgs, 3), ret3,
37                   !if(!eq(P.NumSrcArgs, 2), ret2,
38                   ret1));
39 }
40
41 class VOP3Inst<string OpName, VOPProfile P, SDPatternOperator node = null_frag, bit VOP3Only = 0> :
42   VOP3_Pseudo<OpName, P,
43     !if(P.HasModifiers, getVOP3ModPat<P, node>.ret, getVOP3Pat<P, node>.ret),
44     VOP3Only>;
45
46 // Special case for v_div_fmas_{f32|f64}, since it seems to be the
47 // only VOP instruction that implicitly reads VCC.
48 let Asm64 = " $vdst, $src0_modifiers, $src1_modifiers, $src2_modifiers$clamp$omod" in {
49 def VOP_F32_F32_F32_F32_VCC : VOPProfile<[f32, f32, f32, f32]> {
50   let Outs64 = (outs DstRC.RegClass:$vdst);
51 }
52 def VOP_F64_F64_F64_F64_VCC : VOPProfile<[f64, f64, f64, f64]> {
53   let Outs64 = (outs DstRC.RegClass:$vdst);
54 }
55 }
56
57 class getVOP3VCC<VOPProfile P, SDPatternOperator node> {
58   list<dag> ret =
59     [(set P.DstVT:$vdst,
60       (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod)),
61             (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers)),
62             (P.Src2VT (VOP3Mods P.Src2VT:$src2, i32:$src2_modifiers)),
63             (i1 VCC)))];
64 }
65
66 class VOP3_Profile<VOPProfile P> : VOPProfile<P.ArgVT> {
67   // FIXME: Hack to stop printing _e64
68   let Outs64 = (outs DstRC.RegClass:$vdst);
69   let Asm64 = " " # P.Asm64;
70 }
71
72 class VOP3b_Profile<ValueType vt> : VOPProfile<[vt, vt, vt, vt]> {
73   let Outs64 = (outs DstRC:$vdst, SReg_64:$sdst);
74   let Asm64 = " $vdst, $sdst, $src0_modifiers, $src1_modifiers, $src2_modifiers$clamp$omod";
75 }
76
77 def VOP3b_F32_I1_F32_F32_F32 : VOP3b_Profile<f32> {
78   // FIXME: Hack to stop printing _e64
79   let DstRC = RegisterOperand<VGPR_32>;
80 }
81
82 def VOP3b_F64_I1_F64_F64_F64 : VOP3b_Profile<f64> {
83   // FIXME: Hack to stop printing _e64
84   let DstRC = RegisterOperand<VReg_64>;
85 }
86
87 //===----------------------------------------------------------------------===//
88 // VOP3 Instructions
89 //===----------------------------------------------------------------------===//
90
91 let isCommutable = 1 in {
92
93 def V_MAD_LEGACY_F32 : VOP3Inst <"v_mad_legacy_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
94 def V_MAD_F32 : VOP3Inst <"v_mad_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, fmad>;
95 def V_MAD_I32_I24 : VOP3Inst <"v_mad_i32_i24", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUmad_i24>;
96 def V_MAD_U32_U24 : VOP3Inst <"v_mad_u32_u24", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUmad_u24>;
97 def V_FMA_F32 : VOP3Inst <"v_fma_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, fma>;
98 def V_FMA_F64 : VOP3Inst <"v_fma_f64", VOP3_Profile<VOP_F64_F64_F64_F64>, fma>;
99 def V_LERP_U8 : VOP3Inst <"v_lerp_u8", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_lerp>;
100
101 let SchedRW = [WriteDoubleAdd] in {
102 def V_ADD_F64 : VOP3Inst <"v_add_f64", VOP3_Profile<VOP_F64_F64_F64>, fadd, 1>;
103 def V_MUL_F64 : VOP3Inst <"v_mul_f64", VOP3_Profile<VOP_F64_F64_F64>, fmul, 1>;
104 def V_MIN_F64 : VOP3Inst <"v_min_f64", VOP3_Profile<VOP_F64_F64_F64>, fminnum, 1>;
105 def V_MAX_F64 : VOP3Inst <"v_max_f64", VOP3_Profile<VOP_F64_F64_F64>, fmaxnum, 1>;
106 } // End SchedRW = [WriteDoubleAdd]
107
108 let SchedRW = [WriteQuarterRate32] in {
109 def V_MUL_LO_U32 : VOP3Inst <"v_mul_lo_u32", VOP3_Profile<VOP_I32_I32_I32>>;
110 def V_MUL_HI_U32 : VOP3Inst <"v_mul_hi_u32", VOP3_Profile<VOP_I32_I32_I32>, mulhu>;
111 def V_MUL_LO_I32 : VOP3Inst <"v_mul_lo_i32", VOP3_Profile<VOP_I32_I32_I32>>;
112 def V_MUL_HI_I32 : VOP3Inst <"v_mul_hi_i32", VOP3_Profile<VOP_I32_I32_I32>, mulhs>;
113 } // End SchedRW = [WriteQuarterRate32]
114
115 let Uses = [VCC, EXEC] in {
116 // v_div_fmas_f32:
117 //   result = src0 * src1 + src2
118 //   if (vcc)
119 //     result *= 2^32
120 //
121 def V_DIV_FMAS_F32 : VOP3_Pseudo <"v_div_fmas_f32", VOP_F32_F32_F32_F32_VCC,
122   getVOP3VCC<VOP_F32_F32_F32_F32_VCC, AMDGPUdiv_fmas>.ret> {
123   let SchedRW = [WriteFloatFMA];
124 }
125 // v_div_fmas_f64:
126 //   result = src0 * src1 + src2
127 //   if (vcc)
128 //     result *= 2^64
129 //
130 def V_DIV_FMAS_F64 : VOP3_Pseudo <"v_div_fmas_f64", VOP_F64_F64_F64_F64_VCC,
131   getVOP3VCC<VOP_F64_F64_F64_F64_VCC, AMDGPUdiv_fmas>.ret> {
132   let SchedRW = [WriteDouble];
133 }
134 } // End Uses = [VCC, EXEC]
135
136 } // End isCommutable = 1
137
138 def V_CUBEID_F32 : VOP3Inst <"v_cubeid_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubeid>;
139 def V_CUBESC_F32 : VOP3Inst <"v_cubesc_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubesc>;
140 def V_CUBETC_F32 : VOP3Inst <"v_cubetc_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubetc>;
141 def V_CUBEMA_F32 : VOP3Inst <"v_cubema_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, int_amdgcn_cubema>;
142 def V_BFE_U32 : VOP3Inst <"v_bfe_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfe_u32>;
143 def V_BFE_I32 : VOP3Inst <"v_bfe_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfe_i32>;
144 def V_BFI_B32 : VOP3Inst <"v_bfi_b32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUbfi>;
145 def V_ALIGNBIT_B32 : VOP3Inst <"v_alignbit_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
146 def V_ALIGNBYTE_B32 : VOP3Inst <"v_alignbyte_b32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
147 def V_MIN3_F32 : VOP3Inst <"v_min3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmin3>;
148 def V_MIN3_I32 : VOP3Inst <"v_min3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmin3>;
149 def V_MIN3_U32 : VOP3Inst <"v_min3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumin3>;
150 def V_MAX3_F32 : VOP3Inst <"v_max3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmax3>;
151 def V_MAX3_I32 : VOP3Inst <"v_max3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmax3>;
152 def V_MAX3_U32 : VOP3Inst <"v_max3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumax3>;
153 def V_MED3_F32 : VOP3Inst <"v_med3_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUfmed3>;
154 def V_MED3_I32 : VOP3Inst <"v_med3_i32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUsmed3>;
155 def V_MED3_U32 : VOP3Inst <"v_med3_u32", VOP3_Profile<VOP_I32_I32_I32_I32>, AMDGPUumed3>;
156 def V_SAD_U8 : VOP3Inst <"v_sad_u8", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_sad_u8>;
157 def V_SAD_HI_U8 : VOP3Inst <"v_sad_hi_u8", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_sad_hi_u8>;
158 def V_SAD_U16 : VOP3Inst <"v_sad_u16", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_sad_u16>;
159 def V_SAD_U32 : VOP3Inst <"v_sad_u32", VOP3_Profile<VOP_I32_I32_I32_I32>>;
160 def V_CVT_PK_U8_F32 : VOP3Inst<"v_cvt_pk_u8_f32", VOP3_Profile<VOP_I32_F32_I32_I32>, int_amdgcn_cvt_pk_u8_f32>;
161 def V_DIV_FIXUP_F32 : VOP3Inst <"v_div_fixup_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, AMDGPUdiv_fixup>;
162
163 let SchedRW = [WriteDoubleAdd] in {
164 def V_DIV_FIXUP_F64 : VOP3Inst <"v_div_fixup_f64", VOP3_Profile<VOP_F64_F64_F64_F64>, AMDGPUdiv_fixup>;
165 def V_LDEXP_F64 : VOP3Inst <"v_ldexp_f64", VOP3_Profile<VOP_F64_F64_I32>, AMDGPUldexp, 1>;
166 } // End SchedRW = [WriteDoubleAdd]
167
168 def V_DIV_SCALE_F32 : VOP3_Pseudo <"v_div_scale_f32", VOP3b_F32_I1_F32_F32_F32, [], 1> {
169   let SchedRW = [WriteFloatFMA, WriteSALU];
170   let hasExtraSrcRegAllocReq = 1;
171 }
172
173 // Double precision division pre-scale.
174 def V_DIV_SCALE_F64 : VOP3_Pseudo <"v_div_scale_f64", VOP3b_F64_I1_F64_F64_F64, [], 1> {
175   let SchedRW = [WriteDouble, WriteSALU];
176   let hasExtraSrcRegAllocReq = 1;
177 }
178
179 def V_MSAD_U8 : VOP3Inst <"v_msad_u8", VOP3_Profile<VOP_I32_I32_I32_I32>, int_amdgcn_msad_u8>;
180 def V_MQSAD_PK_U16_U8 : VOP3Inst <"v_mqsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64>, int_amdgcn_mqsad_pk_u16_u8>;
181
182 def V_TRIG_PREOP_F64 : VOP3Inst <"v_trig_preop_f64", VOP3_Profile<VOP_F64_F64_I32>, AMDGPUtrig_preop> {
183   let SchedRW = [WriteDouble];
184 }
185
186 // These instructions only exist on SI and CI
187 let SubtargetPredicate = isSICI in {
188 def V_LSHL_B64 : VOP3Inst <"v_lshl_b64", VOP3_Profile<VOP_I64_I64_I32>>;
189 def V_LSHR_B64 : VOP3Inst <"v_lshr_b64", VOP3_Profile<VOP_I64_I64_I32>>;
190 def V_ASHR_I64 : VOP3Inst <"v_ashr_i64", VOP3_Profile<VOP_I64_I64_I32>>;
191 def V_MULLIT_F32 : VOP3Inst <"v_mullit_f32", VOP3_Profile<VOP_F32_F32_F32_F32>>;
192 } // End SubtargetPredicate = isSICI
193
194 let SubtargetPredicate = isVI in {
195 def V_LSHLREV_B64 : VOP3Inst <"v_lshlrev_b64", VOP3_Profile<VOP_I64_I32_I64>>;
196 def V_LSHRREV_B64 : VOP3Inst <"v_lshrrev_b64", VOP3_Profile<VOP_I64_I32_I64>>;
197 def V_ASHRREV_I64 : VOP3Inst <"v_ashrrev_i64", VOP3_Profile<VOP_I64_I32_I64>>;
198 } // End SubtargetPredicate = isVI
199
200
201 let SubtargetPredicate = isCIVI in {
202
203 def V_MQSAD_U16_U8 : VOP3Inst <"v_mqsad_u16_u8", VOP3_Profile<VOP_I32_I32_I32>>;
204 def V_QSAD_PK_U16_U8 : VOP3Inst <"v_qsad_pk_u16_u8", VOP3_Profile<VOP_I64_I64_I32_I64>, int_amdgcn_qsad_pk_u16_u8>;
205 def V_MQSAD_U32_U8 : VOP3Inst <"v_mqsad_u32_u8", VOP3_Profile<VOP_V4I32_I64_I32_V4I32>, int_amdgcn_mqsad_u32_u8>;
206
207 let isCommutable = 1 in {
208 def V_MAD_U64_U32 : VOP3Inst <"v_mad_u64_u32", VOP3_Profile<VOP_I64_I32_I32_I64>>;
209
210 // XXX - Does this set VCC?
211 def V_MAD_I64_I32 : VOP3Inst <"v_mad_i64_i32", VOP3_Profile<VOP_I64_I32_I32_I64>>;
212 } // End isCommutable = 1
213
214 } // End SubtargetPredicate = isCIVI
215
216
217 let SubtargetPredicate = isVI in {
218
219 let isCommutable = 1 in {
220
221 def V_DIV_FIXUP_F16   : VOP3Inst <"v_div_fixup_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, AMDGPUdiv_fixup>;
222 def V_FMA_F16         : VOP3Inst <"v_fma_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, fma>;
223 def V_INTERP_P1LL_F16 : VOP3Inst <"v_interp_p1ll_f16", VOP3_Profile<VOP_F32_F32_F16>>;
224 def V_INTERP_P1LV_F16 : VOP3Inst <"v_interp_p1lv_f16", VOP3_Profile<VOP_F32_F32_F16_F16>>;
225 def V_INTERP_P2_F16   : VOP3Inst <"v_interp_p2_f16", VOP3_Profile<VOP_F16_F32_F16_F32>>;
226 def V_MAD_F16         : VOP3Inst <"v_mad_f16", VOP3_Profile<VOP_F16_F16_F16_F16>, fmad>;
227
228 def V_MAD_U16 : VOP3Inst <"v_mad_u16", VOP3_Profile<VOP_I16_I16_I16_I16>>;
229 def V_MAD_I16 : VOP3Inst <"v_mad_i16", VOP3_Profile<VOP_I16_I16_I16_I16>>;
230
231 }  // End isCommutable = 1
232
233 } // End SubtargetPredicate = isVI
234
235 let Predicates = [isVI] in {
236
237 multiclass Tenary_i16_Pats <SDPatternOperator op1, SDPatternOperator op2,
238                             Instruction inst, SDPatternOperator op3> {
239 def : Pat<
240   (op2 (op1 i16:$src0, i16:$src1), i16:$src2),
241   (inst i16:$src0, i16:$src1, i16:$src2)
242 >;
243
244 def : Pat<
245   (i32 (op3 (op2 (op1 i16:$src0, i16:$src1), i16:$src2))),
246   (inst i16:$src0, i16:$src1, i16:$src2)
247 >;
248
249 def : Pat<
250   (i64 (op3 (op2 (op1 i16:$src0, i16:$src1), i16:$src2))),
251    (REG_SEQUENCE VReg_64,
252      (inst i16:$src0, i16:$src1, i16:$src2), sub0,
253      (V_MOV_B32_e32 (i32 0)), sub1)
254 >;
255 }
256
257 defm: Tenary_i16_Pats<mul, add, V_MAD_U16, zext>;
258 defm: Tenary_i16_Pats<mul, add, V_MAD_I16, sext>;
259
260 } // End Predicates = [isVI]
261
262
263 //===----------------------------------------------------------------------===//
264 // Target
265 //===----------------------------------------------------------------------===//
266
267 //===----------------------------------------------------------------------===//
268 // SI
269 //===----------------------------------------------------------------------===//
270
271 let AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" in {
272
273 multiclass VOP3_Real_si<bits<9> op> {
274   def _si : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
275             VOP3e_si <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
276 }
277
278 multiclass VOP3be_Real_si<bits<9> op> {
279   def _si : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
280             VOP3be_si <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
281 }
282
283 } // End AssemblerPredicates = [isSICI], DecoderNamespace = "SICI"
284
285 defm V_MAD_LEGACY_F32   : VOP3_Real_si <0x140>;
286 defm V_MAD_F32          : VOP3_Real_si <0x141>;
287 defm V_MAD_I32_I24      : VOP3_Real_si <0x142>;
288 defm V_MAD_U32_U24      : VOP3_Real_si <0x143>;
289 defm V_CUBEID_F32       : VOP3_Real_si <0x144>;
290 defm V_CUBESC_F32       : VOP3_Real_si <0x145>;
291 defm V_CUBETC_F32       : VOP3_Real_si <0x146>;
292 defm V_CUBEMA_F32       : VOP3_Real_si <0x147>;
293 defm V_BFE_U32          : VOP3_Real_si <0x148>;
294 defm V_BFE_I32          : VOP3_Real_si <0x149>;
295 defm V_BFI_B32          : VOP3_Real_si <0x14a>;
296 defm V_FMA_F32          : VOP3_Real_si <0x14b>;
297 defm V_FMA_F64          : VOP3_Real_si <0x14c>;
298 defm V_LERP_U8          : VOP3_Real_si <0x14d>;
299 defm V_ALIGNBIT_B32     : VOP3_Real_si <0x14e>;
300 defm V_ALIGNBYTE_B32    : VOP3_Real_si <0x14f>;
301 defm V_MULLIT_F32       : VOP3_Real_si <0x150>;
302 defm V_MIN3_F32         : VOP3_Real_si <0x151>;
303 defm V_MIN3_I32         : VOP3_Real_si <0x152>;
304 defm V_MIN3_U32         : VOP3_Real_si <0x153>;
305 defm V_MAX3_F32         : VOP3_Real_si <0x154>;
306 defm V_MAX3_I32         : VOP3_Real_si <0x155>;
307 defm V_MAX3_U32         : VOP3_Real_si <0x156>;
308 defm V_MED3_F32         : VOP3_Real_si <0x157>;
309 defm V_MED3_I32         : VOP3_Real_si <0x158>;
310 defm V_MED3_U32         : VOP3_Real_si <0x159>;
311 defm V_SAD_U8           : VOP3_Real_si <0x15a>;
312 defm V_SAD_HI_U8        : VOP3_Real_si <0x15b>;
313 defm V_SAD_U16          : VOP3_Real_si <0x15c>;
314 defm V_SAD_U32          : VOP3_Real_si <0x15d>;
315 defm V_CVT_PK_U8_F32    : VOP3_Real_si <0x15e>;
316 defm V_DIV_FIXUP_F32    : VOP3_Real_si <0x15f>;
317 defm V_DIV_FIXUP_F64    : VOP3_Real_si <0x160>;
318 defm V_LSHL_B64         : VOP3_Real_si <0x161>;
319 defm V_LSHR_B64         : VOP3_Real_si <0x162>;
320 defm V_ASHR_I64         : VOP3_Real_si <0x163>;
321 defm V_ADD_F64          : VOP3_Real_si <0x164>;
322 defm V_MUL_F64          : VOP3_Real_si <0x165>;
323 defm V_MIN_F64          : VOP3_Real_si <0x166>;
324 defm V_MAX_F64          : VOP3_Real_si <0x167>;
325 defm V_LDEXP_F64        : VOP3_Real_si <0x168>;
326 defm V_MUL_LO_U32       : VOP3_Real_si <0x169>;
327 defm V_MUL_HI_U32       : VOP3_Real_si <0x16a>;
328 defm V_MUL_LO_I32       : VOP3_Real_si <0x16b>;
329 defm V_MUL_HI_I32       : VOP3_Real_si <0x16c>;
330 defm V_DIV_SCALE_F32    : VOP3be_Real_si <0x16d>;
331 defm V_DIV_SCALE_F64    : VOP3be_Real_si <0x16e>;
332 defm V_DIV_FMAS_F32     : VOP3_Real_si <0x16f>;
333 defm V_DIV_FMAS_F64     : VOP3_Real_si <0x170>;
334 defm V_MSAD_U8          : VOP3_Real_si <0x171>;
335 defm V_MQSAD_PK_U16_U8  : VOP3_Real_si <0x173>;
336 defm V_TRIG_PREOP_F64   : VOP3_Real_si <0x174>;
337
338 //===----------------------------------------------------------------------===//
339 // CI
340 //===----------------------------------------------------------------------===//
341
342 multiclass VOP3_Real_ci<bits<9> op> {
343   def _ci : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.SI>,
344             VOP3e_si <op, !cast<VOP3_Pseudo>(NAME).Pfl> {
345     let AssemblerPredicates = [isCIOnly];
346     let DecoderNamespace = "CI";
347   }
348 }
349
350 defm V_MQSAD_U16_U8     : VOP3_Real_ci <0x172>;
351 defm V_QSAD_PK_U16_U8   : VOP3_Real_ci <0x172>;
352 defm V_MQSAD_U32_U8     : VOP3_Real_ci <0x174>;
353 defm V_MAD_U64_U32      : VOP3_Real_ci <0x176>;
354 defm V_MAD_I64_I32      : VOP3_Real_ci <0x177>;
355
356 //===----------------------------------------------------------------------===//
357 // VI
358 //===----------------------------------------------------------------------===//
359
360 let AssemblerPredicates = [isVI], DecoderNamespace = "VI" in {
361
362 multiclass VOP3_Real_vi<bits<10> op> {
363   def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
364             VOP3e_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
365 }
366
367 multiclass VOP3be_Real_vi<bits<10> op> {
368   def _vi : VOP3_Real<!cast<VOP3_Pseudo>(NAME), SIEncodingFamily.VI>,
369             VOP3be_vi <op, !cast<VOP3_Pseudo>(NAME).Pfl>;
370 }
371
372 } // End AssemblerPredicates = [isVI], DecoderNamespace = "VI"
373
374 defm V_MQSAD_U16_U8     : VOP3_Real_vi <0x172>;
375 defm V_MAD_U64_U32      : VOP3_Real_vi <0x176>;
376 defm V_MAD_I64_I32      : VOP3_Real_vi <0x177>;
377
378 defm V_MAD_LEGACY_F32   : VOP3_Real_vi <0x1c0>;
379 defm V_MAD_F32          : VOP3_Real_vi <0x1c1>;
380 defm V_MAD_I32_I24      : VOP3_Real_vi <0x1c2>;
381 defm V_MAD_U32_U24      : VOP3_Real_vi <0x1c3>;
382 defm V_CUBEID_F32       : VOP3_Real_vi <0x1c4>;
383 defm V_CUBESC_F32       : VOP3_Real_vi <0x1c5>;
384 defm V_CUBETC_F32       : VOP3_Real_vi <0x1c6>;
385 defm V_CUBEMA_F32       : VOP3_Real_vi <0x1c7>;
386 defm V_BFE_U32          : VOP3_Real_vi <0x1c8>;
387 defm V_BFE_I32          : VOP3_Real_vi <0x1c9>;
388 defm V_BFI_B32          : VOP3_Real_vi <0x1ca>;
389 defm V_FMA_F32          : VOP3_Real_vi <0x1cb>;
390 defm V_FMA_F64          : VOP3_Real_vi <0x1cc>;
391 defm V_LERP_U8          : VOP3_Real_vi <0x1cd>;
392 defm V_ALIGNBIT_B32     : VOP3_Real_vi <0x1ce>;
393 defm V_ALIGNBYTE_B32    : VOP3_Real_vi <0x1cf>;
394 defm V_MIN3_F32         : VOP3_Real_vi <0x1d0>;
395 defm V_MIN3_I32         : VOP3_Real_vi <0x1d1>;
396 defm V_MIN3_U32         : VOP3_Real_vi <0x1d2>;
397 defm V_MAX3_F32         : VOP3_Real_vi <0x1d3>;
398 defm V_MAX3_I32         : VOP3_Real_vi <0x1d4>;
399 defm V_MAX3_U32         : VOP3_Real_vi <0x1d5>;
400 defm V_MED3_F32         : VOP3_Real_vi <0x1d6>;
401 defm V_MED3_I32         : VOP3_Real_vi <0x1d7>;
402 defm V_MED3_U32         : VOP3_Real_vi <0x1d8>;
403 defm V_SAD_U8           : VOP3_Real_vi <0x1d9>;
404 defm V_SAD_HI_U8        : VOP3_Real_vi <0x1da>;
405 defm V_SAD_U16          : VOP3_Real_vi <0x1db>;
406 defm V_SAD_U32          : VOP3_Real_vi <0x1dc>;
407 defm V_CVT_PK_U8_F32    : VOP3_Real_vi <0x1dd>;
408 defm V_DIV_FIXUP_F32    : VOP3_Real_vi <0x1de>;
409 defm V_DIV_FIXUP_F64    : VOP3_Real_vi <0x1df>;
410 defm V_DIV_SCALE_F32    : VOP3be_Real_vi <0x1e0>;
411 defm V_DIV_SCALE_F64    : VOP3be_Real_vi <0x1e1>;
412 defm V_DIV_FMAS_F32     : VOP3_Real_vi <0x1e2>;
413 defm V_DIV_FMAS_F64     : VOP3_Real_vi <0x1e3>;
414 defm V_MSAD_U8          : VOP3_Real_vi <0x1e4>;
415 defm V_QSAD_PK_U16_U8   : VOP3_Real_vi <0x1e5>;
416 defm V_MQSAD_PK_U16_U8  : VOP3_Real_vi <0x1e6>;
417 defm V_MQSAD_U32_U8     : VOP3_Real_vi <0x1e7>;
418
419 defm V_MAD_F16          : VOP3_Real_vi <0x1ea>;
420 defm V_MAD_U16          : VOP3_Real_vi <0x1eb>;
421 defm V_MAD_I16          : VOP3_Real_vi <0x1ec>;
422
423 defm V_FMA_F16          : VOP3_Real_vi <0x1ee>;
424 defm V_DIV_FIXUP_F16    : VOP3_Real_vi <0x1ef>;
425
426 defm V_INTERP_P1LL_F16  : VOP3_Real_vi <0x274>;
427 defm V_INTERP_P1LV_F16  : VOP3_Real_vi <0x275>;
428 defm V_INTERP_P2_F16    : VOP3_Real_vi <0x276>;
429 defm V_ADD_F64          : VOP3_Real_vi <0x280>;
430 defm V_MUL_F64          : VOP3_Real_vi <0x281>;
431 defm V_MIN_F64          : VOP3_Real_vi <0x282>;
432 defm V_MAX_F64          : VOP3_Real_vi <0x283>;
433 defm V_LDEXP_F64        : VOP3_Real_vi <0x284>;
434 defm V_MUL_LO_U32       : VOP3_Real_vi <0x285>;
435
436 // removed from VI as identical to V_MUL_LO_U32
437 let isAsmParserOnly = 1 in {
438 defm V_MUL_LO_I32       : VOP3_Real_vi <0x285>;
439 }
440
441 defm V_MUL_HI_U32       : VOP3_Real_vi <0x286>;
442 defm V_MUL_HI_I32       : VOP3_Real_vi <0x287>;
443
444 defm V_LSHLREV_B64      : VOP3_Real_vi <0x28f>;
445 defm V_LSHRREV_B64      : VOP3_Real_vi <0x290>;
446 defm V_ASHRREV_I64      : VOP3_Real_vi <0x291>;
447 defm V_TRIG_PREOP_F64   : VOP3_Real_vi <0x292>;