Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr92658-sse4-8b.c

raw
1 /* PR target/92658 */
2 /* { dg-do compile { target { ! ia32 } } } */
3 /* { dg-options "-O2 -mtune=icelake-server -ftree-vectorize -msse4.1" } */
4
5 typedef unsigned char v8qi __attribute__((vector_size (8)));
6 typedef unsigned short v4hi __attribute__((vector_size (8)));
7 typedef unsigned int v2si __attribute__((vector_size (8)));
8
9 void
10 foo_u8_u16 (v4hi * dst, v8qi * __restrict src)
11 {
12 unsigned short tem[4];
13 tem[0] = (*src)[0];
14 tem[1] = (*src)[1];
15 tem[2] = (*src)[2];
16 tem[3] = (*src)[3];
17 dst[0] = *(v4hi *) tem;
18 }
19
20 void
21 bar_u8_u16 (v4hi * dst, v8qi src)
22 {
23 unsigned short tem[4];
24 tem[0] = src[0];
25 tem[1] = src[1];
26 tem[2] = src[2];
27 tem[3] = src[3];
28 dst[0] = *(v4hi *) tem;
29 }
30
31 /* { dg-final { scan-assembler-times "pmovzxbw" 2 } } */
32
33 void
34 foo_u8_u32 (v2si * dst, v8qi * __restrict src)
35 {
36 unsigned int tem[2];
37 tem[0] = (*src)[0];
38 tem[1] = (*src)[1];
39 dst[0] = *(v2si *) tem;
40 }
41
42 void
43 bar_u8_u32 (v2si * dst, v8qi src)
44 {
45 unsigned int tem[2];
46 tem[0] = src[0];
47 tem[1] = src[1];
48 dst[0] = *(v2si *) tem;
49 }
50
51 /* { dg-final { scan-assembler-times "pmovzxbd" 2 } } */
52
53 void
54 foo_u16_u32 (v2si * dst, v4hi * __restrict src)
55 {
56 unsigned int tem[2];
57 tem[0] = (*src)[0];
58 tem[1] = (*src)[1];
59 dst[0] = *(v2si *) tem;
60 }
61
62 void
63 bar_u16_u32 (v2si * dst, v4hi src)
64 {
65 unsigned int tem[2];
66 tem[0] = src[0];
67 tem[1] = src[1];
68 dst[0] = *(v2si *) tem;
69 }
70
71 /* { dg-final { scan-assembler-times "pmovzxwd" 2 } } */