xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/arm/arm_acle.h (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1 /* ARM Non-NEON ACLE intrinsics include file.
2 
3    Copyright (C) 2013-2020 Free Software Foundation, Inc.
4    Contributed by ARM Ltd.
5 
6    This file is part of GCC.
7 
8    GCC is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published
10    by the Free Software Foundation; either version 3, or (at your
11    option) any later version.
12 
13    GCC is distributed in the hope that it will be useful, but WITHOUT
14    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16    License for more details.
17 
18    Under Section 7 of GPL version 3, you are granted additional
19    permissions described in the GCC Runtime Library Exception, version
20    3.1, as published by the Free Software Foundation.
21 
22    You should have received a copy of the GNU General Public License and
23    a copy of the GCC Runtime Library Exception along with this program;
24    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
25    <http://www.gnu.org/licenses/>.  */
26 
27 #ifndef _GCC_ARM_ACLE_H
28 #define _GCC_ARM_ACLE_H
29 
30 #include <stdint.h>
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #if (!__thumb__ || __thumb2__) &&  __ARM_ARCH >= 4
36 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_cdp(const unsigned int __coproc,const unsigned int __opc1,const unsigned int __CRd,const unsigned int __CRn,const unsigned int __CRm,const unsigned int __opc2)37 __arm_cdp (const unsigned int __coproc, const unsigned int __opc1,
38 	   const unsigned int __CRd, const unsigned int __CRn,
39 	   const unsigned int __CRm, const unsigned int __opc2)
40 {
41   __builtin_arm_cdp (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
42 }
43 
44 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_ldc(const unsigned int __coproc,const unsigned int __CRd,const void * __p)45 __arm_ldc (const unsigned int __coproc, const unsigned int __CRd,
46 	   const void * __p)
47 {
48   __builtin_arm_ldc (__coproc, __CRd, __p);
49 }
50 
51 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_ldcl(const unsigned int __coproc,const unsigned int __CRd,const void * __p)52 __arm_ldcl (const unsigned int __coproc, const unsigned int __CRd,
53 	    const void * __p)
54 {
55   __builtin_arm_ldcl (__coproc, __CRd, __p);
56 }
57 
58 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_stc(const unsigned int __coproc,const unsigned int __CRd,void * __p)59 __arm_stc (const unsigned int __coproc, const unsigned int __CRd,
60 	   void * __p)
61 {
62   __builtin_arm_stc (__coproc, __CRd, __p);
63 }
64 
65 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_stcl(const unsigned int __coproc,const unsigned int __CRd,void * __p)66 __arm_stcl (const unsigned int __coproc, const unsigned int __CRd,
67 	    void * __p)
68 {
69   __builtin_arm_stcl (__coproc, __CRd, __p);
70 }
71 
72 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_mcr(const unsigned int __coproc,const unsigned int __opc1,uint32_t __value,const unsigned int __CRn,const unsigned int __CRm,const unsigned int __opc2)73 __arm_mcr (const unsigned int __coproc, const unsigned int __opc1,
74 	   uint32_t __value, const unsigned int __CRn, const unsigned int __CRm,
75 	   const unsigned int __opc2)
76 {
77   __builtin_arm_mcr (__coproc, __opc1, __value, __CRn, __CRm, __opc2);
78 }
79 
80 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__arm_mrc(const unsigned int __coproc,const unsigned int __opc1,const unsigned int __CRn,const unsigned int __CRm,const unsigned int __opc2)81 __arm_mrc (const unsigned int __coproc, const unsigned int __opc1,
82 	   const unsigned int __CRn, const unsigned int __CRm,
83 	   const unsigned int __opc2)
84 {
85   return __builtin_arm_mrc (__coproc, __opc1, __CRn, __CRm, __opc2);
86 }
87 #if __ARM_ARCH >= 5
88 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_cdp2(const unsigned int __coproc,const unsigned int __opc1,const unsigned int __CRd,const unsigned int __CRn,const unsigned int __CRm,const unsigned int __opc2)89 __arm_cdp2 (const unsigned int __coproc, const unsigned int __opc1,
90 	    const unsigned int __CRd, const unsigned int __CRn,
91 	    const unsigned int __CRm, const unsigned int __opc2)
92 {
93   __builtin_arm_cdp2 (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
94 }
95 
96 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_ldc2(const unsigned int __coproc,const unsigned int __CRd,const void * __p)97 __arm_ldc2 (const unsigned int __coproc, const unsigned int __CRd,
98 	    const void * __p)
99 {
100   __builtin_arm_ldc2 (__coproc, __CRd, __p);
101 }
102 
103 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_ldc2l(const unsigned int __coproc,const unsigned int __CRd,const void * __p)104 __arm_ldc2l (const unsigned int __coproc, const unsigned int __CRd,
105 	     const void * __p)
106 {
107   __builtin_arm_ldc2l (__coproc, __CRd, __p);
108 }
109 
110 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_stc2(const unsigned int __coproc,const unsigned int __CRd,void * __p)111 __arm_stc2 (const unsigned int __coproc, const unsigned int __CRd,
112 	    void * __p)
113 {
114   __builtin_arm_stc2 (__coproc, __CRd, __p);
115 }
116 
117 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_stc2l(const unsigned int __coproc,const unsigned int __CRd,void * __p)118 __arm_stc2l (const unsigned int __coproc, const unsigned int __CRd,
119 	     void * __p)
120 {
121   __builtin_arm_stc2l (__coproc, __CRd, __p);
122 }
123 
124 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_mcr2(const unsigned int __coproc,const unsigned int __opc1,uint32_t __value,const unsigned int __CRn,const unsigned int __CRm,const unsigned int __opc2)125 __arm_mcr2 (const unsigned int __coproc, const unsigned int __opc1,
126 	    uint32_t __value, const unsigned int __CRn,
127 	    const unsigned int __CRm, const unsigned int __opc2)
128 {
129   __builtin_arm_mcr2 (__coproc, __opc1, __value, __CRn, __CRm, __opc2);
130 }
131 
132 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__arm_mrc2(const unsigned int __coproc,const unsigned int __opc1,const unsigned int __CRn,const unsigned int __CRm,const unsigned int __opc2)133 __arm_mrc2 (const unsigned int __coproc, const unsigned int __opc1,
134 	    const unsigned int __CRn, const unsigned int __CRm,
135 	    const unsigned int __opc2)
136 {
137   return __builtin_arm_mrc2 (__coproc, __opc1, __CRn, __CRm, __opc2);
138 }
139 
140 #if __ARM_ARCH >= 6 ||  defined (__ARM_ARCH_5TE__)
141 
142 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_mcrr(const unsigned int __coproc,const unsigned int __opc1,uint64_t __value,const unsigned int __CRm)143 __arm_mcrr (const unsigned int __coproc, const unsigned int __opc1,
144 	    uint64_t __value, const unsigned int __CRm)
145 {
146   __builtin_arm_mcrr (__coproc, __opc1, __value, __CRm);
147 }
148 
149 __extension__ static __inline uint64_t __attribute__ ((__always_inline__))
__arm_mrrc(const unsigned int __coproc,const unsigned int __opc1,const unsigned int __CRm)150 __arm_mrrc (const unsigned int __coproc, const unsigned int __opc1,
151 	    const unsigned int __CRm)
152 {
153   return __builtin_arm_mrrc (__coproc, __opc1, __CRm);
154 }
155 
156 #if __ARM_ARCH >= 6
157 
158 __extension__ static __inline void __attribute__ ((__always_inline__))
__arm_mcrr2(const unsigned int __coproc,const unsigned int __opc1,uint64_t __value,const unsigned int __CRm)159 __arm_mcrr2 (const unsigned int __coproc, const unsigned int __opc1,
160 	    uint64_t __value, const unsigned int __CRm)
161 {
162   __builtin_arm_mcrr2 (__coproc, __opc1, __value, __CRm);
163 }
164 
165 __extension__ static __inline uint64_t __attribute__ ((__always_inline__))
__arm_mrrc2(const unsigned int __coproc,const unsigned int __opc1,const unsigned int __CRm)166 __arm_mrrc2 (const unsigned int __coproc, const unsigned int __opc1,
167 	     const unsigned int __CRm)
168 {
169   return __builtin_arm_mrrc2 (__coproc, __opc1,  __CRm);
170 }
171 #endif /* __ARM_ARCH >= 6.  */
172 #endif /* __ARM_ARCH >= 6 ||  defined (__ARM_ARCH_5TE__).  */
173 #endif /*  __ARM_ARCH >= 5.  */
174 #endif /* (!__thumb__ || __thumb2__) &&  __ARM_ARCH >= 4.  */
175 
176 #ifdef __ARM_FEATURE_SIMD32
177 typedef int32_t int16x2_t;
178 typedef uint32_t uint16x2_t;
179 typedef int32_t int8x4_t;
180 typedef uint32_t uint8x4_t;
181 
182 __extension__ extern __inline int16x2_t
183 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__sxtab16(int16x2_t __a,int8x4_t __b)184 __sxtab16 (int16x2_t __a, int8x4_t __b)
185 {
186   return __builtin_arm_sxtab16 (__a, __b);
187 }
188 
189 __extension__ extern __inline int16x2_t
190 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__sxtb16(int8x4_t __a)191 __sxtb16 (int8x4_t __a)
192 {
193   return __builtin_arm_sxtb16 (__a);
194 }
195 
196 __extension__ extern __inline uint16x2_t
197 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uxtab16(uint16x2_t __a,uint8x4_t __b)198 __uxtab16 (uint16x2_t __a, uint8x4_t __b)
199 {
200   return __builtin_arm_uxtab16 (__a, __b);
201 }
202 
203 __extension__ extern __inline uint16x2_t
204 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uxtb16(uint8x4_t __a)205 __uxtb16 (uint8x4_t __a)
206 {
207   return __builtin_arm_uxtb16 (__a);
208 }
209 
210 __extension__ extern __inline int8x4_t
211 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__qadd8(int8x4_t __a,int8x4_t __b)212 __qadd8 (int8x4_t __a, int8x4_t __b)
213 {
214   return __builtin_arm_qadd8 (__a, __b);
215 }
216 
217 __extension__ extern __inline int8x4_t
218 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__qsub8(int8x4_t __a,int8x4_t __b)219 __qsub8 (int8x4_t __a, int8x4_t __b)
220 {
221   return __builtin_arm_qsub8 (__a, __b);
222 }
223 
224 __extension__ extern __inline int8x4_t
225 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__shadd8(int8x4_t __a,int8x4_t __b)226 __shadd8 (int8x4_t __a, int8x4_t __b)
227 {
228   return __builtin_arm_shadd8 (__a, __b);
229 }
230 
231 __extension__ extern __inline int8x4_t
232 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__shsub8(int8x4_t __a,int8x4_t __b)233 __shsub8 (int8x4_t __a, int8x4_t __b)
234 {
235   return __builtin_arm_shsub8 (__a, __b);
236 }
237 
238 __extension__ extern __inline uint8x4_t
239 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uhadd8(uint8x4_t __a,uint8x4_t __b)240 __uhadd8 (uint8x4_t __a, uint8x4_t __b)
241 {
242   return __builtin_arm_uhadd8 (__a, __b);
243 }
244 
245 __extension__ extern __inline uint8x4_t
246 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uhsub8(uint8x4_t __a,uint8x4_t __b)247 __uhsub8 (uint8x4_t __a, uint8x4_t __b)
248 {
249   return __builtin_arm_uhsub8 (__a, __b);
250 }
251 
252 __extension__ extern __inline uint8x4_t
253 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uqadd8(uint8x4_t __a,uint8x4_t __b)254 __uqadd8 (uint8x4_t __a, uint8x4_t __b)
255 {
256   return __builtin_arm_uqadd8 (__a, __b);
257 }
258 
259 __extension__ extern __inline uint8x4_t
260 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uqsub8(uint8x4_t __a,uint8x4_t __b)261 __uqsub8 (uint8x4_t __a, uint8x4_t __b)
262 {
263   return __builtin_arm_uqsub8 (__a, __b);
264 }
265 
266 __extension__ extern __inline int16x2_t
267 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__qadd16(int16x2_t __a,int16x2_t __b)268 __qadd16 (int16x2_t __a, int16x2_t __b)
269 {
270   return __builtin_arm_qadd16 (__a, __b);
271 }
272 
273 __extension__ extern __inline int16x2_t
274 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__qasx(int16x2_t __a,int16x2_t __b)275 __qasx (int16x2_t __a, int16x2_t __b)
276 {
277   return __builtin_arm_qasx (__a, __b);
278 }
279 
280 __extension__ extern __inline int16x2_t
281 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__qsax(int16x2_t __a,int16x2_t __b)282 __qsax (int16x2_t __a, int16x2_t __b)
283 {
284   return __builtin_arm_qsax (__a, __b);
285 }
286 
287 __extension__ extern __inline int16x2_t
288 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__qsub16(int16x2_t __a,int16x2_t __b)289 __qsub16 (int16x2_t __a, int16x2_t __b)
290 {
291   return __builtin_arm_qsub16 (__a, __b);
292 }
293 
294 __extension__ extern __inline int16x2_t
295 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__shadd16(int16x2_t __a,int16x2_t __b)296 __shadd16 (int16x2_t __a, int16x2_t __b)
297 {
298   return __builtin_arm_shadd16 (__a, __b);
299 }
300 
301 __extension__ extern __inline int16x2_t
302 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__shasx(int16x2_t __a,int16x2_t __b)303 __shasx (int16x2_t __a, int16x2_t __b)
304 {
305   return __builtin_arm_shasx (__a, __b);
306 }
307 
308 __extension__ extern __inline int16x2_t
309 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__shsax(int16x2_t __a,int16x2_t __b)310 __shsax (int16x2_t __a, int16x2_t __b)
311 {
312   return __builtin_arm_shsax (__a, __b);
313 }
314 
315 __extension__ extern __inline int16x2_t
316 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__shsub16(int16x2_t __a,int16x2_t __b)317 __shsub16 (int16x2_t __a, int16x2_t __b)
318 {
319   return __builtin_arm_shsub16 (__a, __b);
320 }
321 
322 __extension__ extern __inline uint16x2_t
323 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uhadd16(uint16x2_t __a,uint16x2_t __b)324 __uhadd16 (uint16x2_t __a, uint16x2_t __b)
325 {
326   return __builtin_arm_uhadd16 (__a, __b);
327 }
328 
329 __extension__ extern __inline uint16x2_t
330 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uhasx(uint16x2_t __a,uint16x2_t __b)331 __uhasx (uint16x2_t __a, uint16x2_t __b)
332 {
333   return __builtin_arm_uhasx (__a, __b);
334 }
335 
336 __extension__ extern __inline uint16x2_t
337 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uhsax(uint16x2_t __a,uint16x2_t __b)338 __uhsax (uint16x2_t __a, uint16x2_t __b)
339 {
340   return __builtin_arm_uhsax (__a, __b);
341 }
342 
343 __extension__ extern __inline uint16x2_t
344 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uhsub16(uint16x2_t __a,uint16x2_t __b)345 __uhsub16 (uint16x2_t __a, uint16x2_t __b)
346 {
347   return __builtin_arm_uhsub16 (__a, __b);
348 }
349 
350 __extension__ extern __inline uint16x2_t
351 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uqadd16(uint16x2_t __a,uint16x2_t __b)352 __uqadd16 (uint16x2_t __a, uint16x2_t __b)
353 {
354   return __builtin_arm_uqadd16 (__a, __b);
355 }
356 
357 __extension__ extern __inline uint16x2_t
358 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uqasx(uint16x2_t __a,uint16x2_t __b)359 __uqasx (uint16x2_t __a, uint16x2_t __b)
360 {
361   return __builtin_arm_uqasx (__a, __b);
362 }
363 
364 __extension__ extern __inline uint16x2_t
365 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uqsax(uint16x2_t __a,uint16x2_t __b)366 __uqsax (uint16x2_t __a, uint16x2_t __b)
367 {
368   return __builtin_arm_uqsax (__a, __b);
369 }
370 
371 __extension__ extern __inline uint16x2_t
372 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uqsub16(uint16x2_t __a,uint16x2_t __b)373 __uqsub16 (uint16x2_t __a, uint16x2_t __b)
374 {
375   return __builtin_arm_uqsub16 (__a, __b);
376 }
377 
378 __extension__ extern __inline int32_t
379 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smusd(int16x2_t __a,int16x2_t __b)380 __smusd (int16x2_t __a, int16x2_t __b)
381 {
382   return __builtin_arm_smusd (__a, __b);
383 }
384 
385 __extension__ extern __inline int32_t
386 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smusdx(int16x2_t __a,int16x2_t __b)387 __smusdx (int16x2_t __a, int16x2_t __b)
388 {
389   return __builtin_arm_smusdx (__a, __b);
390 }
391 
392 __extension__ extern __inline uint32_t
393 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__usad8(uint8x4_t __a,uint8x4_t __b)394 __usad8 (uint8x4_t __a, uint8x4_t __b)
395 {
396   return __builtin_arm_usad8 (__a, __b);
397 }
398 
399 __extension__ extern __inline uint32_t
400 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__usada8(uint8x4_t __a,uint8x4_t __b,uint32_t __c)401 __usada8 (uint8x4_t __a, uint8x4_t __b, uint32_t __c)
402 {
403   return __builtin_arm_usada8 (__a, __b, __c);
404 }
405 
406 __extension__ extern __inline int64_t
407 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlald(int16x2_t __a,int16x2_t __b,int64_t __c)408 __smlald (int16x2_t __a, int16x2_t __b, int64_t __c)
409 {
410   return __builtin_arm_smlald (__a, __b, __c);
411 }
412 
413 __extension__ extern __inline int64_t
414 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlaldx(int16x2_t __a,int16x2_t __b,int64_t __c)415 __smlaldx (int16x2_t __a, int16x2_t __b, int64_t __c)
416 {
417   return __builtin_arm_smlaldx (__a, __b, __c);
418 }
419 
420 __extension__ extern __inline int64_t
421 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlsld(int16x2_t __a,int16x2_t __b,int64_t __c)422 __smlsld (int16x2_t __a, int16x2_t __b, int64_t __c)
423 {
424   return __builtin_arm_smlsld (__a, __b, __c);
425 }
426 
427 __extension__ extern __inline int64_t
428 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlsldx(int16x2_t __a,int16x2_t __b,int64_t __c)429 __smlsldx (int16x2_t __a, int16x2_t __b, int64_t __c)
430 {
431   return __builtin_arm_smlsldx (__a, __b, __c);
432 }
433 
434 __extension__ extern __inline uint8x4_t
435 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__sel(uint8x4_t __a,uint8x4_t __b)436 __sel (uint8x4_t __a, uint8x4_t __b)
437 {
438   return __builtin_arm_sel (__a, __b);
439 }
440 
441 __extension__ extern __inline int8x4_t
442 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__sadd8(int8x4_t __a,int8x4_t __b)443 __sadd8 (int8x4_t __a, int8x4_t __b)
444 {
445   return __builtin_arm_sadd8 (__a, __b);
446 }
447 
448 __extension__ extern __inline int8x4_t
449 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__ssub8(int8x4_t __a,int8x4_t __b)450 __ssub8 (int8x4_t __a, int8x4_t __b)
451 {
452   return __builtin_arm_ssub8 (__a, __b);
453 }
454 
455 __extension__ extern __inline uint8x4_t
456 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uadd8(uint8x4_t __a,uint8x4_t __b)457 __uadd8 (uint8x4_t __a, uint8x4_t __b)
458 {
459   return __builtin_arm_uadd8 (__a, __b);
460 }
461 
462 __extension__ extern __inline uint8x4_t
463 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__usub8(uint8x4_t __a,uint8x4_t __b)464 __usub8 (uint8x4_t __a, uint8x4_t __b)
465 {
466   return __builtin_arm_usub8 (__a, __b);
467 }
468 
469 __extension__ extern __inline int16x2_t
470 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__sadd16(int16x2_t __a,int16x2_t __b)471 __sadd16 (int16x2_t __a, int16x2_t __b)
472 {
473   return __builtin_arm_sadd16 (__a, __b);
474 }
475 
476 __extension__ extern __inline int16x2_t
477 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__sasx(int16x2_t __a,int16x2_t __b)478 __sasx (int16x2_t __a, int16x2_t __b)
479 {
480   return __builtin_arm_sasx (__a, __b);
481 }
482 
483 __extension__ extern __inline int16x2_t
484 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__ssax(int16x2_t __a,int16x2_t __b)485 __ssax (int16x2_t __a, int16x2_t __b)
486 {
487   return __builtin_arm_ssax (__a, __b);
488 }
489 
490 __extension__ extern __inline int16x2_t
491 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__ssub16(int16x2_t __a,int16x2_t __b)492 __ssub16 (int16x2_t __a, int16x2_t __b)
493 {
494   return __builtin_arm_ssub16 (__a, __b);
495 }
496 
497 __extension__ extern __inline uint16x2_t
498 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uadd16(uint16x2_t __a,uint16x2_t __b)499 __uadd16 (uint16x2_t __a, uint16x2_t __b)
500 {
501   return __builtin_arm_uadd16 (__a, __b);
502 }
503 
504 __extension__ extern __inline uint16x2_t
505 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__uasx(uint16x2_t __a,uint16x2_t __b)506 __uasx (uint16x2_t __a, uint16x2_t __b)
507 {
508   return __builtin_arm_uasx (__a, __b);
509 }
510 
511 __extension__ extern __inline uint16x2_t
512 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__usax(uint16x2_t __a,uint16x2_t __b)513 __usax (uint16x2_t __a, uint16x2_t __b)
514 {
515   return __builtin_arm_usax (__a, __b);
516 }
517 
518 __extension__ extern __inline uint16x2_t
519 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__usub16(uint16x2_t __a,uint16x2_t __b)520 __usub16 (uint16x2_t __a, uint16x2_t __b)
521 {
522   return __builtin_arm_usub16 (__a, __b);
523 }
524 
525 __extension__ extern __inline int32_t
526 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlad(int16x2_t __a,int16x2_t __b,int32_t __c)527 __smlad (int16x2_t __a, int16x2_t __b, int32_t __c)
528 {
529   return __builtin_arm_smlad (__a, __b, __c);
530 }
531 
532 __extension__ extern __inline int32_t
533 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smladx(int16x2_t __a,int16x2_t __b,int32_t __c)534 __smladx (int16x2_t __a, int16x2_t __b, int32_t __c)
535 {
536   return __builtin_arm_smladx (__a, __b, __c);
537 }
538 
539 __extension__ extern __inline int32_t
540 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlsd(int16x2_t __a,int16x2_t __b,int32_t __c)541 __smlsd (int16x2_t __a, int16x2_t __b, int32_t __c)
542 {
543   return __builtin_arm_smlsd (__a, __b, __c);
544 }
545 
546 __extension__ extern __inline int32_t
547 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlsdx(int16x2_t __a,int16x2_t __b,int32_t __c)548 __smlsdx (int16x2_t __a, int16x2_t __b, int32_t __c)
549 {
550   return __builtin_arm_smlsdx (__a, __b, __c);
551 }
552 
553 __extension__ extern __inline int32_t
554 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smuad(int16x2_t __a,int16x2_t __b)555 __smuad (int16x2_t __a, int16x2_t __b)
556 {
557   return __builtin_arm_smuad (__a, __b);
558 }
559 
560 __extension__ extern __inline int32_t
561 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smuadx(int16x2_t __a,int16x2_t __b)562 __smuadx (int16x2_t __a, int16x2_t __b)
563 {
564   return __builtin_arm_smuadx (__a, __b);
565 }
566 
567 #define __ssat16(__a, __sat)					\
568   __extension__							\
569   ({								\
570     int16x2_t __arg = (__a);					\
571     __builtin_sat_imm_check (__sat, 1, 16);			\
572     int16x2_t __res = __builtin_arm_ssat16 (__arg, __sat);	\
573     __res;							\
574   })
575 
576 #define __usat16(__a, __sat)					\
577   __extension__							\
578   ({								\
579     int16x2_t __arg = (__a);					\
580     __builtin_sat_imm_check (__sat, 0, 15);			\
581     int16x2_t __res = __builtin_arm_usat16 (__arg, __sat);	\
582     __res;							\
583   })
584 
585 #endif
586 
587 #ifdef __ARM_FEATURE_SAT
588 
589 #define __ssat(__a, __sat)				\
590   __extension__						\
591   ({							\
592     int32_t __arg = (__a);				\
593     __builtin_sat_imm_check (__sat, 1, 32);		\
594     int32_t __res = __builtin_arm_ssat (__arg, __sat);	\
595     __res;						\
596   })
597 
598 #define __usat(__a, __sat)				\
599   __extension__						\
600   ({							\
601     int32_t __arg = (__a);				\
602     __builtin_sat_imm_check (__sat, 0, 31);		\
603     uint32_t __res = __builtin_arm_usat (__arg, __sat);	\
604     __res;						\
605   })
606 
607 #endif
608 
609 #ifdef __ARM_FEATURE_QBIT
610 __extension__ extern __inline void
611 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__ignore_saturation(void)612 __ignore_saturation (void)
613 {
614   /* ACLE designates this intrinsic as a hint.
615      Implement as a nop for now.  */
616 }
617 
618 /* These are defined as macros because the implementation of the builtins
619    requires easy access to the current function so wrapping it in an
620    always_inline function complicates things.  */
621 
622 #define __saturation_occurred __builtin_arm_saturation_occurred
623 
624 #define __set_saturation_occurred(__a)			\
625   __extension__						\
626   ({							\
627     int __arg = (__a);					\
628     __builtin_arm_set_saturation (__arg);		\
629   })
630 #endif
631 
632 #ifdef __ARM_FEATURE_DSP
633 __extension__ extern __inline int32_t
634 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__qadd(int32_t __a,int32_t __b)635 __qadd (int32_t __a, int32_t __b)
636 {
637   return __builtin_arm_qadd (__a, __b);
638 }
639 
640 __extension__ extern __inline int32_t
641 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__qsub(int32_t __a,int32_t __b)642 __qsub (int32_t __a, int32_t __b)
643 {
644   return __builtin_arm_qsub (__a, __b);
645 }
646 
647 __extension__ extern __inline int32_t
648 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__qdbl(int32_t __x)649 __qdbl (int32_t __x)
650 {
651   return __qadd (__x, __x);
652 }
653 
654 __extension__ extern __inline int32_t
655 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__smlabb(int32_t __a,int32_t __b,int32_t __c)656 __smlabb (int32_t __a, int32_t __b, int32_t __c)
657 {
658   return __builtin_arm_smlabb (__a, __b, __c);
659 }
660 
661 __extension__ extern __inline int32_t
662 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__smlatb(int32_t __a,int32_t __b,int32_t __c)663 __smlatb (int32_t __a, int32_t __b, int32_t __c)
664 {
665   return __builtin_arm_smlatb (__a, __b, __c);
666 }
667 
668 /* smlatb is equivalent to smlabt with the two multiplication operands
669    swapped around.  */
670 __extension__ extern __inline int32_t
671 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__smlabt(int32_t __a,int32_t __b,int32_t __c)672 __smlabt (int32_t __a, int32_t __b, int32_t __c)
673 {
674   return __smlatb (__b, __a, __c);
675 }
676 
677 __extension__ extern __inline int32_t
678 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
__smlatt(int32_t __a,int32_t __b,int32_t __c)679 __smlatt (int32_t __a, int32_t __b, int32_t __c)
680 {
681   return __builtin_arm_smlatt (__a, __b, __c);
682 }
683 
684 __extension__ extern __inline int32_t
685 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlawb(int32_t __a,int32_t __b,int32_t __c)686 __smlawb (int32_t __a, int32_t __b, int32_t __c)
687 {
688   return __builtin_arm_smlawb (__a, __b, __c);
689 }
690 
691 __extension__ extern __inline int32_t
692 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__smlawt(int32_t __a,int32_t __b,int32_t __c)693 __smlawt (int32_t __a, int32_t __b, int32_t __c)
694 {
695   return __builtin_arm_smlawt (__a, __b, __c);
696 }
697 #endif
698 
699 #pragma GCC push_options
700 #ifdef __ARM_FEATURE_CRC32
701 #ifdef __ARM_FP
702 #pragma GCC target ("arch=armv8-a+crc+simd")
703 #else
704 #pragma GCC target ("arch=armv8-a+crc")
705 #endif
706 
707 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32b(uint32_t __a,uint8_t __b)708 __crc32b (uint32_t __a, uint8_t __b)
709 {
710   return __builtin_arm_crc32b (__a, __b);
711 }
712 
713 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32h(uint32_t __a,uint16_t __b)714 __crc32h (uint32_t __a, uint16_t __b)
715 {
716   return __builtin_arm_crc32h (__a, __b);
717 }
718 
719 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32w(uint32_t __a,uint32_t __b)720 __crc32w (uint32_t __a, uint32_t __b)
721 {
722   return __builtin_arm_crc32w (__a, __b);
723 }
724 
725 #ifdef __ARM_32BIT_STATE
726 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32d(uint32_t __a,uint64_t __b)727 __crc32d (uint32_t __a, uint64_t __b)
728 {
729   uint32_t __d;
730 
731   __d = __crc32w (__crc32w (__a, __b & 0xffffffffULL), __b >> 32);
732   return __d;
733 }
734 #endif
735 
736 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32cb(uint32_t __a,uint8_t __b)737 __crc32cb (uint32_t __a, uint8_t __b)
738 {
739   return __builtin_arm_crc32cb (__a, __b);
740 }
741 
742 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32ch(uint32_t __a,uint16_t __b)743 __crc32ch (uint32_t __a, uint16_t __b)
744 {
745   return __builtin_arm_crc32ch (__a, __b);
746 }
747 
748 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32cw(uint32_t __a,uint32_t __b)749 __crc32cw (uint32_t __a, uint32_t __b)
750 {
751   return __builtin_arm_crc32cw (__a, __b);
752 }
753 
754 #ifdef __ARM_32BIT_STATE
755 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32cd(uint32_t __a,uint64_t __b)756 __crc32cd (uint32_t __a, uint64_t __b)
757 {
758   uint32_t __d;
759 
760   __d = __crc32cw (__crc32cw (__a, __b & 0xffffffffULL), __b >> 32);
761   return __d;
762 }
763 #endif
764 
765 #endif /* __ARM_FEATURE_CRC32  */
766 #pragma GCC pop_options
767 
768 #ifdef __cplusplus
769 }
770 #endif
771 
772 #endif
773