public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103771] New: Missed vectorization under -mavx512f -mavx512vl after r12-5489
@ 2021-12-20  8:59 wwwhhhyyy333 at gmail dot com
  2021-12-20 11:45 ` [Bug target/103771] [12 Regression] " pinskia at gcc dot gnu.org
                   ` (44 more replies)
  0 siblings, 45 replies; 46+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2021-12-20  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103771
           Summary: Missed vectorization under -mavx512f -mavx512vl after
                    r12-5489
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wwwhhhyyy333 at gmail dot com
  Target Milestone: ---

cat vect.c

typedef unsigned char uint8_t;                                                  

static uint8_t x264_clip_uint8( int x )                                         
{                                                                               
    return x&(~255) ? (-x)>>31 : x;                                             
}                                                                               

void mc_weight( uint8_t * __restrict dst, uint8_t * __restrict src, int
i_width, int i_scale)
{                                                                               
  for( int x = 0; x < i_width; x++ )                                            
    dst[x] = x264_clip_uint8(src[x] * i_scale);                                 
}                                                                               

It can not be vectorized with -mavx512f -mavx512vl, but can be vectorized with
-mavx2, See https://godbolt.org/z/M1jx161f6

The commit https://gcc.gnu.org/cgi-bin/gcc-gitref.cgi?r=r12-5489 converts  (x &
(~255)) == 0 to x <= 255, which may trigger some missing pattern with
-mavx512vl. 

Also an 1.5% regression was found on -march=cascadelake due to missing 128bit
epilogue for this loop.

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

end of thread, other threads:[~2023-05-08  7:39 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20  8:59 [Bug target/103771] New: Missed vectorization under -mavx512f -mavx512vl after r12-5489 wwwhhhyyy333 at gmail dot com
2021-12-20 11:45 ` [Bug target/103771] [12 Regression] " pinskia at gcc dot gnu.org
2022-01-04 15:31 ` tnfchris at gcc dot gnu.org
2022-01-05  9:00 ` crazylht at gmail dot com
2022-01-13  8:43 ` crazylht at gmail dot com
2022-01-13  9:02 ` crazylht at gmail dot com
2022-01-13  9:04 ` crazylht at gmail dot com
2022-01-13  9:28 ` rguenth at gcc dot gnu.org
2022-01-13  9:50 ` rguenth at gcc dot gnu.org
2022-01-13 10:04 ` crazylht at gmail dot com
2022-01-13 10:11 ` rsandifo at gcc dot gnu.org
2022-01-13 10:22 ` crazylht at gmail dot com
2022-01-13 10:43 ` crazylht at gmail dot com
2022-01-13 10:44 ` rguenther at suse dot de
2022-01-13 10:49 ` rguenther at suse dot de
2022-01-13 10:50 ` crazylht at gmail dot com
2022-01-13 12:40 ` crazylht at gmail dot com
2022-01-13 13:42 ` rguenther at suse dot de
2022-01-13 14:42 ` crazylht at gmail dot com
2022-01-14  9:40 ` rsandifo at gcc dot gnu.org
2022-01-14 10:18 ` rguenth at gcc dot gnu.org
2022-01-17  8:22 ` crazylht at gmail dot com
2022-01-18  8:31 ` crazylht at gmail dot com
2022-01-18  8:36 ` crazylht at gmail dot com
2022-01-18 10:44 ` rguenther at suse dot de
2022-01-18 10:49 ` pinskia at gcc dot gnu.org
2022-01-19  6:03 ` crazylht at gmail dot com
2022-01-19  6:10 ` pinskia at gcc dot gnu.org
2022-01-19  6:25 ` crazylht at gmail dot com
2022-01-19  7:44 ` rguenth at gcc dot gnu.org
2022-01-19  8:33 ` crazylht at gmail dot com
2022-01-19  8:48 ` rguenther at suse dot de
2022-01-20  8:52 ` cvs-commit at gcc dot gnu.org
2022-01-27  6:03 ` crazylht at gmail dot com
2022-02-01  5:21 ` pinskia at gcc dot gnu.org
2022-02-01 16:13 ` law at gcc dot gnu.org
2022-02-01 16:18 ` pinskia at gcc dot gnu.org
2022-02-13  9:58 ` cvs-commit at gcc dot gnu.org
2022-02-14  7:36 ` rguenth at gcc dot gnu.org
2022-02-14  7:45 ` crazylht at gmail dot com
2022-02-14  7:53 ` rguenth at gcc dot gnu.org
2022-02-17 11:01 ` cvs-commit at gcc dot gnu.org
2023-04-26  6:55 ` [Bug target/103771] [12/13/14 " rguenth at gcc dot gnu.org
2023-05-06 23:21 ` pinskia at gcc dot gnu.org
2023-05-08  7:38 ` cvs-commit at gcc dot gnu.org
2023-05-08  7:39 ` 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).