]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td
Merge ^/vendor/llvm-libunwind/dist up to its last change, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / lib / Target / AMDGPU / AMDGPUInstrInfo.td
1 //===-- AMDGPUInstrInfo.td - AMDGPU DAG nodes --------------*- tablegen -*-===//
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 // This file contains DAG node defintions for the AMDGPU target.
10 //
11 //===----------------------------------------------------------------------===//
12
13 //===----------------------------------------------------------------------===//
14 // AMDGPU DAG Profiles
15 //===----------------------------------------------------------------------===//
16
17 def AMDGPUDTIntTernaryOp : SDTypeProfile<1, 3, [
18   SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>
19 ]>;
20
21 def AMDGPUTrigPreOp : SDTypeProfile<1, 2,
22   [SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisInt<2>]
23 >;
24
25 def AMDGPULdExpOp : SDTypeProfile<1, 2,
26   [SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisInt<2>]
27 >;
28
29 def AMDGPUFPClassOp : SDTypeProfile<1, 2,
30   [SDTCisInt<0>, SDTCisFP<1>, SDTCisInt<2>]
31 >;
32
33 def AMDGPUFPPackOp : SDTypeProfile<1, 2,
34   [SDTCisFP<1>, SDTCisSameAs<1, 2>]
35 >;
36
37 def AMDGPUIntPackOp : SDTypeProfile<1, 2,
38   [SDTCisInt<1>, SDTCisSameAs<1, 2>]
39 >;
40
41 def AMDGPUDivScaleOp : SDTypeProfile<2, 3,
42   [SDTCisFP<0>, SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisSameAs<0, 4>]
43 >;
44
45 // float, float, float, vcc
46 def AMDGPUFmasOp : SDTypeProfile<1, 4,
47   [SDTCisFP<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisInt<4>]
48 >;
49
50 def AMDGPUKillSDT : SDTypeProfile<0, 1, [SDTCisInt<0>]>;
51
52 def AMDGPUIfOp : SDTypeProfile<1, 2,
53   [SDTCisVT<0, i1>, SDTCisVT<1, i1>, SDTCisVT<2, OtherVT>]
54 >;
55
56 def AMDGPUElseOp : SDTypeProfile<1, 2,
57   [SDTCisVT<0, i1>, SDTCisVT<1, i1>, SDTCisVT<2, OtherVT>]
58 >;
59
60 def AMDGPULoopOp : SDTypeProfile<0, 2,
61   [SDTCisVT<0, i1>, SDTCisVT<1, OtherVT>]
62 >;
63
64 def AMDGPUIfBreakOp : SDTypeProfile<1, 2,
65   [SDTCisVT<0, i1>, SDTCisVT<1, i1>, SDTCisVT<2, i1>]
66 >;
67
68 //===----------------------------------------------------------------------===//
69 // AMDGPU DAG Nodes
70 //
71
72 def AMDGPUif : SDNode<"AMDGPUISD::IF", AMDGPUIfOp, [SDNPHasChain]>;
73 def AMDGPUelse : SDNode<"AMDGPUISD::ELSE", AMDGPUElseOp, [SDNPHasChain]>;
74 def AMDGPUloop : SDNode<"AMDGPUISD::LOOP", AMDGPULoopOp, [SDNPHasChain]>;
75
76 def callseq_start : SDNode<"ISD::CALLSEQ_START",
77   SDCallSeqStart<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>,
78   [SDNPHasChain, SDNPOutGlue]
79 >;
80
81 def callseq_end : SDNode<"ISD::CALLSEQ_END",
82  SDCallSeqEnd<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>,
83   [SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]
84 >;
85
86 def AMDGPUcall : SDNode<"AMDGPUISD::CALL",
87   SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>,
88   [SDNPHasChain, SDNPOptInGlue, SDNPOutGlue,
89   SDNPVariadic]
90 >;
91
92 def AMDGPUtc_return: SDNode<"AMDGPUISD::TC_RETURN",
93   SDTypeProfile<0, 3, [SDTCisPtrTy<0>]>,
94   [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]
95 >;
96
97 def AMDGPUtrap : SDNode<"AMDGPUISD::TRAP",
98   SDTypeProfile<0, -1, [SDTCisVT<0, i16>]>,
99     [SDNPHasChain, SDNPVariadic, SDNPSideEffect, SDNPInGlue]
100 >;
101
102 def AMDGPUconstdata_ptr : SDNode<
103   "AMDGPUISD::CONST_DATA_PTR", SDTypeProfile <1, 1, [SDTCisVT<0, iPTR>,
104                                                      SDTCisVT<0, iPTR>]>
105 >;
106
107 // This argument to this node is a dword address.
108 def AMDGPUdwordaddr : SDNode<"AMDGPUISD::DWORDADDR", SDTIntUnaryOp>;
109
110 // Force dependencies for vector trunc stores
111 def R600dummy_chain : SDNode<"AMDGPUISD::DUMMY_CHAIN", SDTNone, [SDNPHasChain]>;
112
113 def AMDGPUcos_impl : SDNode<"AMDGPUISD::COS_HW", SDTFPUnaryOp>;
114 def AMDGPUsin_impl : SDNode<"AMDGPUISD::SIN_HW", SDTFPUnaryOp>;
115 // out = a - floor(a)
116 def AMDGPUfract_impl : SDNode<"AMDGPUISD::FRACT", SDTFPUnaryOp>;
117
118 // out = 1.0 / a
119 def AMDGPUrcp_impl : SDNode<"AMDGPUISD::RCP", SDTFPUnaryOp>;
120
121 // out = 1.0 / sqrt(a)
122 def AMDGPUrsq_impl : SDNode<"AMDGPUISD::RSQ", SDTFPUnaryOp>;
123
124 // out = 1.0 / sqrt(a)
125 def AMDGPUrsq_legacy_impl : SDNode<"AMDGPUISD::RSQ_LEGACY", SDTFPUnaryOp>;
126 def AMDGPUrcp_legacy_impl : SDNode<"AMDGPUISD::RCP_LEGACY", SDTFPUnaryOp>;
127
128 def AMDGPUrcp_iflag : SDNode<"AMDGPUISD::RCP_IFLAG", SDTFPUnaryOp>;
129
130 // out = 1.0 / sqrt(a) result clamped to +/- max_float.
131 def AMDGPUrsq_clamp_impl : SDNode<"AMDGPUISD::RSQ_CLAMP", SDTFPUnaryOp>;
132
133 def AMDGPUldexp_impl : SDNode<"AMDGPUISD::LDEXP", AMDGPULdExpOp>;
134
135 def AMDGPUpkrtz_f16_f32_impl : SDNode<"AMDGPUISD::CVT_PKRTZ_F16_F32", AMDGPUFPPackOp>;
136 def AMDGPUpknorm_i16_f32_impl : SDNode<"AMDGPUISD::CVT_PKNORM_I16_F32", AMDGPUFPPackOp>;
137 def AMDGPUpknorm_u16_f32_impl : SDNode<"AMDGPUISD::CVT_PKNORM_U16_F32", AMDGPUFPPackOp>;
138 def AMDGPUpk_i16_i32_impl : SDNode<"AMDGPUISD::CVT_PK_I16_I32", AMDGPUIntPackOp>;
139 def AMDGPUpk_u16_u32_impl : SDNode<"AMDGPUISD::CVT_PK_U16_U32", AMDGPUIntPackOp>;
140 def AMDGPUfp_to_f16 : SDNode<"AMDGPUISD::FP_TO_FP16" , SDTFPToIntOp>;
141 def AMDGPUfp16_zext : SDNode<"AMDGPUISD::FP16_ZEXT" , SDTFPToIntOp>;
142
143
144 def AMDGPUfp_class_impl : SDNode<"AMDGPUISD::FP_CLASS", AMDGPUFPClassOp>;
145
146 // out = max(a, b) a and b are floats, where a nan comparison fails.
147 // This is not commutative because this gives the second operand:
148 //   x < nan ? x : nan -> nan
149 //   nan < x ? nan : x -> x
150 def AMDGPUfmax_legacy : SDNode<"AMDGPUISD::FMAX_LEGACY", SDTFPBinOp,
151   []
152 >;
153
154 def AMDGPUfmul_legacy : SDNode<"AMDGPUISD::FMUL_LEGACY", SDTFPBinOp,
155   [SDNPCommutative, SDNPAssociative]
156 >;
157
158 // out = min(a, b) a and b are floats, where a nan comparison fails.
159 def AMDGPUfmin_legacy : SDNode<"AMDGPUISD::FMIN_LEGACY", SDTFPBinOp,
160   []
161 >;
162
163 // FIXME: TableGen doesn't like commutative instructions with more
164 // than 2 operands.
165 // out = max(a, b, c) a, b and c are floats
166 def AMDGPUfmax3 : SDNode<"AMDGPUISD::FMAX3", SDTFPTernaryOp,
167   [/*SDNPCommutative, SDNPAssociative*/]
168 >;
169
170 // out = max(a, b, c) a, b, and c are signed ints
171 def AMDGPUsmax3 : SDNode<"AMDGPUISD::SMAX3", AMDGPUDTIntTernaryOp,
172   [/*SDNPCommutative, SDNPAssociative*/]
173 >;
174
175 // out = max(a, b, c) a, b and c are unsigned ints
176 def AMDGPUumax3 : SDNode<"AMDGPUISD::UMAX3", AMDGPUDTIntTernaryOp,
177   [/*SDNPCommutative, SDNPAssociative*/]
178 >;
179
180 // out = min(a, b, c) a, b and c are floats
181 def AMDGPUfmin3 : SDNode<"AMDGPUISD::FMIN3", SDTFPTernaryOp,
182   [/*SDNPCommutative, SDNPAssociative*/]
183 >;
184
185 // out = min(a, b, c) a, b and c are signed ints
186 def AMDGPUsmin3 : SDNode<"AMDGPUISD::SMIN3", AMDGPUDTIntTernaryOp,
187   [/*SDNPCommutative, SDNPAssociative*/]
188 >;
189
190 // out = min(a, b) a and b are unsigned ints
191 def AMDGPUumin3 : SDNode<"AMDGPUISD::UMIN3", AMDGPUDTIntTernaryOp,
192   [/*SDNPCommutative, SDNPAssociative*/]
193 >;
194
195 // out = (src0 + src1 > 0xFFFFFFFF) ? 1 : 0
196 def AMDGPUcarry : SDNode<"AMDGPUISD::CARRY", SDTIntBinOp, []>;
197
198 // out = (src1 > src0) ? 1 : 0
199 def AMDGPUborrow : SDNode<"AMDGPUISD::BORROW", SDTIntBinOp, []>;
200
201 def AMDGPUSetCCOp : SDTypeProfile<1, 3, [        // setcc
202   SDTCisInt<0>, SDTCisSameAs<1, 2>, SDTCisVT<3, OtherVT>
203 ]>;
204
205 def AMDGPUsetcc : SDNode<"AMDGPUISD::SETCC", AMDGPUSetCCOp>;
206
207 def AMDGPUSetRegOp :  SDTypeProfile<0, 2, [
208   SDTCisInt<0>, SDTCisInt<1>
209 ]>;
210
211 def AMDGPUsetreg : SDNode<"AMDGPUISD::SETREG", AMDGPUSetRegOp, [
212   SDNPHasChain, SDNPSideEffect, SDNPOptInGlue, SDNPOutGlue]>;
213
214 def AMDGPUfma : SDNode<"AMDGPUISD::FMA_W_CHAIN", SDTFPTernaryOp, [
215    SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
216
217 def AMDGPUmul : SDNode<"AMDGPUISD::FMUL_W_CHAIN", SDTFPBinOp, [
218   SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
219
220 def AMDGPUcvt_f32_ubyte0 : SDNode<"AMDGPUISD::CVT_F32_UBYTE0",
221   SDTIntToFPOp, []>;
222 def AMDGPUcvt_f32_ubyte1 : SDNode<"AMDGPUISD::CVT_F32_UBYTE1",
223   SDTIntToFPOp, []>;
224 def AMDGPUcvt_f32_ubyte2 : SDNode<"AMDGPUISD::CVT_F32_UBYTE2",
225   SDTIntToFPOp, []>;
226 def AMDGPUcvt_f32_ubyte3 : SDNode<"AMDGPUISD::CVT_F32_UBYTE3",
227   SDTIntToFPOp, []>;
228
229
230 // urecip - This operation is a helper for integer division, it returns the
231 // result of 1 / a as a fractional unsigned integer.
232 // out = (2^32 / a) + e
233 // e is rounding error
234 def AMDGPUurecip : SDNode<"AMDGPUISD::URECIP", SDTIntUnaryOp>;
235
236 // Special case divide preop and flags.
237 def AMDGPUdiv_scale : SDNode<"AMDGPUISD::DIV_SCALE", AMDGPUDivScaleOp>;
238
239 //  Special case divide FMA with scale and flags (src0 = Quotient,
240 //  src1 = Denominator, src2 = Numerator).
241 def AMDGPUdiv_fmas : SDNode<"AMDGPUISD::DIV_FMAS", AMDGPUFmasOp,
242                             [SDNPOptInGlue]>;
243
244 // Single or double precision division fixup.
245 // Special case divide fixup and flags(src0 = Quotient, src1 =
246 // Denominator, src2 = Numerator).
247 def AMDGPUdiv_fixup : SDNode<"AMDGPUISD::DIV_FIXUP", SDTFPTernaryOp>;
248
249 def AMDGPUfmad_ftz : SDNode<"AMDGPUISD::FMAD_FTZ", SDTFPTernaryOp>;
250
251 // Look Up 2.0 / pi src0 with segment select src1[4:0]
252 def AMDGPUtrig_preop : SDNode<"AMDGPUISD::TRIG_PREOP", AMDGPUTrigPreOp>;
253
254 def AMDGPUregister_load : SDNode<"AMDGPUISD::REGISTER_LOAD",
255                           SDTypeProfile<1, 2, [SDTCisPtrTy<1>, SDTCisInt<2>]>,
256                           [SDNPHasChain, SDNPMayLoad]>;
257
258 def AMDGPUregister_store : SDNode<"AMDGPUISD::REGISTER_STORE",
259                            SDTypeProfile<0, 3, [SDTCisPtrTy<1>, SDTCisInt<2>]>,
260                            [SDNPHasChain, SDNPMayStore]>;
261
262 // MSKOR instructions are atomic memory instructions used mainly for storing
263 // 8-bit and 16-bit values.  The definition is:
264 //
265 // MSKOR(dst, mask, src) MEM[dst] = ((MEM[dst] & ~mask) | src)
266 //
267 // src0: vec4(src, 0, 0, mask)
268 // src1: dst - rat offset (aka pointer) in dwords
269 def AMDGPUstore_mskor : SDNode<"AMDGPUISD::STORE_MSKOR",
270                         SDTypeProfile<0, 2, []>,
271                         [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>;
272
273 def AMDGPUatomic_cmp_swap : SDNode<"AMDGPUISD::ATOMIC_CMP_SWAP",
274                             SDTypeProfile<1, 2, [SDTCisPtrTy<1>, SDTCisVec<2>]>,
275                             [SDNPHasChain, SDNPMayStore, SDNPMayLoad,
276                              SDNPMemOperand]>;
277
278 def AMDGPUround : SDNode<"ISD::FROUND",
279                          SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisSameAs<0,1>]>>;
280
281 def AMDGPUbfe_u32 : SDNode<"AMDGPUISD::BFE_U32", AMDGPUDTIntTernaryOp>;
282 def AMDGPUbfe_i32 : SDNode<"AMDGPUISD::BFE_I32", AMDGPUDTIntTernaryOp>;
283 def AMDGPUbfi : SDNode<"AMDGPUISD::BFI", AMDGPUDTIntTernaryOp>;
284 def AMDGPUbfm : SDNode<"AMDGPUISD::BFM", SDTIntBinOp>;
285
286 def AMDGPUffbh_u32 : SDNode<"AMDGPUISD::FFBH_U32", SDTIntUnaryOp>;
287 def AMDGPUffbh_i32_impl : SDNode<"AMDGPUISD::FFBH_I32", SDTIntUnaryOp>;
288
289 def AMDGPUffbl_b32 : SDNode<"AMDGPUISD::FFBL_B32", SDTIntUnaryOp>;
290
291 // Signed and unsigned 24-bit multiply. The highest 8-bits are ignore
292 // when performing the mulitply. The result is a 32-bit value.
293 def AMDGPUmul_u24 : SDNode<"AMDGPUISD::MUL_U24", SDTIntBinOp,
294   [SDNPCommutative, SDNPAssociative]
295 >;
296 def AMDGPUmul_i24 : SDNode<"AMDGPUISD::MUL_I24", SDTIntBinOp,
297   [SDNPCommutative, SDNPAssociative]
298 >;
299
300 def AMDGPUmulhi_u24 : SDNode<"AMDGPUISD::MULHI_U24", SDTIntBinOp,
301   [SDNPCommutative, SDNPAssociative]
302 >;
303 def AMDGPUmulhi_i24 : SDNode<"AMDGPUISD::MULHI_I24", SDTIntBinOp,
304   [SDNPCommutative, SDNPAssociative]
305 >;
306
307 def AMDGPUmad_u24 : SDNode<"AMDGPUISD::MAD_U24", AMDGPUDTIntTernaryOp,
308   []
309 >;
310 def AMDGPUmad_i24 : SDNode<"AMDGPUISD::MAD_I24", AMDGPUDTIntTernaryOp,
311   []
312 >;
313
314 def AMDGPUsmed3 : SDNode<"AMDGPUISD::SMED3", AMDGPUDTIntTernaryOp,
315   []
316 >;
317
318 def AMDGPUumed3 : SDNode<"AMDGPUISD::UMED3", AMDGPUDTIntTernaryOp,
319   []
320 >;
321
322 def AMDGPUfmed3_impl : SDNode<"AMDGPUISD::FMED3", SDTFPTernaryOp, []>;
323
324 def AMDGPUfdot2 : SDNode<"AMDGPUISD::FDOT2",
325                   SDTypeProfile<1, 4, [SDTCisSameAs<0, 3>, SDTCisSameAs<1, 2>,
326                                        SDTCisFP<0>, SDTCisVec<1>,
327                                        SDTCisInt<4>]>,
328                   []>;
329
330 def AMDGPUperm : SDNode<"AMDGPUISD::PERM", AMDGPUDTIntTernaryOp, []>;
331
332 def AMDGPUinterp_p1ll_f16 : SDNode<"AMDGPUISD::INTERP_P1LL_F16",
333                             SDTypeProfile<1, 7, [SDTCisFP<0>]>,
334                             [SDNPInGlue, SDNPOutGlue]>;
335
336 def AMDGPUinterp_p1lv_f16 : SDNode<"AMDGPUISD::INTERP_P1LV_F16",
337                             SDTypeProfile<1, 9, [SDTCisFP<0>]>,
338                             [SDNPInGlue, SDNPOutGlue]>;
339
340 def AMDGPUinterp_p2_f16 : SDNode<"AMDGPUISD::INTERP_P2_F16",
341                           SDTypeProfile<1, 8, [SDTCisFP<0>]>,
342                           [SDNPInGlue]>;
343
344 def AMDGPUkill : SDNode<"AMDGPUISD::KILL", AMDGPUKillSDT,
345   [SDNPHasChain, SDNPSideEffect]>;
346
347 // SI+ export
348 def AMDGPUExportOp : SDTypeProfile<0, 8, [
349   SDTCisInt<0>,       // i8 tgt
350   SDTCisInt<1>,       // i8 en
351                       // i32 or f32 src0
352   SDTCisSameAs<3, 2>, // f32 src1
353   SDTCisSameAs<4, 2>, // f32 src2
354   SDTCisSameAs<5, 2>, // f32 src3
355   SDTCisInt<6>,       // i1 compr
356   // skip done
357   SDTCisInt<1>        // i1 vm
358
359 ]>;
360
361 def AMDGPUexport: SDNode<"AMDGPUISD::EXPORT", AMDGPUExportOp,
362   [SDNPHasChain, SDNPMayStore]>;
363
364 def AMDGPUexport_done: SDNode<"AMDGPUISD::EXPORT_DONE", AMDGPUExportOp,
365   [SDNPHasChain, SDNPMayLoad, SDNPMayStore]>;
366
367
368 def R600ExportOp : SDTypeProfile<0, 7, [SDTCisFP<0>, SDTCisInt<1>]>;
369
370 def R600_EXPORT: SDNode<"AMDGPUISD::R600_EXPORT", R600ExportOp,
371   [SDNPHasChain, SDNPSideEffect]>;
372
373 //===----------------------------------------------------------------------===//
374 // Flow Control Profile Types
375 //===----------------------------------------------------------------------===//
376 // Branch instruction where second and third are basic blocks
377 def SDTIL_BRCond : SDTypeProfile<0, 2, [
378     SDTCisVT<0, OtherVT>
379     ]>;
380
381 //===----------------------------------------------------------------------===//
382 // Flow Control DAG Nodes
383 //===----------------------------------------------------------------------===//
384 def IL_brcond      : SDNode<"AMDGPUISD::BRANCH_COND", SDTIL_BRCond, [SDNPHasChain]>;
385
386 //===----------------------------------------------------------------------===//
387 // Call/Return DAG Nodes
388 //===----------------------------------------------------------------------===//
389 def AMDGPUendpgm : SDNode<"AMDGPUISD::ENDPGM", SDTNone,
390     [SDNPHasChain, SDNPOptInGlue]>;
391
392 def AMDGPUreturn_to_epilog : SDNode<"AMDGPUISD::RETURN_TO_EPILOG", SDTNone,
393     [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;
394
395 def AMDGPUret_flag : SDNode<"AMDGPUISD::RET_FLAG", SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>,
396   [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]
397 >;
398
399
400 //===----------------------------------------------------------------------===//
401 // Intrinsic/Custom node compatability PatFrags
402 //===----------------------------------------------------------------------===//
403
404 def AMDGPUrcp : PatFrags<(ops node:$src), [(int_amdgcn_rcp node:$src),
405                                            (AMDGPUrcp_impl node:$src)]>;
406 def AMDGPUrcp_legacy : PatFrags<(ops node:$src), [(int_amdgcn_rcp_legacy node:$src),
407                                                   (AMDGPUrcp_legacy_impl node:$src)]>;
408
409 def AMDGPUrsq_legacy : PatFrags<(ops node:$src), [(int_amdgcn_rsq_legacy node:$src),
410                                                   (AMDGPUrsq_legacy_impl node:$src)]>;
411
412 def AMDGPUrsq : PatFrags<(ops node:$src), [(int_amdgcn_rsq node:$src),
413                                            (AMDGPUrsq_impl node:$src)]>;
414
415 def AMDGPUrsq_clamp : PatFrags<(ops node:$src), [(int_amdgcn_rsq_clamp node:$src),
416                                                  (AMDGPUrsq_clamp_impl node:$src)]>;
417
418 def AMDGPUsin : PatFrags<(ops node:$src), [(int_amdgcn_sin node:$src),
419                                            (AMDGPUsin_impl node:$src)]>;
420 def AMDGPUcos : PatFrags<(ops node:$src), [(int_amdgcn_cos node:$src),
421                                            (AMDGPUcos_impl node:$src)]>;
422 def AMDGPUfract : PatFrags<(ops node:$src), [(int_amdgcn_fract node:$src),
423                                              (AMDGPUfract_impl node:$src)]>;
424
425 def AMDGPUldexp : PatFrags<(ops node:$src0, node:$src1),
426   [(int_amdgcn_ldexp node:$src0, node:$src1),
427    (AMDGPUldexp_impl node:$src0, node:$src1)]>;
428
429 def AMDGPUfp_class : PatFrags<(ops node:$src0, node:$src1),
430   [(int_amdgcn_class node:$src0, node:$src1),
431   (AMDGPUfp_class_impl node:$src0, node:$src1)]>;
432
433 def AMDGPUfmed3 : PatFrags<(ops node:$src0, node:$src1, node:$src2),
434   [(int_amdgcn_fmed3 node:$src0, node:$src1, node:$src2),
435    (AMDGPUfmed3_impl node:$src0, node:$src1, node:$src2)]>;
436
437 def AMDGPUffbh_i32 : PatFrags<(ops node:$src),
438   [(int_amdgcn_sffbh node:$src),
439    (AMDGPUffbh_i32_impl node:$src)]>;
440
441 def AMDGPUpkrtz_f16_f32 : PatFrags<(ops node:$src0, node:$src1),
442   [(int_amdgcn_cvt_pkrtz node:$src0, node:$src1),
443   (AMDGPUpkrtz_f16_f32_impl node:$src0, node:$src1)]>;
444
445 def AMDGPUpknorm_i16_f32 : PatFrags<(ops node:$src0, node:$src1),
446   [(int_amdgcn_cvt_pknorm_i16 node:$src0, node:$src1),
447   (AMDGPUpknorm_i16_f32_impl node:$src0, node:$src1)]>;
448
449 def AMDGPUpknorm_u16_f32 : PatFrags<(ops node:$src0, node:$src1),
450   [(int_amdgcn_cvt_pknorm_u16 node:$src0, node:$src1),
451   (AMDGPUpknorm_u16_f32_impl node:$src0, node:$src1)]>;
452
453 def AMDGPUpk_i16_i32 : PatFrags<(ops node:$src0, node:$src1),
454   [(int_amdgcn_cvt_pk_i16 node:$src0, node:$src1),
455   (AMDGPUpk_i16_i32_impl node:$src0, node:$src1)]>;
456
457 def AMDGPUpk_u16_u32 : PatFrags<(ops node:$src0, node:$src1),
458   [(int_amdgcn_cvt_pk_u16 node:$src0, node:$src1),
459   (AMDGPUpk_u16_u32_impl node:$src0, node:$src1)]>;