[llvm] [AMDGPU] Implement llvm.fptosi.sat and llvm.fptoui.sat (PR #174726)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 7 21:54:20 PST 2026


================
@@ -3762,6 +3767,52 @@ SDValue AMDGPUTargetLowering::LowerFP_TO_INT(const SDValue Op,
   return SDValue();
 }
 
+SDValue AMDGPUTargetLowering::LowerFP_TO_INT_SAT(const SDValue Op,
+                                                 SelectionDAG &DAG) const {
+  SDValue Src = Op.getOperand(0);
+  unsigned OpOpcode = Op.getOpcode();
+  EVT SrcVT = Src.getValueType();
+  EVT DestVT = Op.getValueType();
+  SDValue SatVT = Op.getNode()->getOperand(1);
----------------
perlfu wrote:

Your correct, I have rewritten the lowering based on SatVT inline with other target implementations.

https://github.com/llvm/llvm-project/pull/174726


More information about the llvm-commits mailing list