File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -761,20 +761,21 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FFREXP(SDNode *N) {
761
761
EVT VT0 = N->getValueType (0 );
762
762
EVT VT1 = N->getValueType (1 );
763
763
RTLIB::Libcall LC = RTLIB::getFREXP (VT0);
764
+ EVT NVT0 = TLI.getTypeToTransformTo (*DAG.getContext (), VT0);
765
+ SDLoc DL (N);
764
766
765
767
if (DAG.getLibInfo ().getIntSize () != VT1.getSizeInBits ()) {
766
768
// If the exponent does not match with sizeof(int) a libcall would use the
767
769
// wrong type for the argument.
768
770
// TODO: Should be able to handle mismatches.
769
771
DAG.getContext ()->emitError (" ffrexp exponent does not match sizeof(int)" );
770
- return DAG.getUNDEF (N->getValueType (0 ));
772
+ SDValue PoisonExp = DAG.getPOISON (VT1);
773
+ ReplaceValueWith (SDValue (N, 1 ), PoisonExp);
774
+ return DAG.getMergeValues ({DAG.getPOISON (NVT0), PoisonExp}, DL);
771
775
}
772
776
773
- EVT NVT0 = TLI.getTypeToTransformTo (*DAG.getContext (), VT0);
774
777
SDValue StackSlot = DAG.CreateStackTemporary (VT1);
775
778
776
- SDLoc DL (N);
777
-
778
779
auto PointerTy = PointerType::getUnqual (*DAG.getContext ());
779
780
TargetLowering::MakeLibCallOptions CallOptions;
780
781
SDValue Ops[2 ] = {GetSoftenedFloat (N->getOperand (0 )), StackSlot};
Original file line number Diff line number Diff line change
1
+ ; RUN: not llc -mtriple arm-linux-gnu -float-abi=soft -filetype=null %s 2>&1 | FileCheck %s
2
+
3
+ ; FIXME: This should not fail but isn't implemented
4
+ ; CHECK: error: ffrexp exponent does not match sizeof(int)
5
+ define { float , i64 } @soften_frexp_error (float %x ) {
6
+ %frexp = call { float , i64 } @llvm.frexp.f32.i64 (float %x )
7
+ ret { float , i64 } %frexp
8
+ }
You can’t perform that action at this time.
0 commit comments