[clang] [llvm] [AMDGPU] Add support for `v_exp_bf16` on gfx1250 (PR #149229)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 05:58:55 PDT 2025


================
@@ -25,4 +25,27 @@ define amdgpu_ps void @llvm_log2_bf16_s(ptr addrspace(1) %out, bfloat inreg %src
   ret void
 }
 
+define amdgpu_ps void @llvm_exp2_bf16_v(ptr addrspace(1) %out, bfloat %src) {
+; GCN-LABEL: llvm_exp2_bf16_v:
+; GCN:       ; %bb.0:
+; GCN-NEXT:    v_exp_bf16_e32 v2, v2
+; GCN-NEXT:    global_store_b16 v[0:1], v2, off
+; GCN-NEXT:    s_endpgm
+  %exp = call bfloat @llvm.exp2.bf16(bfloat %src)
----------------
arsenm wrote:

There's no legalization if the instruction works correctly. There's no reason to have the clang builtin, though the codegen for the target intrinsic should still work with the new type if legal 

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


More information about the llvm-commits mailing list