Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr103771.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=cascadelake -O3 -fdump-tree-vect-details -mprefer-vector-width=128" } */
3 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
4
5 typedef unsigned char uint8_t;
6
7 static uint8_t x264_clip_uint8 (int x)
8 {
9 return x & (~255) ? (-x) >> 31 : x;
10 }
11
12 void
13 mc_weight (uint8_t* __restrict dst, uint8_t* __restrict src,
14 int i_width,int i_scale)
15 {
16 for(int x = 0; x < i_width; x++)
17 dst[x] = x264_clip_uint8 (src[x] * i_scale);
18 }