[llvm] AMDGPU][True16][CodeGen] FP_Round f64 to f16 in true16 (PR #128911)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 02:00:00 PDT 2025


================
@@ -3578,15 +3578,22 @@ SDValue AMDGPUTargetLowering::LowerFP_TO_FP16(SDValue Op, SelectionDAG &DAG) con
     return SDValue();
   }
 
-  assert(N0.getSimpleValueType() == MVT::f64);
+  return LowerF64ToF16(N0, Op.getValueType(), DL, DAG);
----------------
jayfoad wrote:

I think `Op.getValueType()` will always be `i32`, right? So you could change `LowerF64ToF16` to always build an `i32` result, and just truncate it to `i16` in `lowerFP_ROUND`.

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


More information about the llvm-commits mailing list