[llvm] [NVPTX] Add intrinsics for new narrow FP conversions (PR #173954)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 30 06:15:55 PST 2025


================
@@ -2194,7 +2194,20 @@ let Predicates = [callSubtarget<"hasFP8ConversionSupport">] in {
             (CVT_e5m2x2_f32 $a, $b, CvtRN)>;
   def : Pat<(int_nvvm_ff_to_e5m2x2_rn_relu f32:$a, f32:$b),
             (CVT_e5m2x2_f32 $a, $b, CvtRN_RELU)>;
+}
+
+let Predicates = [callSubtarget<"hasFP16X2ToNarrowFPConversionSupport">] in {
+  foreach dst_type = ["e4m3x2", "e5m2x2"] in {
+    foreach relu = ["", "_relu"] in {
+      def : Pat<(!cast<Intrinsic>("int_nvvm_bf16x2_to_" # dst_type # "_rn" # relu # "_satfinite")
+                  B32:$a),
----------------
AlexMaclean wrote:

nit: In input patterns we generally prefer an LLVM type over a register so this should be v2bf16 instead of B32.

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


More information about the llvm-commits mailing list