public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions
       [not found] <bug-88473-4@http.gcc.gnu.org/bugzilla/>
@ 2020-08-21  4:54 ` crazylht at gmail dot com
  2021-09-04 21:46 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: crazylht at gmail dot com @ 2020-08-21  4:54 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #6 from Hongtao.liu <crazylht at gmail dot com> ---
Fixed in GCC11 by
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=388cb292a94f98a276548cd6ce01285cf36d17df

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions
       [not found] <bug-88473-4@http.gcc.gnu.org/bugzilla/>
  2020-08-21  4:54 ` [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions crazylht at gmail dot com
@ 2021-09-04 21:46 ` pinskia at gcc dot gnu.org
  2021-09-06  5:23 ` crazylht at gmail dot com
  2021-09-06  5:24 ` crazylht at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-04 21:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |93885

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The UNSPEC_MASKOP ones are still there.

PR 93885 is the same issue.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93885
[Bug 93885] Spurious instruction kshiftlw issued

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions
       [not found] <bug-88473-4@http.gcc.gnu.org/bugzilla/>
  2020-08-21  4:54 ` [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions crazylht at gmail dot com
  2021-09-04 21:46 ` pinskia at gcc dot gnu.org
@ 2021-09-06  5:23 ` crazylht at gmail dot com
  2021-09-06  5:24 ` crazylht at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: crazylht at gmail dot com @ 2021-09-06  5:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Andrew Pinski from comment #7)
> The UNSPEC_MASKOP ones are still there.
> 
> PR 93885 is the same issue.

void test(void* data, void* data2)
{
    __m128i v = _mm_load_si128((__m128i const*)data);
    __mmask8 m = _mm_testn_epi16_mask(v, v);
    m = m | 0x0f;
    m = m | 0xf0;
    v = _mm_maskz_add_epi16(m, v, v);
    _mm_store_si128((__m128i*)data2, v);
}

Should be ok.

Currently we rely on RA to choose whether to use mask register or gpr for
bitwise operation, which means that if we remove UNSPEC_MASKOP, _kor_mask8 will
only generate gpr orb, to ensure the correspondence between intrinsic and
instruction, UNSPEC_MASKOP is necessary, if the user wants GCC to optimize
bitwise operation, it is recommended to use bitwise operator instead of
intrinsic.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions
       [not found] <bug-88473-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-09-06  5:23 ` crazylht at gmail dot com
@ 2021-09-06  5:24 ` crazylht at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: crazylht at gmail dot com @ 2021-09-06  5:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #8)
> (In reply to Andrew Pinski from comment #7)
> > The UNSPEC_MASKOP ones are still there.
> > 
> > PR 93885 is the same issue.
> 
> void test(void* data, void* data2)
> {
>     __m128i v = _mm_load_si128((__m128i const*)data);
>     __mmask8 m = _mm_testn_epi16_mask(v, v);
>     m = m | 0x0f;
>     m = m | 0xf0;
>     v = _mm_maskz_add_epi16(m, v, v);
>     _mm_store_si128((__m128i*)data2, v);
> }
> 
> Should be ok.
> 
> Currently we rely on RA to choose whether to use mask register or gpr for
> bitwise operation, which means that if we remove UNSPEC_MASKOP, _kor_mask8
> will only generate gpr orb, to ensure the correspondence between intrinsic
> and instruction, UNSPEC_MASKOP is necessary, if the user wants GCC to
> optimize bitwise operation, it is recommended to use bitwise operator
> instead of intrinsic.

Similar for 88476

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-06  5:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-88473-4@http.gcc.gnu.org/bugzilla/>
2020-08-21  4:54 ` [Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions crazylht at gmail dot com
2021-09-04 21:46 ` pinskia at gcc dot gnu.org
2021-09-06  5:23 ` crazylht at gmail dot com
2021-09-06  5:24 ` crazylht at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).