aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/R600/SIISelLowering.cpp
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2013-08-10 10:38:54 +0000
committerNiels Ole Salscheider <niels_ole@salscheider-online.de>2013-08-10 10:38:54 +0000
commit6e4dbcd1150ea6d4fbf87a7840b3d8481bfcc8c5 (patch)
treeb4f02ff2ec8575e2e7b0fd27cf307c57198f1540 /lib/Target/R600/SIISelLowering.cpp
parent4ab92e4d4bdf103f487b7383ca666ccc021c147a (diff)
downloadexternal_llvm-6e4dbcd1150ea6d4fbf87a7840b3d8481bfcc8c5.zip
external_llvm-6e4dbcd1150ea6d4fbf87a7840b3d8481bfcc8c5.tar.gz
external_llvm-6e4dbcd1150ea6d4fbf87a7840b3d8481bfcc8c5.tar.bz2
R600/SI: FMA is faster than fmul and fadd for f64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/SIISelLowering.cpp')
-rw-r--r--lib/Target/R600/SIISelLowering.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/R600/SIISelLowering.cpp b/lib/Target/R600/SIISelLowering.cpp
index b714fc1..a76e6ee 100644
--- a/lib/Target/R600/SIISelLowering.cpp
+++ b/lib/Target/R600/SIISelLowering.cpp
@@ -338,6 +338,24 @@ MVT SITargetLowering::getScalarShiftAmountTy(EVT VT) const {
return MVT::i32;
}
+bool SITargetLowering::isFMAFasterThanFMulAndFAdd(EVT VT) const {
+ VT = VT.getScalarType();
+
+ if (!VT.isSimple())
+ return false;
+
+ switch (VT.getSimpleVT().SimpleTy) {
+ case MVT::f32:
+ return false; /* There is V_MAD_F32 for f32 */
+ case MVT::f64:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// Custom DAG Lowering Operations
//===----------------------------------------------------------------------===//