[libclc] [libclc] Add native half implementation of __clc_normalize (PR #150165)
Wenju He via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 22 22:06:44 PDT 2025
wenju-he wrote:
llvm-diff amdgcn--amdhsa.bc.new amdgcn--amdhsa.bc.old
```
in function _Z9normalizeDh:
in block %1 / %1:
> %2 = fpext half %0 to float
%2 = fcmp one half %0, 0xH0000
> %4 = select i1 %3, float 1.000000e+00, float 0.000000e+00
> %5 = tail call noundef float @llvm.copysign.f32(float %4, float %2)
> %6 = fptrunc float %5 to half
> ret half %6
< %3 = select i1 %2, half 0xH3C00, half 0xH0000
< %4 = tail call noundef half @llvm.copysign.f16(half %3, half %0)
< ret half %4
in function _Z9normalizeDv2_Dh:
in block %1 / %1:
> %2 = fpext <2 x half> %0 to <2 x float>
in function _Z9normalizeDv3_Dh:
in block %1 / %1:
> %2 = fpext <3 x half> %0 to <3 x float>
in function _Z9normalizeDv4_Dh:
in block %1 / %1:
> %2 = fpext <4 x half> %0 to <4 x float>
```
https://github.com/llvm/llvm-project/pull/150165
More information about the cfe-commits
mailing list