Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr111023.c

raw
1 /* PR target/111023 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -mtune=icelake-server -ftree-vectorize -msse2 -mno-sse4.1" } */
4
5 typedef unsigned char v16qi __attribute__((vector_size (16)));
6 typedef unsigned short v8hi __attribute__((vector_size (16)));
7 typedef unsigned int v4si __attribute__((vector_size (16)));
8 typedef unsigned long long v2di __attribute__((vector_size (16)));
9
10 void
11 v8hi_v8qi (v8hi *dst, v16qi src)
12 {
13 unsigned short tem[8];
14 tem[0] = src[0];
15 tem[1] = src[1];
16 tem[2] = src[2];
17 tem[3] = src[3];
18 tem[4] = src[4];
19 tem[5] = src[5];
20 tem[6] = src[6];
21 tem[7] = src[7];
22 dst[0] = *(v8hi *) tem;
23 }
24
25 /* { dg-final { scan-assembler "punpcklbw" } } */
26
27 void
28 v4si_v4hi (v4si *dst, v8hi src)
29 {
30 unsigned int tem[4];
31 tem[0] = src[0];
32 tem[1] = src[1];
33 tem[2] = src[2];
34 tem[3] = src[3];
35 dst[0] = *(v4si *) tem;
36 }
37
38 /* { dg-final { scan-assembler "punpcklwd" } } */
39
40 void
41 v2di_v2si (v2di *dst, v4si src)
42 {
43 unsigned long long tem[2];
44 tem[0] = src[0];
45 tem[1] = src[1];
46 dst[0] = *(v2di *) tem;
47 }
48
49 /* { dg-final { scan-assembler "punpckldq" } } */