PR c++/67273
[official-gcc.git] / gcc / testsuite / gcc.target / arm / mmx-2.c
blob0540f659d1aa2ebb39565f79c48d02f0af5d6607
1 /* { dg-do compile } */
2 /* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mcpu=*" } { "-mcpu=iwmmxt" } } */
3 /* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mabi=*" } { "-mabi=iwmmxt" } } */
4 /* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-march=*" } { "-march=iwmmxt" } } */
5 /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */
6 /* { dg-require-effective-target arm32 } */
7 /* { dg-require-effective-target arm_iwmmxt_ok } */
8 /* { dg-options "-mcpu=iwmmxt -flax-vector-conversions -std=gnu99" } */
10 /* Internal data types for implementing the intrinsics. */
11 typedef int __v2si __attribute__ ((vector_size (8)));
12 typedef short __v4hi __attribute__ ((vector_size (8)));
13 typedef signed char __v8qi __attribute__ ((vector_size (8)));
15 void
16 foo(void)
18 volatile int isink;
19 volatile long long llsink;
20 volatile __v8qi v8sink;
21 volatile __v4hi v4sink;
22 volatile __v2si v2sink;
24 isink = __builtin_arm_getwcgr0 ();
25 __builtin_arm_setwcgr0 (isink);
26 isink = __builtin_arm_getwcgr1 ();
27 __builtin_arm_setwcgr1 (isink);
28 isink = __builtin_arm_getwcgr2 ();
29 __builtin_arm_setwcgr2 (isink);
30 isink = __builtin_arm_getwcgr3 ();
31 __builtin_arm_setwcgr3 (isink);
33 isink = __builtin_arm_textrmsb (v8sink, 0);
34 isink = __builtin_arm_textrmsh (v4sink, 0);
35 isink = __builtin_arm_textrmsw (v2sink, 0);
36 isink = __builtin_arm_textrmub (v8sink, 0);
37 isink = __builtin_arm_textrmuh (v4sink, 0);
38 isink = __builtin_arm_textrmuw (v2sink, 0);
39 v8sink = __builtin_arm_tinsrb (v8sink, isink, 0);
40 v4sink = __builtin_arm_tinsrh (v4sink, isink, 0);
41 v2sink = __builtin_arm_tinsrw (v2sink, isink, 0);
42 llsink = __builtin_arm_tmia (llsink, isink, isink);
43 llsink = __builtin_arm_tmiabb (llsink, isink, isink);
44 llsink = __builtin_arm_tmiabt (llsink, isink, isink);
45 llsink = __builtin_arm_tmiaph (llsink, isink, isink);
46 llsink = __builtin_arm_tmiatb (llsink, isink, isink);
47 llsink = __builtin_arm_tmiatt (llsink, isink, isink);
48 isink = __builtin_arm_tmovmskb (v8sink);
49 isink = __builtin_arm_tmovmskh (v4sink);
50 isink = __builtin_arm_tmovmskw (v2sink);
51 llsink = __builtin_arm_waccb (v8sink);
52 llsink = __builtin_arm_wacch (v4sink);
53 llsink = __builtin_arm_waccw (v2sink);
54 v8sink = __builtin_arm_waddb (v8sink, v8sink);
55 v8sink = __builtin_arm_waddbss (v8sink, v8sink);
56 v8sink = __builtin_arm_waddbus (v8sink, v8sink);
57 v4sink = __builtin_arm_waddh (v4sink, v4sink);
58 v4sink = __builtin_arm_waddhss (v4sink, v4sink);
59 v4sink = __builtin_arm_waddhus (v4sink, v4sink);
60 v2sink = __builtin_arm_waddw (v2sink, v2sink);
61 v2sink = __builtin_arm_waddwss (v2sink, v2sink);
62 v2sink = __builtin_arm_waddwus (v2sink, v2sink);
63 v8sink = __builtin_arm_walign (v8sink, v8sink, 0); /* waligni: 3-bit immediate. */
64 v8sink = __builtin_arm_walign (v8sink, v8sink, isink); /* walignr: GP register. */
65 llsink = __builtin_arm_wand(llsink, llsink);
66 llsink = __builtin_arm_wandn (llsink, llsink);
67 v8sink = __builtin_arm_wavg2b (v8sink, v8sink);
68 v8sink = __builtin_arm_wavg2br (v8sink, v8sink);
69 v4sink = __builtin_arm_wavg2h (v4sink, v4sink);
70 v4sink = __builtin_arm_wavg2hr (v4sink, v4sink);
71 v8sink = __builtin_arm_wcmpeqb (v8sink, v8sink);
72 v4sink = __builtin_arm_wcmpeqh (v4sink, v4sink);
73 v2sink = __builtin_arm_wcmpeqw (v2sink, v2sink);
74 v8sink = __builtin_arm_wcmpgtsb (v8sink, v8sink);
75 v4sink = __builtin_arm_wcmpgtsh (v4sink, v4sink);
76 v2sink = __builtin_arm_wcmpgtsw (v2sink, v2sink);
77 v8sink = __builtin_arm_wcmpgtub (v8sink, v8sink);
78 v4sink = __builtin_arm_wcmpgtuh (v4sink, v4sink);
79 v2sink = __builtin_arm_wcmpgtuw (v2sink, v2sink);
80 llsink = __builtin_arm_wmacs (llsink, v4sink, v4sink);
81 llsink = __builtin_arm_wmacsz (v4sink, v4sink);
82 llsink = __builtin_arm_wmacu (llsink, v4sink, v4sink);
83 llsink = __builtin_arm_wmacuz (v4sink, v4sink);
84 v4sink = __builtin_arm_wmadds (v4sink, v4sink);
85 v4sink = __builtin_arm_wmaddu (v4sink, v4sink);
86 v8sink = __builtin_arm_wmaxsb (v8sink, v8sink);
87 v4sink = __builtin_arm_wmaxsh (v4sink, v4sink);
88 v2sink = __builtin_arm_wmaxsw (v2sink, v2sink);
89 v8sink = __builtin_arm_wmaxub (v8sink, v8sink);
90 v4sink = __builtin_arm_wmaxuh (v4sink, v4sink);
91 v2sink = __builtin_arm_wmaxuw (v2sink, v2sink);
92 v8sink = __builtin_arm_wminsb (v8sink, v8sink);
93 v4sink = __builtin_arm_wminsh (v4sink, v4sink);
94 v2sink = __builtin_arm_wminsw (v2sink, v2sink);
95 v8sink = __builtin_arm_wminub (v8sink, v8sink);
96 v4sink = __builtin_arm_wminuh (v4sink, v4sink);
97 v2sink = __builtin_arm_wminuw (v2sink, v2sink);
98 v4sink = __builtin_arm_wmulsm (v4sink, v4sink);
99 v4sink = __builtin_arm_wmulul (v4sink, v4sink);
100 v4sink = __builtin_arm_wmulum (v4sink, v4sink);
101 llsink = __builtin_arm_wor (llsink, llsink);
102 v2sink = __builtin_arm_wpackdss (llsink, llsink);
103 v2sink = __builtin_arm_wpackdus (llsink, llsink);
104 v8sink = __builtin_arm_wpackhss (v4sink, v4sink);
105 v8sink = __builtin_arm_wpackhus (v4sink, v4sink);
106 v4sink = __builtin_arm_wpackwss (v2sink, v2sink);
107 v4sink = __builtin_arm_wpackwus (v2sink, v2sink);
108 llsink = __builtin_arm_wrord (llsink, llsink);
109 llsink = __builtin_arm_wrordi (llsink, isink);
110 v4sink = __builtin_arm_wrorh (v4sink, llsink);
111 v4sink = __builtin_arm_wrorhi (v4sink, isink);
112 v2sink = __builtin_arm_wrorw (v2sink, llsink);
113 v2sink = __builtin_arm_wrorwi (v2sink, isink);
114 v2sink = __builtin_arm_wsadb (v2sink, v8sink, v8sink);
115 v2sink = __builtin_arm_wsadbz (v8sink, v8sink);
116 v2sink = __builtin_arm_wsadh (v2sink, v4sink, v4sink);
117 v2sink = __builtin_arm_wsadhz (v4sink, v4sink);
118 v4sink = __builtin_arm_wshufh (v4sink, 0);
119 llsink = __builtin_arm_wslld (llsink, llsink);
120 llsink = __builtin_arm_wslldi (llsink, 0);
121 v4sink = __builtin_arm_wsllh (v4sink, llsink);
122 v4sink = __builtin_arm_wsllhi (v4sink, isink);
123 v2sink = __builtin_arm_wsllw (v2sink, llsink);
124 v2sink = __builtin_arm_wsllwi (v2sink, isink);
125 llsink = __builtin_arm_wsrad (llsink, llsink);
126 llsink = __builtin_arm_wsradi (llsink, isink);
127 v4sink = __builtin_arm_wsrah (v4sink, llsink);
128 v4sink = __builtin_arm_wsrahi (v4sink, isink);
129 v2sink = __builtin_arm_wsraw (v2sink, llsink);
130 v2sink = __builtin_arm_wsrawi (v2sink, isink);
131 llsink = __builtin_arm_wsrld (llsink, llsink);
132 llsink = __builtin_arm_wsrldi (llsink, isink);
133 v4sink = __builtin_arm_wsrlh (v4sink, llsink);
134 v4sink = __builtin_arm_wsrlhi (v4sink, isink);
135 v2sink = __builtin_arm_wsrlw (v2sink, llsink);
136 v2sink = __builtin_arm_wsrlwi (v2sink, isink);
137 v8sink = __builtin_arm_wsubb (v8sink, v8sink);
138 v8sink = __builtin_arm_wsubbss (v8sink, v8sink);
139 v8sink = __builtin_arm_wsubbus (v8sink, v8sink);
140 v4sink = __builtin_arm_wsubh (v4sink, v4sink);
141 v4sink = __builtin_arm_wsubhss (v4sink, v4sink);
142 v4sink = __builtin_arm_wsubhus (v4sink, v4sink);
143 v2sink = __builtin_arm_wsubw (v2sink, v2sink);
144 v2sink = __builtin_arm_wsubwss (v2sink, v2sink);
145 v2sink = __builtin_arm_wsubwus (v2sink, v2sink);
146 v4sink = __builtin_arm_wunpckehsb (v8sink);
147 v2sink = __builtin_arm_wunpckehsh (v4sink);
148 llsink = __builtin_arm_wunpckehsw (v2sink);
149 v4sink = __builtin_arm_wunpckehub (v8sink);
150 v2sink = __builtin_arm_wunpckehuh (v4sink);
151 llsink = __builtin_arm_wunpckehuw (v2sink);
152 v4sink = __builtin_arm_wunpckelsb (v8sink);
153 v2sink = __builtin_arm_wunpckelsh (v4sink);
154 llsink = __builtin_arm_wunpckelsw (v2sink);
155 v4sink = __builtin_arm_wunpckelub (v8sink);
156 v2sink = __builtin_arm_wunpckeluh (v4sink);
157 llsink = __builtin_arm_wunpckeluw (v2sink);
158 v8sink = __builtin_arm_wunpckihb (v8sink, v8sink);
159 v4sink = __builtin_arm_wunpckihh (v4sink, v4sink);
160 v2sink = __builtin_arm_wunpckihw (v2sink, v2sink);
161 v8sink = __builtin_arm_wunpckilb (v8sink, v8sink);
162 v4sink = __builtin_arm_wunpckilh (v4sink, v4sink);
163 v2sink = __builtin_arm_wunpckilw (v2sink, v2sink);
164 llsink = __builtin_arm_wxor (llsink, llsink);
165 llsink = __builtin_arm_wzero ();