[llvm] [MIPS] Fix -msingle-float doesn't work with double on O32 (PR #107543)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 02:10:41 PDT 2024
================
@@ -1244,6 +1244,12 @@ SDValue MipsSETargetLowering::lowerBITCAST(SDValue Op,
// Bitcast double to i64.
if (Src == MVT::f64 && Dest == MVT::i64) {
+ // Skip lower bitcast when operand0 has converted float results to integer
+ // which was done by function SoftenFloatResult.
+ if (DAG.getTargetLoweringInfo().getTypeAction(
+ *DAG.getContext(), Op.getOperand(0).getValueType()) ==
+ TargetLowering::TypeSoftenFloat)
----------------
yingopq wrote:
> This method is part of MipsSETargetLowering so its part of what DAG.getTargetLoweringInfo() is pointing to (ie. the this pointer) - you can just use:
>
> ```c++
> if (getTypeAction(*DAG.getContext(), Op.getOperand(0).getValueType()) == TargetLowering::TypeSoftenFloat)
> ```
Oh, I got it and applied it, thanks!
https://github.com/llvm/llvm-project/pull/107543
More information about the llvm-commits
mailing list