]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
aarch64: Add LS64 extension and intrinsics
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / aarch64 / pragma_cpp_predefs_2.c
CommitLineData
89626179
SD
1/* { dg-do compile } */
2/* { dg-options "-O2" } */
3
a93e1d5c
DZ
4#pragma GCC push_options
5#pragma GCC target ("arch=armv8-a")
6
89626179
SD
7#pragma GCC push_options
8#pragma GCC target ("arch=armv8-a+tme")
9#ifndef __ARM_FEATURE_TME
10#error "__ARM_FEATURE_TME is not defined but should be!"
11#endif
12
13#pragma GCC pop_options
14
15#ifdef __ARM_FEATURE_TME
16#error "__ARM_FEATURE_TME is defined but should not be!"
17#endif
18
a93e1d5c
DZ
19/* Test Armv8.6-A features. */
20
21#ifdef __ARM_FEATURE_MATMUL_INT8
22#error "__ARM_FEATURE_MATMUL_INT8 is defined but should not be!"
23#endif
36696774
RS
24#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
25#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
26#endif
27#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
28#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
29#endif
30#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
31#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
336e1b95
MM
32#endif
33
a93e1d5c
DZ
34#pragma GCC push_options
35#pragma GCC target ("arch=armv8.6-a")
36#ifndef __ARM_FEATURE_MATMUL_INT8
37#error "__ARM_FEATURE_MATMUL_INT8 is not defined but should be!"
38#endif
36696774
RS
39#ifdef __ARM_FEATURE_SVE
40#error "__ARM_FEATURE_SVE is defined but should not be!"
41#endif
42#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
43#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
44#endif
45#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
46#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
47#endif
48#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
49#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
336e1b95 50#endif
a93e1d5c
DZ
51#pragma GCC pop_options
52
36696774
RS
53#pragma GCC push_options
54#pragma GCC target ("arch=armv8.6-a+sve")
55#ifndef __ARM_FEATURE_MATMUL_INT8
56#error "__ARM_FEATURE_MATMUL_INT8 is not defined but should be!"
57#endif
58#ifndef __ARM_FEATURE_SVE
59#error "__ARM_FEATURE_SVE is not defined but should be!"
60#endif
61#ifndef __ARM_FEATURE_SVE_MATMUL_INT8
62#error "__ARM_FEATURE_SVE_MATMUL_INT8 is not defined but should be!"
63#endif
64#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
65#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
66#endif
67#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
68#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
69#endif
857d1fa3 70#pragma GCC pop_options
36696774 71
a93e1d5c
DZ
72#pragma GCC push_options
73#pragma GCC target ("arch=armv8.2-a+i8mm")
74#ifndef __ARM_FEATURE_MATMUL_INT8
75#error "__ARM_FEATURE_MATMUL_INT8 is not defined but should be!"
76#endif
36696774
RS
77#ifdef __ARM_FEATURE_SVE
78#error "__ARM_FEATURE_SVE is defined but should not be!"
79#endif
80#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
81#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
82#endif
83#pragma GCC pop_options
84
85#pragma GCC push_options
86#pragma GCC target ("arch=armv8.2-a+i8mm+sve")
87#ifndef __ARM_FEATURE_MATMUL_INT8
88#error "__ARM_FEATURE_MATMUL_INT8 is not defined but should be!"
89#endif
90#ifndef __ARM_FEATURE_SVE
91#error "__ARM_FEATURE_SVE is not defined but should be!"
92#endif
93#ifndef __ARM_FEATURE_SVE_MATMUL_INT8
94#error "__ARM_FEATURE_SVE_MATMUL_INT8 is not defined but should be!"
95#endif
96#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
97#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
98#endif
99#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
100#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
101#endif
a93e1d5c
DZ
102#pragma GCC pop_options
103
36696774
RS
104#pragma GCC push_options
105#pragma GCC target ("arch=armv8.2-a+f32mm")
106#ifndef __ARM_FEATURE_SVE
107#error "__ARM_FEATURE_SVE is not defined but should be!"
108#endif
109#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
110#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
111#endif
112#ifndef __ARM_FEATURE_SVE_MATMUL_FP32
113#error "__ARM_FEATURE_SVE_MATMUL_FP32 is not defined but should be!"
114#endif
115#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
116#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
117#endif
857d1fa3 118#pragma GCC pop_options
36696774 119
336e1b95
MM
120#pragma GCC push_options
121#pragma GCC target ("arch=armv8.2-a+f64mm")
36696774
RS
122#ifndef __ARM_FEATURE_SVE
123#error "__ARM_FEATURE_SVE is not defined but should be!"
124#endif
125#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
126#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
127#endif
128#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
129#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
130#endif
131#ifndef __ARM_FEATURE_SVE_MATMUL_FP64
132#error "__ARM_FEATURE_SVE_MATMUL_FP64 is not defined but should be!"
336e1b95
MM
133#endif
134#pragma GCC pop_options
135
a93e1d5c
DZ
136#pragma GCC push_options
137#pragma GCC target ("arch=armv8.6-a+nosimd")
138#ifdef __ARM_FEATURE_MATMUL_INT8
139#error "__ARM_FEATURE_MATMUL_INT8 is defined but should not be!"
140#endif
36696774
RS
141#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
142#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
143#endif
144#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
145#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
146#endif
a93e1d5c
DZ
147#pragma GCC pop_options
148
149#pragma GCC push_options
150#pragma GCC target ("arch=armv8.6-a+nofp")
151#ifdef __ARM_FEATURE_MATMUL_INT8
152#error "__ARM_FEATURE_MATMUL_INT8 is defined but should not be!"
153#endif
36696774
RS
154#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
155#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
156#endif
157#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
158#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
159#endif
a93e1d5c
DZ
160#pragma GCC pop_options
161
162#ifdef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
163#error "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is defined but should not be!"
164#endif
165#ifdef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
166#error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC is defined but should not be!"
167#endif
168
169#pragma GCC push_options
170#pragma GCC target ("arch=armv8.6-a")
171#ifndef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
172#error "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is not defined but should be!"
173#endif
174#ifndef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
175#error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC is not defined but should be!"
176#endif
177#pragma GCC pop_options
178
179#pragma GCC push_options
180#pragma GCC target ("arch=armv8.2-a+bf16")
181#ifndef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
182#error "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is not defined but should be!"
183#endif
184#ifndef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
185#error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC is not defined but should be!"
186#endif
187#pragma GCC pop_options
188
189#pragma GCC push_options
190#pragma GCC target ("arch=armv8.2-a+bf16+nosimd")
191#ifndef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
192#error "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is not defined but should be!"
193#endif
194#ifdef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
195#error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC is defined but should not be!"
196#endif
197#pragma GCC pop_options
198
199#pragma GCC push_options
200#pragma GCC target ("arch=armv8.6-a+nofp")
201#ifdef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
202#error "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is defined but should not be!"
203#endif
204#ifdef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
205#error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC is defined but should not be!"
206#endif
207#pragma GCC pop_options
208
209#pragma GCC pop_options
210
857d1fa3
FY
211/* Make sure that general-regs-only works too. */
212#pragma GCC push_options
213#pragma GCC target ("arch=armv8.2-a+sve+i8mm+f32mm+f64mm")
214#ifndef __ARM_FEATURE_SVE
215#error "__ARM_FEATURE_SVE is not defined but should be!"
216#endif
217#ifndef __ARM_FEATURE_SVE_MATMUL_INT8
218#error "__ARM_FEATURE_SVE_MATMUL_INT8 is not defined but should be!"
219#endif
220#ifndef __ARM_FEATURE_SVE_MATMUL_FP32
221#error "__ARM_FEATURE_SVE_MATMUL_FP32 is not defined but should be!"
222#endif
223#ifndef __ARM_FEATURE_SVE_MATMUL_FP64
224#error "__ARM_FEATURE_SVE_MATMUL_FP64 is not defined but should be!"
225#endif
226
227#pragma GCC push_options
228#pragma GCC target ("general-regs-only")
229#ifdef __ARM_FEATURE_SVE
230#error "__ARM_FEATURE_SVE is defined but should not be!"
231#endif
232#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
233#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
234#endif
235#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
236#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
237#endif
238#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
239#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
240#endif
241#pragma GCC pop_options
242
fdcddba8
PW
243#pragma GCC push_options
244#pragma GCC target ("arch=armv8.7-a")
245#ifndef __ARM_FEATURE_LS64
246#error "__ARM_FEATURE_LS64 is not defined but should be!"
247#endif
248#pragma GCC pop_options
249
250#pragma GCC push_options
251#pragma GCC target ("arch=armv8.7-a+ls64")
252#ifndef __ARM_FEATURE_LS64
253#error "__ARM_FEATURE_LS64 is not defined but should be!"
254#endif
255#pragma GCC pop_options
256
857d1fa3
FY
257#pragma GCC pop_options
258
89626179
SD
259int
260foo (int a)
261{
262 return a;
263}