[llvm] [NVPTX] Add intrinsics for ff/f16/bf16 to ue5m3 conversions (PR #218677)

Srinivasa Ravi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 21:24:37 PDT 2026


================
@@ -2016,6 +2016,32 @@ let TargetPrefix = "nvvm" in {
         : PureIntrinsic<[llvm_v2bf16_ty], [llvm_i16_ty, llvm_i16_ty]>;
   }
 
+  foreach rnd = ["rn", "rz", "rp"] in {
+    foreach satfinite = ["", "_satfinite"] in {
+      def int_nvvm_ff_to_ue5m3x2_ # rnd # satfinite
+          : PureIntrinsic<[llvm_i16_ty], [llvm_float_ty, llvm_float_ty]>;
+
+      def int_nvvm_f16x2_to_ue5m3x2_ # rnd # satfinite
+          : PureIntrinsic<[llvm_i16_ty], [llvm_v2f16_ty]>;
+
+      def int_nvvm_bf16x2_to_ue5m3x2_ # rnd # satfinite
+          : PureIntrinsic<[llvm_i16_ty], [llvm_v2bf16_ty]>;
+    }
+  }
+
+  foreach rnd = ["rn", "rz"] in {
+    foreach satfinite = ["", "_satfinite"] in {
----------------
Wolfram70 wrote:

Since the loop above also goes over `satfinite`, can we switch the loop order and combine the loops? Maybe we could do the same for the rounding modes (`rn` and `rz`)?

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


More information about the llvm-commits mailing list