mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Legalizer was missing code that expand fpow to a libcall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56028 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e10c814c52
commit
4b88702ac3
@ -6602,13 +6602,9 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){
|
||||
Lo = ExpandLibCall(LC, Node, true, Hi);
|
||||
break;
|
||||
}
|
||||
case ISD::FPOWI:
|
||||
Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::POWI_F32,
|
||||
RTLIB::POWI_F64,
|
||||
RTLIB::POWI_F80,
|
||||
RTLIB::POWI_PPCF128),
|
||||
Node, false, Hi);
|
||||
break;
|
||||
case ISD::FSQRT:
|
||||
case ISD::FSIN:
|
||||
case ISD::FCOS:
|
||||
case ISD::FLOG:
|
||||
case ISD::FLOG2:
|
||||
case ISD::FLOG10:
|
||||
@ -6619,9 +6615,7 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){
|
||||
case ISD::FCEIL:
|
||||
case ISD::FRINT:
|
||||
case ISD::FNEARBYINT:
|
||||
case ISD::FSQRT:
|
||||
case ISD::FSIN:
|
||||
case ISD::FCOS: {
|
||||
case ISD::FPOW: {
|
||||
RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
|
||||
switch(Node->getOpcode()) {
|
||||
case ISD::FSQRT:
|
||||
@ -6676,6 +6670,14 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){
|
||||
LC = GetFPLibCall(VT, RTLIB::NEARBYINT_F32, RTLIB::NEARBYINT_F64,
|
||||
RTLIB::NEARBYINT_F80, RTLIB::NEARBYINT_PPCF128);
|
||||
break;
|
||||
case ISD::FPOW:
|
||||
LC = GetFPLibCall(VT, RTLIB::POW_F32, RTLIB::POW_F64, RTLIB::POW_F80,
|
||||
RTLIB::POW_PPCF128);
|
||||
break;
|
||||
case ISD::FPOWI:
|
||||
LC = GetFPLibCall(VT, RTLIB::POWI_F32, RTLIB::POWI_F64, RTLIB::POWI_F80,
|
||||
RTLIB::POWI_PPCF128);
|
||||
break;
|
||||
default: assert(0 && "Unreachable!");
|
||||
}
|
||||
Lo = ExpandLibCall(LC, Node, false, Hi);
|
||||
|
10
test/CodeGen/ARM/fpow.ll
Normal file
10
test/CodeGen/ARM/fpow.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llvm-as < %s | llc -march=arm
|
||||
; RUN: llvm-as < %s | llc -march=thumb
|
||||
|
||||
define double @t(double %x, double %y) nounwind notes(opt_size) {
|
||||
entry:
|
||||
%0 = tail call double @llvm.pow.f64( double %x, double %y ) ; <double> [#uses=1]
|
||||
ret double %0
|
||||
}
|
||||
|
||||
declare double @llvm.pow.f64(double, double) nounwind readonly
|
Loading…
Reference in New Issue
Block a user