Issue 180695
Summary [AVX10.2] Move out mask from bias convert (VCVTBIAS)* instruction intrinsic arguments
Labels new issue
Assignees
Reporter mahesh-attarde
    In 1 of motivating case, we compute bias twice since mask combine did went through.

```
__m128i foo(__m128i __W, __mmask8 __U, __m128i __A, __m128h __B) {
  return _mm_mask_cvtbiasph_bf8(__W, 0xf0, __A, __B) + _mm_mask_cvtbiasph_bf8(__W, 0x0f, __A, __B);
}

__m128i bar(__m128i __W, __mmask8 __U, __m128i __A, __m128h __B) {
  return _mm_mask_dpph_ps(__W, 0xf0, __A, __B) + _mm_mask_dpph_ps(__W, 0x0f, __A, __B);
}
```

```
foo(long long vector[2], unsigned char, long long vector[2], _Float16 vector[8]):
  mov al, -16
  kmovd k1, eax
  vmovaps xmm3, xmm0
  vcvtbiasph2bf8 xmm3 {k1}, xmm1, xmm2
  mov al, 15
  kmovd k1, eax
  vcvtbiasph2bf8 xmm0 {k1}, xmm1, xmm2
  vpaddq xmm0, xmm0, xmm3
  ret

bar(long long vector[2], unsigned char, long long vector[2], _Float16 vector[8]):
  vmovaps xmm3, xmm0
 vdpphps xmm3, xmm1, xmm2
  vaddps xmm0, xmm3, xmm0
  ret
```
We may need to use  __builtin_select in bias intrinsic functions to let transform succeed.

Ref : https://godbolt.org/z/s51W33Ph1
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to