aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-08-15 22:13:27 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-08-15 22:13:27 +0000
commitc90f08936d717ac6aa767c28cee7af4366eb6921 (patch)
tree6bac066a0762cc3c6aa0eacbeedd4f32c8645542
parentebf03038109c2af39d0db14ea9058c10e02e9eae (diff)
Implement FPOWI ExpandOp.
Fix PR1287. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41112 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp5
-rw-r--r--test/CodeGen/ARM/fpowi.ll16
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 3d1b47d3f3..b25f86f774 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -5604,6 +5604,11 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
case ISD::FP_ROUND:
Lo = ExpandLibCall(TLI.getLibcallName(RTLIB::FPROUND_F64_F32),Node,true,Hi);
break;
+ case ISD::FPOWI:
+ Lo = ExpandLibCall(TLI.getLibcallName((VT == MVT::f32)
+ ? RTLIB::POWI_F32 : RTLIB::POWI_F64),
+ Node, false, Hi);
+ break;
case ISD::FSQRT:
case ISD::FSIN:
case ISD::FCOS: {
diff --git a/test/CodeGen/ARM/fpowi.ll b/test/CodeGen/ARM/fpowi.ll
new file mode 100644
index 0000000000..ab09ffff6b
--- /dev/null
+++ b/test/CodeGen/ARM/fpowi.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep powidf2
+; PR1287
+
+; ModuleID = '<stdin>'
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "arm-linux-gnueabi"
+
+define double @_ZSt3powdi(double %__x, i32 %__i) {
+entry:
+ %tmp3 = call double @llvm.powi.f64( double 0.000000e+00, i32 0 ) ; <double> [#uses=1]
+ store double %tmp3, double* null, align 8
+ unreachable
+}
+
+declare double @llvm.powi.f64(double, i32)
+