[llvm] [AMDGPU] Use `v_cvt_pk_*` instructions for i8_f32 saturated conversions (PR #206522)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 16:50:26 PDT 2026


================
@@ -3932,6 +3933,14 @@ SDValue AMDGPUTargetLowering::LowerFP_TO_INT_SAT(const SDValue Op,
       return Op;
   }
 
+  // Native selection also applies to some 8-bit width cases to allow use of
+  // packed instructions.
+  if (SatWidth == 8 &&
+      ((DstVT == MVT::i16 && SrcVT == MVT::f32) ||
+       (DstVT == MVT::v2i16 && SrcVT == MVT::v2f32)) &&
----------------
krzysz00 wrote:

Very trivial question: is there any reason to key this to 2 instead of unrolling any multiples of the required widths? Or is that already handled?

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


More information about the llvm-commits mailing list