[clang] [llvm] [NVPTX] Add ex2.approx bf16 support and cleanup intrinsic definition (PR #165446)

Princeton Ferro via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 28 10:41:24 PDT 2025


================
@@ -2550,6 +2554,11 @@ static Value *upgradeNVVMIntrinsicCall(StringRef Name, CallBase *CI,
     Intrinsic::ID IID = (Name == "fabs.ftz.f") ? Intrinsic::nvvm_fabs_ftz
                                                : Intrinsic::nvvm_fabs;
     Rep = Builder.CreateUnaryIntrinsic(IID, CI->getArgOperand(0));
+  } else if (Name.consume_front("ex2.approx.")) {
+    // nvvm.ex2.approx.{f,ftz.f,d,f16x2}
+    Intrinsic::ID IID = Name.starts_with("ftz") ? Intrinsic::nvvm_ex2_approx_ftz
+                                                : Intrinsic::nvvm_ex2_approx;
----------------
Prince781 wrote:

If not here, is there somewhere else we can have conversion of these intrinsics to the LLVM variant?

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


More information about the cfe-commits mailing list