[llvm] Reland "[NVPTX] Support copysign PTX instruction" (PR #108125)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 11 11:27:56 PDT 2024
================
@@ -2560,6 +2561,23 @@ SDValue NVPTXTargetLowering::LowerShiftLeftParts(SDValue Op,
}
}
+/// Convert the generic copysign to the NVPTXISD version which guarantees that
+/// the types of the operands will match
+SDValue NVPTXTargetLowering::LowerFCOPYSIGN(SDValue Op,
+ SelectionDAG &DAG) const {
+ EVT VT = Op.getValueType();
+ SDLoc DL(Op);
+
+ SDValue In1 = Op.getOperand(0);
+ SDValue In2 = Op.getOperand(1);
+ EVT SrcVT = In2.getValueType();
+
+ if (!SrcVT.bitsEq(VT))
+ In2 = DAG.getFPExtendOrRound(In2, DL, VT);
----------------
AlexMaclean wrote:
Sounds good, I've switched so that we bail allowing the legalizer to expand.
https://github.com/llvm/llvm-project/pull/108125
More information about the llvm-commits
mailing list