]>
Commit | Line | Data |
---|---|---|
91b019a3 AK |
1 | /* { dg-do run } */ |
2 | /* { dg-options "-O3 -mzarch -march=z13 --save-temps" } */ | |
3 | /* { dg-require-effective-target vector } */ | |
4 | ||
5 | typedef unsigned char uv16qi __attribute__((vector_size(16))); | |
6 | typedef unsigned short uv8hi __attribute__((vector_size(16))); | |
7 | typedef unsigned int uv4si __attribute__((vector_size(16))); | |
8 | typedef unsigned long long uv2di __attribute__((vector_size(16))); | |
9 | ||
10 | uv2di __attribute__((noinline)) | |
11 | foo1 () | |
12 | { | |
13 | return (uv2di){ 0x000fffffffffff00, 0x000fffffffffff00 }; | |
14 | } | |
15 | /* { dg-final { scan-assembler-times "vgmg\t%v24,12,55" 1 } } */ | |
16 | ||
17 | uv4si __attribute__((noinline)) | |
18 | foo2 () | |
19 | { | |
20 | return (uv4si){ 0xff00000f, 0xff00000f, 0xff00000f, 0xff00000f }; | |
21 | } | |
22 | /* { dg-final { scan-assembler-times "vgmf\t%v24,28,7" 1 } } */ | |
23 | ||
24 | uv8hi __attribute__((noinline)) | |
25 | foo3a () | |
26 | { | |
27 | return (uv8hi){ 0xfff0, 0xfff0, 0xfff0, 0xfff0, | |
28 | 0xfff0, 0xfff0, 0xfff0, 0xfff0 }; | |
29 | } | |
30 | /* { dg-final { scan-assembler-times "vgmh\t%v24,0,11" 1 } } */ | |
31 | ||
32 | uv8hi __attribute__((noinline)) | |
33 | foo3b () | |
34 | { | |
35 | return (uv8hi){ 0x0fff, 0x0fff, 0x0fff, 0x0fff, | |
36 | 0x0fff, 0x0fff, 0x0fff, 0x0fff }; | |
37 | } | |
38 | /* { dg-final { scan-assembler-times "vgmh\t%v24,4,15" 1 } } */ | |
39 | ||
40 | uv16qi __attribute__((noinline)) | |
41 | foo4 () | |
42 | { | |
43 | return (uv16qi){ 0x8, 0x8, 0x8, 0x8, | |
44 | 0x8, 0x8, 0x8, 0x8, | |
45 | 0x8, 0x8, 0x8, 0x8, | |
46 | 0x8, 0x8, 0x8, 0x8 }; | |
47 | } | |
48 | /* { dg-final { scan-assembler-times "vgmb\t%v24,4,4" 1 } } */ | |
49 | ||
50 | int | |
51 | main () | |
52 | { | |
53 | if (foo1()[1] != 0x000fffffffffff00ULL) | |
54 | __builtin_abort (); | |
55 | ||
56 | if (foo2()[1] != 0xff00000f) | |
57 | __builtin_abort (); | |
58 | ||
59 | if (foo3a()[1] != 0xfff0) | |
60 | __builtin_abort (); | |
61 | ||
62 | if (foo3b()[1] != 0x0fff) | |
63 | __builtin_abort (); | |
64 | ||
65 | if (foo4()[1] != 0x8) | |
66 | __builtin_abort (); | |
67 | return 0; | |
68 | } |