Debian Codegraph @

gcc/testsuite/gcc.dg/vect/slp-gap-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-O3" } */
3
4 typedef unsigned char uint8_t;
5 typedef short int16_t;
6 void pixel_sub_wxh(int16_t * __restrict diff, uint8_t *pix1, uint8_t *pix2) {
7 for (int y = 0; y < 4; y++) {
8 for (int x = 0; x < 4; x++)
9 diff[x + y * 4] = pix1[x] - pix2[x];
10 pix1 += 16;
11 pix2 += 32;
12 }
13 }
14
15 /* We can vectorize this without peeling for gaps and thus without epilogue,
16 but the only thing we can reliably scan is the zero-padding trick for the
17 partial loads.
18 Note this will match `{_1, 0}` or `{_1, {0, 0, 0, 0}}`. Both are the same
19 in the end, the difference is the load is either via SI or V4QI. */
20 /* { dg-final { scan-tree-dump-times "\{_\[0-9\]\+, (?:0\|{ 0(?:, 0)\+ )}" 6 "vect" { target { vect64 && { vect_unpack && vect_perm } } } } } */