diff options
| author | Tim Northover <tnorthover@apple.com> | 2014-04-15 14:00:06 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2014-04-15 14:00:06 +0000 |
| commit | 221b583951edb9d6da21ba8caaabc247f5f622f5 (patch) | |
| tree | 12c489fa2968a8a975b3eef9eaf8c518aafe1b62 /llvm/lib | |
| parent | b37cff1ae2f76c430ee765c415cf1d4570c50e36 (diff) | |
| download | bcm5719-llvm-221b583951edb9d6da21ba8caaabc247f5f622f5.tar.gz bcm5719-llvm-221b583951edb9d6da21ba8caaabc247f5f622f5.zip | |
AArch64/ARM64: add patterns for various commutations of FNMADD.
llvm-svn: 206287
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM64/ARM64InstrInfo.td | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64InstrInfo.td b/llvm/lib/Target/ARM64/ARM64InstrInfo.td index 29783409363..805dbd169e2 100644 --- a/llvm/lib/Target/ARM64/ARM64InstrInfo.td +++ b/llvm/lib/Target/ARM64/ARM64InstrInfo.td @@ -2033,6 +2033,20 @@ def : Pat<(f32 (fma (fneg FPR32:$Rn), FPR32:$Rm, FPR32:$Ra)), def : Pat<(f64 (fma (fneg FPR64:$Rn), FPR64:$Rm, FPR64:$Ra)), (FMSUBDrrr FPR64:$Rn, FPR64:$Rm, FPR64:$Ra)>; +// We handled -(a + b*c) for FNMADD above, now it's time for "(-a) + (-b)*c" and +// "(-a) + b*(-c)". +def : Pat<(f32 (fma (fneg FPR32:$Rn), FPR32:$Rm, (fneg FPR32:$Ra))), + (FNMADDSrrr FPR32:$Rn, FPR32:$Rm, FPR32:$Ra)>; + +def : Pat<(f64 (fma (fneg FPR64:$Rn), FPR64:$Rm, (fneg FPR64:$Ra))), + (FNMADDDrrr FPR64:$Rn, FPR64:$Rm, FPR64:$Ra)>; + +def : Pat<(f32 (fma FPR32:$Rn, (fneg FPR32:$Rm), (fneg FPR32:$Ra))), + (FNMADDSrrr FPR32:$Rn, FPR32:$Rm, FPR32:$Ra)>; + +def : Pat<(f64 (fma FPR64:$Rn, (fneg FPR64:$Rm), (fneg FPR64:$Ra))), + (FNMADDDrrr FPR64:$Rn, FPR64:$Rm, FPR64:$Ra)>; + //===----------------------------------------------------------------------===// // Floating point comparison instructions. //===----------------------------------------------------------------------===// |

