1 //===-- AMDGPUInstructions.td - Common instruction defs ---*- tablegen -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file contains instruction defs that are common to all hw codegen
12 //===----------------------------------------------------------------------===//
14 class AddressSpacesImpl {
23 def AddrSpaces : AddressSpacesImpl;
26 class AMDGPUInst <dag outs, dag ins, string asm = "",
27 list<dag> pattern = []> : Instruction {
28 field bit isRegisterLoad = 0;
29 field bit isRegisterStore = 0;
31 let Namespace = "AMDGPU";
32 let OutOperandList = outs;
33 let InOperandList = ins;
35 let Pattern = pattern;
36 let Itinerary = NullALU;
38 // SoftFail is a field the disassembler can use to provide a way for
39 // instructions to not match without killing the whole decode process. It is
40 // mainly used for ARM, but Tablegen expects this field to exist or it fails
41 // to build the decode table.
42 field bits<64> SoftFail = 0;
44 let DecoderNamespace = Namespace;
46 let TSFlags{63} = isRegisterLoad;
47 let TSFlags{62} = isRegisterStore;
50 class AMDGPUShaderInst <dag outs, dag ins, string asm = "",
51 list<dag> pattern = []> : AMDGPUInst<outs, ins, asm, pattern> {
53 field bits<32> Inst = 0xffffffff;
56 //===---------------------------------------------------------------------===//
58 //===---------------------------------------------------------------------===//
60 class ILFormat<dag outs, dag ins, string asmstr, list<dag> pattern>
63 let Namespace = "AMDGPU";
64 dag OutOperandList = outs;
65 dag InOperandList = ins;
66 let Pattern = pattern;
67 let AsmString = !strconcat(asmstr, "\n");
69 let Itinerary = NullALU;
71 bit hasZeroOpFlag = 0;
74 let hasSideEffects = 0;
75 let isCodeGenOnly = 1;
78 def TruePredicate : Predicate<"">;
80 // FIXME: Tablegen should specially supports this
81 def FalsePredicate : Predicate<"false">;
83 // Add a predicate to the list if does not already exist to deduplicate it.
84 class PredConcat<list<Predicate> lst, Predicate pred> {
86 !listconcat([pred], !filter(item, lst, !ne(item, pred)));
89 class PredicateControl {
90 Predicate SubtargetPredicate = TruePredicate;
91 Predicate AssemblerPredicate = TruePredicate;
92 Predicate WaveSizePredicate = TruePredicate;
93 list<Predicate> OtherPredicates = [];
94 list<Predicate> Predicates = PredConcat<
95 PredConcat<PredConcat<OtherPredicates,
96 SubtargetPredicate>.ret,
97 AssemblerPredicate>.ret,
98 WaveSizePredicate>.ret;
101 class AMDGPUPat<dag pattern, dag result> : Pat<pattern, result>,
104 let RecomputePerFunction = 1 in {
105 def FP16Denormals : Predicate<"MF->getInfo<SIMachineFunctionInfo>()->getMode().allFP64FP16Denormals()">;
106 def FP32Denormals : Predicate<"MF->getInfo<SIMachineFunctionInfo>()->getMode().allFP32Denormals()">;
107 def FP64Denormals : Predicate<"MF->getInfo<SIMachineFunctionInfo>()->getMode().allFP64FP16Denormals()">;
108 def NoFP16Denormals : Predicate<"!MF->getInfo<SIMachineFunctionInfo>()->getMode().allFP64FP16Denormals()">;
109 def NoFP32Denormals : Predicate<"!MF->getInfo<SIMachineFunctionInfo>()->getMode().allFP32Denormals()">;
110 def NoFP64Denormals : Predicate<"!MF->getInfo<SIMachineFunctionInfo>()->getMode().allFP64FP16Denormals()">;
111 def UnsafeFPMath : Predicate<"TM.Options.UnsafeFPMath">;
114 def FMA : Predicate<"Subtarget->hasFMA()">;
116 def InstFlag : OperandWithDefaultOps <i32, (ops (i32 0))>;
118 def u16ImmTarget : AsmOperandClass {
120 let RenderMethod = "addImmOperands";
123 def s16ImmTarget : AsmOperandClass {
125 let RenderMethod = "addImmOperands";
128 let OperandType = "OPERAND_IMMEDIATE" in {
130 def u32imm : Operand<i32> {
131 let PrintMethod = "printU32ImmOperand";
134 def u16imm : Operand<i16> {
135 let PrintMethod = "printU16ImmOperand";
136 let ParserMatchClass = u16ImmTarget;
139 def s16imm : Operand<i16> {
140 let PrintMethod = "printU16ImmOperand";
141 let ParserMatchClass = s16ImmTarget;
144 def u8imm : Operand<i8> {
145 let PrintMethod = "printU8ImmOperand";
148 } // End OperandType = "OPERAND_IMMEDIATE"
150 //===--------------------------------------------------------------------===//
152 //===--------------------------------------------------------------------===//
153 def brtarget : Operand<OtherVT>;
155 //===----------------------------------------------------------------------===//
157 //===----------------------------------------------------------------------===//
159 class HasOneUseUnaryOp<SDPatternOperator op> : PatFrag<
162 [{ return N->hasOneUse(); }]> {
164 let GISelPredicateCode = [{
165 return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
169 class HasOneUseBinOp<SDPatternOperator op> : PatFrag<
170 (ops node:$src0, node:$src1),
172 [{ return N->hasOneUse(); }]> {
173 let GISelPredicateCode = [{
174 return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
178 class HasOneUseTernaryOp<SDPatternOperator op> : PatFrag<
179 (ops node:$src0, node:$src1, node:$src2),
180 (op $src0, $src1, $src2),
181 [{ return N->hasOneUse(); }]> {
182 let GISelPredicateCode = [{
183 return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
187 class is_canonicalized<SDPatternOperator op> : PatFrag<
188 (ops node:$src0, node:$src1),
191 const SITargetLowering &Lowering =
192 *static_cast<const SITargetLowering *>(getTargetLowering());
194 return Lowering.isCanonicalized(*CurDAG, N->getOperand(0)) &&
195 Lowering.isCanonicalized(*CurDAG, N->getOperand(1));
198 // TODO: Improve the Legalizer for g_build_vector in Global Isel to match this class
199 let GISelPredicateCode = [{
200 const SITargetLowering *TLI = static_cast<const SITargetLowering *>(
201 MF.getSubtarget().getTargetLowering());
203 return TLI->isCanonicalized(MI.getOperand(1).getReg(), const_cast<MachineFunction&>(MF)) &&
204 TLI->isCanonicalized(MI.getOperand(2).getReg(), const_cast<MachineFunction&>(MF));
209 let Properties = [SDNPCommutative, SDNPAssociative] in {
210 def smax_oneuse : HasOneUseBinOp<smax>;
211 def smin_oneuse : HasOneUseBinOp<smin>;
212 def umax_oneuse : HasOneUseBinOp<umax>;
213 def umin_oneuse : HasOneUseBinOp<umin>;
215 def fminnum_oneuse : HasOneUseBinOp<fminnum>;
216 def fmaxnum_oneuse : HasOneUseBinOp<fmaxnum>;
218 def fminnum_ieee_oneuse : HasOneUseBinOp<fminnum_ieee>;
219 def fmaxnum_ieee_oneuse : HasOneUseBinOp<fmaxnum_ieee>;
222 def and_oneuse : HasOneUseBinOp<and>;
223 def or_oneuse : HasOneUseBinOp<or>;
224 def xor_oneuse : HasOneUseBinOp<xor>;
225 } // Properties = [SDNPCommutative, SDNPAssociative]
227 def not_oneuse : HasOneUseUnaryOp<not>;
229 def add_oneuse : HasOneUseBinOp<add>;
230 def sub_oneuse : HasOneUseBinOp<sub>;
232 def srl_oneuse : HasOneUseBinOp<srl>;
233 def shl_oneuse : HasOneUseBinOp<shl>;
235 def select_oneuse : HasOneUseTernaryOp<select>;
237 def AMDGPUmul_u24_oneuse : HasOneUseBinOp<AMDGPUmul_u24>;
238 def AMDGPUmul_i24_oneuse : HasOneUseBinOp<AMDGPUmul_i24>;
240 def srl_16 : PatFrag<
241 (ops node:$src0), (srl_oneuse node:$src0, (i32 16))
245 def hi_i16_elt : PatFrag<
246 (ops node:$src0), (i16 (trunc (i32 (srl_16 node:$src0))))
250 def hi_f16_elt : PatLeaf<
252 if (N->getOpcode() != ISD::BITCAST)
254 SDValue Tmp = N->getOperand(0);
256 if (Tmp.getOpcode() != ISD::SRL)
258 if (const auto *RHS = dyn_cast<ConstantSDNode>(Tmp.getOperand(1))
259 return RHS->getZExtValue() == 16;
263 //===----------------------------------------------------------------------===//
264 // PatLeafs for floating-point comparisons
265 //===----------------------------------------------------------------------===//
267 def COND_OEQ : PatFrags<(ops), [(OtherVT SETOEQ), (OtherVT SETEQ)]>;
268 def COND_ONE : PatFrags<(ops), [(OtherVT SETONE), (OtherVT SETNE)]>;
269 def COND_OGT : PatFrags<(ops), [(OtherVT SETOGT), (OtherVT SETGT)]>;
270 def COND_OGE : PatFrags<(ops), [(OtherVT SETOGE), (OtherVT SETGE)]>;
271 def COND_OLT : PatFrags<(ops), [(OtherVT SETOLT), (OtherVT SETLT)]>;
272 def COND_OLE : PatFrags<(ops), [(OtherVT SETOLE), (OtherVT SETLE)]>;
273 def COND_O : PatFrags<(ops), [(OtherVT SETO)]>;
274 def COND_UO : PatFrags<(ops), [(OtherVT SETUO)]>;
276 //===----------------------------------------------------------------------===//
277 // PatLeafs for unsigned / unordered comparisons
278 //===----------------------------------------------------------------------===//
280 def COND_UEQ : PatFrag<(ops), (OtherVT SETUEQ)>;
281 def COND_UNE : PatFrag<(ops), (OtherVT SETUNE)>;
282 def COND_UGT : PatFrag<(ops), (OtherVT SETUGT)>;
283 def COND_UGE : PatFrag<(ops), (OtherVT SETUGE)>;
284 def COND_ULT : PatFrag<(ops), (OtherVT SETULT)>;
285 def COND_ULE : PatFrag<(ops), (OtherVT SETULE)>;
287 // XXX - For some reason R600 version is preferring to use unordered
289 def COND_UNE_NE : PatFrags<(ops), [(OtherVT SETUNE), (OtherVT SETNE)]>;
291 //===----------------------------------------------------------------------===//
292 // PatLeafs for signed comparisons
293 //===----------------------------------------------------------------------===//
295 def COND_SGT : PatFrag<(ops), (OtherVT SETGT)>;
296 def COND_SGE : PatFrag<(ops), (OtherVT SETGE)>;
297 def COND_SLT : PatFrag<(ops), (OtherVT SETLT)>;
298 def COND_SLE : PatFrag<(ops), (OtherVT SETLE)>;
300 //===----------------------------------------------------------------------===//
301 // PatLeafs for integer equality
302 //===----------------------------------------------------------------------===//
304 def COND_EQ : PatFrags<(ops), [(OtherVT SETEQ), (OtherVT SETUEQ)]>;
305 def COND_NE : PatFrags<(ops), [(OtherVT SETNE), (OtherVT SETUNE)]>;
307 // FIXME: Should not need code predicate
308 //def COND_NULL : PatLeaf<(OtherVT null_frag)>;
309 def COND_NULL : PatLeaf <
311 [{(void)N; return false;}]
314 //===----------------------------------------------------------------------===//
315 // PatLeafs for Texture Constants
316 //===----------------------------------------------------------------------===//
318 def TEX_ARRAY : PatLeaf<
320 [{uint32_t TType = (uint32_t)N->getZExtValue();
321 return TType == 9 || TType == 10 || TType == 16;
325 def TEX_RECT : PatLeaf<
327 [{uint32_t TType = (uint32_t)N->getZExtValue();
332 def TEX_SHADOW : PatLeaf<
334 [{uint32_t TType = (uint32_t)N->getZExtValue();
335 return (TType >= 6 && TType <= 8) || TType == 13;
339 def TEX_SHADOW_ARRAY : PatLeaf<
341 [{uint32_t TType = (uint32_t)N->getZExtValue();
342 return TType == 11 || TType == 12 || TType == 17;
346 //===----------------------------------------------------------------------===//
347 // Load/Store Pattern Fragments
348 //===----------------------------------------------------------------------===//
350 def atomic_cmp_swap_glue : SDNode <"ISD::ATOMIC_CMP_SWAP", SDTAtomic3,
351 [SDNPHasChain, SDNPMayStore, SDNPMayLoad, SDNPMemOperand, SDNPInGlue]
354 class AddressSpaceList<list<int> AS> {
355 list<int> AddrSpaces = AS;
358 class Aligned<int Bytes> {
359 int MinAlignment = Bytes;
362 class StoreHi16<SDPatternOperator op> : PatFrag <
363 (ops node:$value, node:$ptr), (op (srl node:$value, (i32 16)), node:$ptr)> {
367 def LoadAddress_constant : AddressSpaceList<[ AddrSpaces.Constant ]>;
368 def LoadAddress_global : AddressSpaceList<[ AddrSpaces.Global, AddrSpaces.Constant ]>;
369 def StoreAddress_global : AddressSpaceList<[ AddrSpaces.Global ]>;
371 def LoadAddress_flat : AddressSpaceList<[ AddrSpaces.Flat,
373 AddrSpaces.Constant ]>;
374 def StoreAddress_flat : AddressSpaceList<[ AddrSpaces.Flat, AddrSpaces.Global ]>;
376 def LoadAddress_private : AddressSpaceList<[ AddrSpaces.Private ]>;
377 def StoreAddress_private : AddressSpaceList<[ AddrSpaces.Private ]>;
379 def LoadAddress_local : AddressSpaceList<[ AddrSpaces.Local ]>;
380 def StoreAddress_local : AddressSpaceList<[ AddrSpaces.Local ]>;
382 def LoadAddress_region : AddressSpaceList<[ AddrSpaces.Region ]>;
383 def StoreAddress_region : AddressSpaceList<[ AddrSpaces.Region ]>;
387 foreach as = [ "global", "flat", "constant", "local", "private", "region" ] in {
388 let AddressSpaces = !cast<AddressSpaceList>("LoadAddress_"#as).AddrSpaces in {
390 def load_#as : PatFrag<(ops node:$ptr), (unindexedload node:$ptr)> {
392 let IsNonExtLoad = 1;
395 def extloadi8_#as : PatFrag<(ops node:$ptr), (extload node:$ptr)> {
400 def extloadi16_#as : PatFrag<(ops node:$ptr), (extload node:$ptr)> {
405 def sextloadi8_#as : PatFrag<(ops node:$ptr), (sextload node:$ptr)> {
410 def sextloadi16_#as : PatFrag<(ops node:$ptr), (sextload node:$ptr)> {
415 def zextloadi8_#as : PatFrag<(ops node:$ptr), (zextload node:$ptr)> {
420 def zextloadi16_#as : PatFrag<(ops node:$ptr), (zextload node:$ptr)> {
425 def atomic_load_32_#as : PatFrag<(ops node:$ptr), (atomic_load_32 node:$ptr)> {
430 def atomic_load_64_#as : PatFrag<(ops node:$ptr), (atomic_load_64 node:$ptr)> {
434 } // End let AddressSpaces
438 foreach as = [ "global", "flat", "local", "private", "region" ] in {
439 let AddressSpaces = !cast<AddressSpaceList>("StoreAddress_"#as).AddrSpaces in {
440 def store_#as : PatFrag<(ops node:$val, node:$ptr),
441 (unindexedstore node:$val, node:$ptr)> {
443 let IsTruncStore = 0;
446 // truncstore fragments.
447 def truncstore_#as : PatFrag<(ops node:$val, node:$ptr),
448 (unindexedstore node:$val, node:$ptr)> {
450 let IsTruncStore = 1;
453 // TODO: We don't really need the truncstore here. We can use
454 // unindexedstore with MemoryVT directly, which will save an
455 // unnecessary check that the memory size is less than the value type
456 // in the generated matcher table.
457 def truncstorei8_#as : PatFrag<(ops node:$val, node:$ptr),
458 (truncstore node:$val, node:$ptr)> {
463 def truncstorei16_#as : PatFrag<(ops node:$val, node:$ptr),
464 (truncstore node:$val, node:$ptr)> {
469 def store_hi16_#as : StoreHi16 <truncstorei16>;
470 def truncstorei8_hi16_#as : StoreHi16<truncstorei8>;
471 def truncstorei16_hi16_#as : StoreHi16<truncstorei16>;
473 defm atomic_store_#as : binary_atomic_op<atomic_store>;
475 } // End let AddressSpaces
479 multiclass ret_noret_binary_atomic_op<SDNode atomic_op, bit IsInt = 1> {
480 foreach as = [ "global", "flat", "constant", "local", "private", "region" ] in {
481 let AddressSpaces = !cast<AddressSpaceList>("LoadAddress_"#as).AddrSpaces in {
482 defm "_"#as : binary_atomic_op<atomic_op, IsInt>;
484 let PredicateCode = [{return (SDValue(N, 0).use_empty());}] in {
485 defm "_"#as#"_noret" : binary_atomic_op<atomic_op, IsInt>;
488 let PredicateCode = [{return !(SDValue(N, 0).use_empty());}] in {
489 defm "_"#as#"_ret" : binary_atomic_op<atomic_op, IsInt>;
495 defm atomic_swap : ret_noret_binary_atomic_op<atomic_swap>;
496 defm atomic_load_add : ret_noret_binary_atomic_op<atomic_load_add>;
497 defm atomic_load_and : ret_noret_binary_atomic_op<atomic_load_and>;
498 defm atomic_load_max : ret_noret_binary_atomic_op<atomic_load_max>;
499 defm atomic_load_min : ret_noret_binary_atomic_op<atomic_load_min>;
500 defm atomic_load_or : ret_noret_binary_atomic_op<atomic_load_or>;
501 defm atomic_load_sub : ret_noret_binary_atomic_op<atomic_load_sub>;
502 defm atomic_load_umax : ret_noret_binary_atomic_op<atomic_load_umax>;
503 defm atomic_load_umin : ret_noret_binary_atomic_op<atomic_load_umin>;
504 defm atomic_load_xor : ret_noret_binary_atomic_op<atomic_load_xor>;
505 defm atomic_load_fadd : ret_noret_binary_atomic_op<atomic_load_fadd, 0>;
506 let MemoryVT = v2f16 in
507 defm atomic_load_fadd_v2f16 : ret_noret_binary_atomic_op<atomic_load_fadd, 0>;
508 defm AMDGPUatomic_cmp_swap : ret_noret_binary_atomic_op<AMDGPUatomic_cmp_swap>;
510 def load_align8_local : PatFrag<(ops node:$ptr), (load_local node:$ptr)>,
513 let IsNonExtLoad = 1;
516 def load_align16_local : PatFrag<(ops node:$ptr), (load_local node:$ptr)>,
519 let IsNonExtLoad = 1;
522 def store_align8_local: PatFrag<(ops node:$val, node:$ptr),
523 (store_local node:$val, node:$ptr)>, Aligned<8> {
525 let IsTruncStore = 0;
528 def store_align16_local: PatFrag<(ops node:$val, node:$ptr),
529 (store_local node:$val, node:$ptr)>, Aligned<16> {
531 let IsTruncStore = 0;
534 let AddressSpaces = StoreAddress_local.AddrSpaces in {
535 defm atomic_cmp_swap_local : ternary_atomic_op<atomic_cmp_swap>;
536 defm atomic_cmp_swap_local_m0 : ternary_atomic_op<atomic_cmp_swap_glue>;
539 let AddressSpaces = StoreAddress_region.AddrSpaces in {
540 defm atomic_cmp_swap_region : ternary_atomic_op<atomic_cmp_swap>;
541 defm atomic_cmp_swap_region_m0 : ternary_atomic_op<atomic_cmp_swap_glue>;
544 //===----------------------------------------------------------------------===//
545 // Misc Pattern Fragments
546 //===----------------------------------------------------------------------===//
549 int TWO_PI = 0x40c90fdb;
551 int TWO_PI_INV = 0x3e22f983;
552 int FP_4294966784 = 0x4f7ffffe; // 4294966784 = 4294967296 - 512 = 2^32 - 2^9
553 int FP16_ONE = 0x3C00;
554 int FP16_NEG_ONE = 0xBC00;
555 int FP32_ONE = 0x3f800000;
556 int FP32_NEG_ONE = 0xbf800000;
557 int FP64_ONE = 0x3ff0000000000000;
558 int FP64_NEG_ONE = 0xbff0000000000000;
560 def CONST : Constants;
562 def FP_ZERO : PatLeaf <
564 [{return N->getValueAPF().isZero();}]
567 def FP_ONE : PatLeaf <
569 [{return N->isExactlyValue(1.0);}]
572 def FP_HALF : PatLeaf <
574 [{return N->isExactlyValue(0.5);}]
577 /* Generic helper patterns for intrinsics */
578 /* -------------------------------------- */
580 class POW_Common <AMDGPUInst log_ieee, AMDGPUInst exp_ieee, AMDGPUInst mul>
582 (fpow f32:$src0, f32:$src1),
583 (exp_ieee (mul f32:$src1, (log_ieee f32:$src0)))
586 /* Other helper patterns */
587 /* --------------------- */
589 /* Extract element pattern */
590 class Extract_Element <ValueType sub_type, ValueType vec_type, int sub_idx,
593 (sub_type (extractelt vec_type:$src, sub_idx)),
594 (EXTRACT_SUBREG $src, sub_reg)
597 /* Insert element pattern */
598 class Insert_Element <ValueType elem_type, ValueType vec_type,
599 int sub_idx, SubRegIndex sub_reg>
601 (insertelt vec_type:$vec, elem_type:$elem, sub_idx),
602 (INSERT_SUBREG $vec, $elem, sub_reg)
605 // XXX: Convert to new syntax and use COPY_TO_REG, once the DFAPacketizer
606 // can handle COPY instructions.
607 // bitconvert pattern
608 class BitConvert <ValueType dt, ValueType st, RegisterClass rc> : AMDGPUPat <
609 (dt (bitconvert (st rc:$src0))),
613 // XXX: Convert to new syntax and use COPY_TO_REG, once the DFAPacketizer
614 // can handle COPY instructions.
615 class DwordAddrPat<ValueType vt, RegisterClass rc> : AMDGPUPat <
616 (vt (AMDGPUdwordaddr (vt rc:$addr))),
621 class ROTRPattern <Instruction BIT_ALIGN> : AMDGPUPat <
622 (rotr i32:$src0, i32:$src1),
623 (BIT_ALIGN $src0, $src0, $src1)
626 // Special conversion patterns
628 def cvt_rpi_i32_f32 : PatFrag <
630 (fp_to_sint (ffloor (fadd $src, FP_HALF))),
631 [{ (void) N; return TM.Options.NoNaNsFPMath; }]
634 def cvt_flr_i32_f32 : PatFrag <
636 (fp_to_sint (ffloor $src)),
637 [{ (void)N; return TM.Options.NoNaNsFPMath; }]
640 let AddedComplexity = 2 in {
641 class IMad24Pat<Instruction Inst, bit HasClamp = 0> : AMDGPUPat <
642 (add (AMDGPUmul_i24 i32:$src0, i32:$src1), i32:$src2),
643 !if(HasClamp, (Inst $src0, $src1, $src2, (i1 0)),
644 (Inst $src0, $src1, $src2))
647 class UMad24Pat<Instruction Inst, bit HasClamp = 0> : AMDGPUPat <
648 (add (AMDGPUmul_u24 i32:$src0, i32:$src1), i32:$src2),
649 !if(HasClamp, (Inst $src0, $src1, $src2, (i1 0)),
650 (Inst $src0, $src1, $src2))
652 } // AddedComplexity.
654 class RcpPat<Instruction RcpInst, ValueType vt> : AMDGPUPat <
655 (fdiv FP_ONE, vt:$src),
659 class RsqPat<Instruction RsqInst, ValueType vt> : AMDGPUPat <
660 (AMDGPUrcp (fsqrt vt:$src)),
664 // Instructions which select to the same v_min_f*
665 def fminnum_like : PatFrags<(ops node:$src0, node:$src1),
666 [(fminnum_ieee node:$src0, node:$src1),
667 (fminnum node:$src0, node:$src1)]
670 // Instructions which select to the same v_max_f*
671 def fmaxnum_like : PatFrags<(ops node:$src0, node:$src1),
672 [(fmaxnum_ieee node:$src0, node:$src1),
673 (fmaxnum node:$src0, node:$src1)]
676 def fminnum_like_oneuse : PatFrags<(ops node:$src0, node:$src1),
677 [(fminnum_ieee_oneuse node:$src0, node:$src1),
678 (fminnum_oneuse node:$src0, node:$src1)]
681 def fmaxnum_like_oneuse : PatFrags<(ops node:$src0, node:$src1),
682 [(fmaxnum_ieee_oneuse node:$src0, node:$src1),
683 (fmaxnum_oneuse node:$src0, node:$src1)]
686 def any_fmad : PatFrags<(ops node:$src0, node:$src1, node:$src2),
687 [(fmad node:$src0, node:$src1, node:$src2),
688 (AMDGPUfmad_ftz node:$src0, node:$src1, node:$src2)]
691 // FIXME: fsqrt should not select directly
692 def any_amdgcn_sqrt : PatFrags<(ops node:$src0),
693 [(fsqrt node:$src0), (int_amdgcn_sqrt node:$src0)]