[llvm] [NVPTX] Improve support for {ex2,lg2}.approx (PR #120519)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 09:57:24 PST 2024


================
@@ -964,6 +964,10 @@ let TargetPrefix = "nvvm" in {
       DefaultAttrsIntrinsic<[llvm_half_ty], [llvm_half_ty], [IntrNoMem]>;
   def int_nvvm_ex2_approx_f16x2 :
       DefaultAttrsIntrinsic<[llvm_v2f16_ty], [llvm_v2f16_ty], [IntrNoMem]>;
+  def int_nvvm_ex2_approx_bf16 :
+      DefaultAttrsIntrinsic<[llvm_bfloat_ty], [llvm_bfloat_ty], [IntrNoMem]>;
+  def int_nvvm_ex2_approx_bf16x2 :
+      DefaultAttrsIntrinsic<[llvm_v2bf16_ty], [llvm_v2bf16_ty], [IntrNoMem]>;
----------------
AlexMaclean wrote:

Can we switch nvvm.ex2.approx to be an overloaded intrinsic? Better yet can we use the generic exp2 intrinsic with the `afn` fast-math-flag to represent this operation?

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


More information about the llvm-commits mailing list