From e4b618965882a492453b6ec2f84d8b85de83d113 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 21 Aug 2012 05:56:45 +0000 Subject: Merge FMA3 instructions with and without patterns into single classes using null_frag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162257 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrFMA.td | 59 +++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 38 deletions(-) (limited to 'lib') diff --git a/lib/Target/X86/X86InstrFMA.td b/lib/Target/X86/X86InstrFMA.td index 43d8fd6..cdabc41 100644 --- a/lib/Target/X86/X86InstrFMA.td +++ b/lib/Target/X86/X86InstrFMA.td @@ -16,60 +16,39 @@ //===----------------------------------------------------------------------===// let Constraints = "$src1 = $dst" in { -multiclass fma3p_rm opc, string OpcodeStr> { -let neverHasSideEffects = 1 in { - def r : FMA3; - let mayLoad = 1 in - def m : FMA3; - def rY : FMA3; - let mayLoad = 1 in - def mY : FMA3; -} // neverHasSideEffects = 1 -} - -// Intrinsic for 213 pattern -multiclass fma3p_rm_int opc, string OpcodeStr, - PatFrag MemFrag128, PatFrag MemFrag256, - SDNode Op213, ValueType OpVT128, ValueType OpVT256> { +multiclass fma3p_rm opc, string OpcodeStr, + PatFrag MemFrag128, PatFrag MemFrag256, + ValueType OpVT128, ValueType OpVT256, + SDPatternOperator Op = null_frag, bit MayLoad = 1> { def r : FMA3; + let mayLoad = MayLoad in def m : FMA3; def rY : FMA3; + let mayLoad = MayLoad in def mY : FMA3; } } // Constraints = "$src1 = $dst" @@ -78,13 +57,17 @@ multiclass fma3p_forms opc132, bits<8> opc213, bits<8> opc231, string OpcodeStr, string PackTy, PatFrag MemFrag128, PatFrag MemFrag256, SDNode Op, ValueType OpTy128, ValueType OpTy256> { - defm r213 : fma3p_rm_int ; - defm r132 : fma3p_rm ; - defm r231 : fma3p_rm ; + defm r213 : fma3p_rm; +let neverHasSideEffects = 1 in { + defm r132 : fma3p_rm; + defm r231 : fma3p_rm; +} // neverHasSideEffects = 1 } // Fused Multiply-Add -- cgit v1.1