diff options
author | Lang Hames <lhames@gmail.com> | 2012-06-05 19:07:46 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2012-06-05 19:07:46 +0000 |
commit | 5afba6f00c3e2eef83aebbcff5fcfca2fa3c978e (patch) | |
tree | 85237683e44818f3491c303395729dcccfeeef70 /include/llvm/Target | |
parent | 09b5df8996b37e61369026d50b44713984adbdc4 (diff) | |
download | external_llvm-5afba6f00c3e2eef83aebbcff5fcfca2fa3c978e.zip external_llvm-5afba6f00c3e2eef83aebbcff5fcfca2fa3c978e.tar.gz external_llvm-5afba6f00c3e2eef83aebbcff5fcfca2fa3c978e.tar.bz2 |
Add a new intrinsic: llvm.fmuladd. This intrinsic represents a multiply-add
expression (a * b + c) that can be implemented as a fused multiply-add (fma)
if the target determines that this will be more efficient. This intrinsic
will be used to implement FP_CONTRACT support and an aggressive FMA formation
mode.
If your target has a fast FMA instruction you should override the
isFMAFasterThanMulAndAdd method in TargetLowering to return true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 27447b5..915dd9d 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -1657,6 +1657,14 @@ public: return false; } + /// isFMAFasterThanMulAndAdd - Return true if an FMA operation is faster than + /// a pair of mul and add instructions. fmuladd intrinsics will be expanded to + /// FMAs when this method returns true (and FMAs are legal), otherwise fmuladd + /// is expanded to mul + add. + virtual bool isFMAFasterThanMulAndAdd(EVT) const { + return false; + } + /// isNarrowingProfitable - Return true if it's profitable to narrow /// operations of type VT1 to VT2. e.g. on x86, it's profitable to narrow /// from i32 to i8 but not from i32 to i16. |