public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/109900] New: _mm256_abs_epi8 is not expanded on gimple level
@ 2023-05-17 23:20 pinskia at gcc dot gnu.org
  2023-05-19  5:51 ` [Bug target/109900] " crazylht at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-17 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109900
           Summary: _mm256_abs_epi8 is not expanded on gimple level
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-linux-gnu

Take (at -O3 -march=x86-64-v3):
```
#include <immintrin.h>
__m256i
should_be_cmpeq_abs0 ()
{
  return _mm256_set1_epi8 (1);
}
__m256i
should_be_cmpeq_abs1 ()
{
  return _mm256_abs_epi8(_mm256_set1_epi8 (-1));
}
```
I would have expected these two produce the same code generation.
In the end, we still have a builtin function in the IR rather than ABS_EXPR.
The RTL level uses abs.
In fact combine tries to combine the two instructions:
Trying 5 -> 6:
    5: r85:V32QI=const_vector
    6: r84:V32QI=abs(r85:V32QI)
      REG_DEAD r85:V32QI
      REG_EQUAL const_vector
Failed to match this instruction:
(set (reg:V32QI 84)
    (const_vector:V32QI [
            (const_int 1 [0x1]) repeated x32
        ]))

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

end of thread, other threads:[~2023-05-24  2:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 23:20 [Bug target/109900] New: _mm256_abs_epi8 is not expanded on gimple level pinskia at gcc dot gnu.org
2023-05-19  5:51 ` [Bug target/109900] " crazylht at gmail dot com
2023-05-24  1:13 ` cvs-commit at gcc dot gnu.org
2023-05-24  1:14 ` crazylht at gmail dot com
2023-05-24  2:09 ` pinskia at gcc dot gnu.org

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