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

2025-07-17 Thread Matt Arsenault via cfe-commits


@@ -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
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-17 Thread Shilei Tian via cfe-commits

https://github.com/shiltian closed 
https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-17 Thread Shilei Tian via cfe-commits

shiltian wrote:

### Merge activity

* **Jul 17, 12:41 PM UTC**: A user started a stack merge that includes this 
pull request via 
[Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/149229).


https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-17 Thread Stanislav Mekhanoshin via cfe-commits

https://github.com/rampitec approved this pull request.

LGTM.

https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-17 Thread Stanislav Mekhanoshin via cfe-commits


@@ -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)

rampitec wrote:

Because it is direct access to the instruction w/o following potential 
legalization.

https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-17 Thread Stanislav Mekhanoshin via cfe-commits

https://github.com/rampitec edited 
https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-16 Thread Shilei Tian via cfe-commits


@@ -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)

shiltian wrote:

They were added in different times in the past and we do have a builtin for 
that.

https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-07-16 Thread Matt Arsenault via cfe-commits


@@ -0,0 +1,240 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 5

arsenm wrote:

Can you give this a bf16 suffix instead of bfloat, and add the other targets 
where it's not legal 

https://github.com/llvm/llvm-project/pull/149229
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits