llvm.org GIT mirror llvm / 110cf48
Unbreak ARM / Thumb soft FP support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49012 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 11 years ago
3 changed file(s) with 31 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
54495449 }
54505450
54515451 RTLIB::Libcall LC;
5452 if (SourceVT == MVT::i64) {
5452 if (SourceVT == MVT::i32) {
5453 if (DestTy == MVT::f32)
5454 LC = isSigned ? RTLIB::SINTTOFP_I64_F32 : RTLIB::UINTTOFP_I64_F32;
5455 else {
5456 assert(DestTy == MVT::f64 && "Unknown fp value type!");
5457 LC = isSigned ? RTLIB::SINTTOFP_I32_F64 : RTLIB::UINTTOFP_I32_F64;
5458 }
5459 } else if (SourceVT == MVT::i64) {
54535460 if (DestTy == MVT::f32)
54545461 LC = RTLIB::SINTTOFP_I64_F32;
54555462 else if (DestTy == MVT::f64)
54805487 SDOperand HiPart;
54815488 SDOperand Result = ExpandLibCall(TLI.getLibcallName(LC), Source.Val, isSigned,
54825489 HiPart);
5483 if (Result.getValueType() != DestTy)
5490 if (Result.getValueType() != DestTy && HiPart.Val)
54845491 Result = DAG.getNode(ISD::BUILD_PAIR, DestTy, Result, HiPart);
54855492 return Result;
54865493 }
67726779
67736780 Lo = ExpandIntToFP(Node->getOpcode() == ISD::SINT_TO_FP, VT,
67746781 Node->getOperand(0));
6775 ExpandOp(Lo, Lo, Hi);
6782 if (getTypeAction(Lo.getValueType()) == Expand)
6783 ExpandOp(Lo, Lo, Hi);
67766784 break;
67776785 }
67786786 }
247247 setOperationAction(ISD::FCOS , MVT::f64, Expand);
248248 setOperationAction(ISD::FREM , MVT::f64, Expand);
249249 setOperationAction(ISD::FREM , MVT::f32, Expand);
250 setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
251 setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
250 if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) {
251 setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
252 setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
253 }
252254 setOperationAction(ISD::FPOW , MVT::f64, Expand);
253255 setOperationAction(ISD::FPOW , MVT::f32, Expand);
254256
255257 // int <-> fp are custom expanded into bit_convert + ARMISD ops.
256 setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom);
257 setOperationAction(ISD::UINT_TO_FP, MVT::i32, Custom);
258 setOperationAction(ISD::FP_TO_UINT, MVT::i32, Custom);
259 setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
258 if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) {
259 setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom);
260 setOperationAction(ISD::UINT_TO_FP, MVT::i32, Custom);
261 setOperationAction(ISD::FP_TO_UINT, MVT::i32, Custom);
262 setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
263 }
260264
261265 // We have target-specific dag combine patterns for the following nodes:
262266 // ARMISD::FMRRD - No need to call setTargetDAGCombine
88 ; RUN: grep fsitod %t
99 ; RUN: grep fuitos %t
1010 ; RUN: grep fuitod %t
11 ; RUN: llvm-as < %s | llc -march=arm > %t
12 ; RUN: grep truncdfsf2 %t
13 ; RUN: grep extendsfdf2 %t
14 ; RUN: grep fixsfsi %t
15 ; RUN: grep fixunssfsi %t
16 ; RUN: grep fixdfsi %t
17 ; RUN: grep fixunsdfsi %t
18 ; RUN: grep floatdisf %t
19 ; RUN: grep floatsidf %t
20 ; RUN: llvm-as < %s | llc -march=thumb
1121
1222 define float @f1(double %x) {
1323 entry: