summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/NVPTX
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2017-01-19 00:14:45 +0000
committerArtem Belevich <tra@google.com>2017-01-19 00:14:45 +0000
commit3d3f6190abb92ccc5bb81e90885ab14316218ffc (patch)
treeb2544ee201063d4ea1aa9dc3f8dd88c9dbaf4799 /llvm/lib/Target/NVPTX
parent87cdfa76357ca88e934eab9741a346045783d8df (diff)
downloadbcm5719-llvm-3d3f6190abb92ccc5bb81e90885ab14316218ffc.tar.gz
bcm5719-llvm-3d3f6190abb92ccc5bb81e90885ab14316218ffc.zip
[NVPTX] Fix lowering of fp16 ISD::FNEG.
There's no neg.f16 instruction, so negation has to be done via subtraction from zero. Differential Revision: https://reviews.llvm.org/D28876 llvm-svn: 292452
Diffstat (limited to 'llvm/lib/Target/NVPTX')
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 0fd8d4b2aa7..48954fd19e5 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -332,6 +332,8 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
setOperationAction(ISD::FSUB, MVT::f16, Promote);
setOperationAction(ISD::FMA, MVT::f16, Promote);
}
+ // There's no neg.f16 instruction.
+ setOperationAction(ISD::FNEG, MVT::f16, Expand);
// Library functions. These default to Expand, but we have instructions
// for them.
OpenPOWER on IntegriCloud