[PATCH] D26711: [AMDGPU] Refactor v_mac_{f16, f32} patterns into a class NFC
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 19:49:12 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL287077: [AMDGPU] Refactor v_mac_{f16, f32} patterns into a class NFC (authored by kzhuravl).
Changed prior to commit:
https://reviews.llvm.org/D26711?vs=78090&id=78132#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26711
Files:
llvm/trunk/lib/Target/AMDGPU/SIInstructions.td
Index: llvm/trunk/lib/Target/AMDGPU/SIInstructions.td
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstructions.td
+++ llvm/trunk/lib/Target/AMDGPU/SIInstructions.td
@@ -468,41 +468,36 @@
// VOP2 Patterns
//===----------------------------------------------------------------------===//
-multiclass SelectPat<ValueType vt, Instruction inst> {
+multiclass FMADPat <ValueType vt, Instruction inst> {
+ def : Pat <
+ (vt (fmad (VOP3NoMods0 vt:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod),
+ (VOP3NoMods vt:$src1, i32:$src1_modifiers),
+ (VOP3NoMods vt:$src2, i32:$src2_modifiers))),
+ (inst $src0_modifiers, $src0, $src1_modifiers, $src1,
+ $src2_modifiers, $src2, $clamp, $omod)
+ >;
+}
+
+defm : FMADPat <f16, V_MAC_F16_e64>;
+defm : FMADPat <f32, V_MAC_F32_e64>;
+
+multiclass SelectPat <ValueType vt, Instruction inst> {
def : Pat <
(vt (select i1:$src0, vt:$src1, vt:$src2)),
(inst $src2, $src1, $src0)
>;
}
-defm : SelectPat<i16, V_CNDMASK_B32_e64>;
-defm : SelectPat<i32, V_CNDMASK_B32_e64>;
-defm : SelectPat<f16, V_CNDMASK_B32_e64>;
-defm : SelectPat<f32, V_CNDMASK_B32_e64>;
+defm : SelectPat <i16, V_CNDMASK_B32_e64>;
+defm : SelectPat <i32, V_CNDMASK_B32_e64>;
+defm : SelectPat <f16, V_CNDMASK_B32_e64>;
+defm : SelectPat <f32, V_CNDMASK_B32_e64>;
def : Pat <
(i32 (add (i32 (ctpop i32:$popcnt)), i32:$val)),
(V_BCNT_U32_B32_e64 $popcnt, $val)
>;
-// Pattern for V_MAC_F16
-def : Pat <
- (f16 (fmad (VOP3NoMods0 f16:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod),
- (VOP3NoMods f16:$src1, i32:$src1_modifiers),
- (VOP3NoMods f16:$src2, i32:$src2_modifiers))),
- (V_MAC_F16_e64 $src0_modifiers, $src0, $src1_modifiers, $src1,
- $src2_modifiers, $src2, $clamp, $omod)
->;
-
-// Pattern for V_MAC_F32
-def : Pat <
- (f32 (fmad (VOP3NoMods0 f32:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod),
- (VOP3NoMods f32:$src1, i32:$src1_modifiers),
- (VOP3NoMods f32:$src2, i32:$src2_modifiers))),
- (V_MAC_F32_e64 $src0_modifiers, $src0, $src1_modifiers, $src1,
- $src2_modifiers, $src2, $clamp, $omod)
->;
-
/********** ============================================ **********/
/********** Extraction, Insertion, Building and Casting **********/
/********** ============================================ **********/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26711.78132.patch
Type: text/x-patch
Size: 2453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161116/03d68a2b/attachment.bin>
More information about the llvm-commits
mailing list