aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-07-08 21:39:21 +0000
committerCameron Zwarich <zwarich@apple.com>2011-07-08 21:39:21 +0000
commitf03fa189ca73a664fb10cf1bc8447d8453edf810 (patch)
treee0eed8377e924c9f1a203f2999cc9df109454645 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent964cb5feb0885460c50ac4c0962d108cb193ba1e (diff)
downloadllvm-f03fa189ca73a664fb10cf1bc8447d8453edf810.zip
llvm-f03fa189ca73a664fb10cf1bc8447d8453edf810.tar.gz
llvm-f03fa189ca73a664fb10cf1bc8447d8453edf810.tar.bz2
Add an intrinsic and codegen support for fused multiply-accumulate. The intent
is to use this for architectures that have a native FMA instruction. llvm-svn: 134742
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 2afec33..3c8b04f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4651,6 +4651,13 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
case Intrinsic::pow:
visitPow(I);
return 0;
+ case Intrinsic::fma:
+ setValue(&I, DAG.getNode(ISD::FMA, dl,
+ getValue(I.getArgOperand(0)).getValueType(),
+ getValue(I.getArgOperand(0)),
+ getValue(I.getArgOperand(1)),
+ getValue(I.getArgOperand(2))));
+ return 0;
case Intrinsic::convert_to_fp16:
setValue(&I, DAG.getNode(ISD::FP32_TO_FP16, dl,
MVT::i16, getValue(I.getArgOperand(0))));