https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88798

--- Comment #9 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Wojciech Mula from comment #8)
> Thank you for the answer. Thus my question is: is it possible to delay
> conversion from kmasks into ints? I'm not a language lawyer, but I guess a
> `x binop y` has to be treated as `(int)x binop (int)y`. If it's true, we
> will have to prove that `(int)(x avx512-binop y)` is equivalent to the
> latter expr.

It's quite tricky to teach RA to choose the best alternative(which is discussed
in  pr101185).

alternatively, you can use intrinsic _kor_mask64 directly to avoid extra
movment from GPR to MASK.

uint64_t any_whitespace(__m512i string) {
    return _kor_mask64 (_kor_mask64 (_mm512_cmpeq_epu8_mask(string,
_mm512_set1_epi8(' '))
         ,_mm512_cmpeq_epu8_mask(string, _mm512_set1_epi8('\n')))
         ,_mm512_cmpeq_epu8_mask(string, _mm512_set1_epi8('\r')));
}

Reply via email to