aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-03 23:43:21 +0000
committerChris Lattner <sabre@nondot.org>2007-03-03 23:43:21 +0000
commit8b2d42c9494a42c8b5b9e5c2e46c8001b89e75b5 (patch)
tree4568ba62034cc7c0d7bdb7411d0b5d64eba2f7cc
parent4f263a00bf0884374b3ed9205e3122be9adcc9da (diff)
downloadexternal_llvm-8b2d42c9494a42c8b5b9e5c2e46c8001b89e75b5.zip
external_llvm-8b2d42c9494a42c8b5b9e5c2e46c8001b89e75b5.tar.gz
external_llvm-8b2d42c9494a42c8b5b9e5c2e46c8001b89e75b5.tar.bz2
Fix CodeGen/Generic/fpowi-promote.ll and PR1239
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34893 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 357e2cd..84a381b 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3328,6 +3328,18 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
DAG.getValueType(VT));
break;
+ case ISD::FPOWI: {
+ // Promote f32 powi to f64 powi. Note that this could insert a libcall
+ // directly as well, which may be better.
+ Tmp1 = PromoteOp(Node->getOperand(0));
+ assert(Tmp1.getValueType() == NVT);
+ Result = DAG.getNode(ISD::FPOWI, NVT, Tmp1, Node->getOperand(1));
+ if (NoExcessFPPrecision)
+ Result = DAG.getNode(ISD::FP_ROUND_INREG, NVT, Result,
+ DAG.getValueType(VT));
+ break;
+ }
+
case ISD::AND:
case ISD::OR:
case ISD::XOR: