[llvm] [NVPTX] Support llvm.exp2 for f32 and vector of f32 (PR #120519)

Princeton Ferro via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 06:37:02 PST 2024


================
@@ -0,0 +1,47 @@
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_52 -mattr=+ptx86 | FileCheck --check-prefixes=CHECK %s
+; RUN: %if ptxas-12.6 %{ llc < %s -march=nvptx64 -mcpu=sm_52 -mattr=+ptx86 | %ptxas-verify -arch=sm_52 %}
+source_filename = "fexp2.ll"
+target datalayout = "e-p:64:64:64-p3:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-f128:128:128-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64-a:8:8"
+target triple = "nvptx64-nvidia-cuda"
+
+; CHECK-LABEL: exp2_test
+define ptx_kernel void @exp2_test(ptr %a, ptr %res) local_unnamed_addr {
+entry:
+  %in = load float, ptr %a, align 4
+  ; CHECK: ex2.approx.f32 [[D1:%f[0-9]+]], [[S1:%f[0-9]+]]
----------------
Prince781 wrote:

Thanks!

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


More information about the llvm-commits mailing list