[PR testsuite/116860] Testsuite adjustment for recently added tests
[official-gcc.git] / gcc / config / arm / arm_acle.h
blobc6c03fdce27976fa33a46d6a97d733a50d75326b
1 /* ARM Non-NEON ACLE intrinsics include file.
3 Copyright (C) 2013-2025 Free Software Foundation, Inc.
4 Contributed by ARM Ltd.
6 This file is part of GCC.
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.
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.
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.
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/>. */
27 #ifndef _GCC_ARM_ACLE_H
28 #define _GCC_ARM_ACLE_H
30 #include <stdint.h>
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #define _GCC_ARM_ACLE_ROR_FN(NAME, TYPE) \
37 __extension__ extern __inline TYPE \
38 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \
39 NAME (TYPE __value, uint32_t __rotate) \
40 { \
41 int __size = (int) sizeof (TYPE) * __CHAR_BIT__; \
42 __rotate = __rotate % __size; \
43 return __value >> __rotate | __value << ((__size - __rotate) % __size); \
46 _GCC_ARM_ACLE_ROR_FN (__ror, uint32_t)
47 _GCC_ARM_ACLE_ROR_FN (__rorl, unsigned long)
48 _GCC_ARM_ACLE_ROR_FN (__rorll, uint64_t)
50 #undef _GCC_ARM_ACLE_ROR_FN
52 #define _GCC_ARM_ACLE_DATA_FN(NAME, ITYPE, RTYPE) \
53 __extension__ extern __inline RTYPE \
54 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \
55 __##NAME (ITYPE __value)
57 #define _GCC_ARM_ACLE_DATA_ALIAS(NAME, BUILTIN, ITYPE, RTYPE) \
58 _GCC_ARM_ACLE_DATA_FN(NAME, ITYPE, RTYPE) \
59 { \
60 return __builtin_##BUILTIN (__value); \
63 _GCC_ARM_ACLE_DATA_ALIAS (clz, clz, uint32_t, unsigned int)
64 _GCC_ARM_ACLE_DATA_ALIAS (clzl, clzl, unsigned long, unsigned int)
65 _GCC_ARM_ACLE_DATA_ALIAS (clzll, clzll, uint64_t, unsigned int)
66 _GCC_ARM_ACLE_DATA_ALIAS (cls, clrsb, uint32_t, unsigned int)
67 _GCC_ARM_ACLE_DATA_ALIAS (clsl, clrsbl, unsigned long, unsigned int)
68 _GCC_ARM_ACLE_DATA_ALIAS (clsll, clrsbll, uint64_t, unsigned int)
69 _GCC_ARM_ACLE_DATA_ALIAS (revsh, bswap16, int16_t, int16_t)
70 _GCC_ARM_ACLE_DATA_ALIAS (rev, bswap32, uint32_t, uint32_t)
71 _GCC_ARM_ACLE_DATA_ALIAS (revl, bswap32, unsigned long, unsigned long)
72 _GCC_ARM_ACLE_DATA_ALIAS (revll, bswap64, uint64_t, uint64_t)
73 #if __ARM_ARCH >= 6
74 _GCC_ARM_ACLE_DATA_ALIAS (rev16, arm_rev16si2, uint32_t, uint32_t)
75 _GCC_ARM_ACLE_DATA_ALIAS (rev16l, arm_rev16si2, unsigned long, unsigned long)
76 #else
77 _GCC_ARM_ACLE_DATA_FN(rev16, uint32_t, uint32_t) {
78 return ((__value & 0xff00ff) << 8 | (__value & 0xff00ff00) >> 8);
80 _GCC_ARM_ACLE_DATA_FN(rev16l, unsigned long, unsigned long) {
81 return ((__value & 0xff00ff) << 8 | (__value & 0xff00ff00) >> 8);
83 #endif
84 _GCC_ARM_ACLE_DATA_FN(rev16ll, uint64_t, uint64_t) {
85 return __rev16l(__value) | (uint64_t)__rev16l(__value >> 32) << 32;
88 #if __ARM_ARCH_6T2__ || __ARM_ARCH >= 7
89 _GCC_ARM_ACLE_DATA_ALIAS (rbit, arm_rbit, uint32_t, uint32_t)
90 _GCC_ARM_ACLE_DATA_ALIAS (rbitl, arm_rbit, unsigned long, unsigned int)
91 _GCC_ARM_ACLE_DATA_FN(rbitll, uint64_t, uint64_t) {
92 return ((uint64_t)__rbit(__value) << 32) | __rbit(__value >> 32);
94 #endif
96 #undef _GCC_ARM_ACLE_DATA_ALIAS
97 #undef _GCC_ARM_ACLE_DATA_FN
99 #if (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4
100 __extension__ static __inline void __attribute__ ((__always_inline__))
101 __arm_cdp (const unsigned int __coproc, const unsigned int __opc1,
102 const unsigned int __CRd, const unsigned int __CRn,
103 const unsigned int __CRm, const unsigned int __opc2)
105 __builtin_arm_cdp (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
108 __extension__ static __inline void __attribute__ ((__always_inline__))
109 __arm_ldc (const unsigned int __coproc, const unsigned int __CRd,
110 const void * __p)
112 __builtin_arm_ldc (__coproc, __CRd, __p);
115 __extension__ static __inline void __attribute__ ((__always_inline__))
116 __arm_ldcl (const unsigned int __coproc, const unsigned int __CRd,
117 const void * __p)
119 __builtin_arm_ldcl (__coproc, __CRd, __p);
122 __extension__ static __inline void __attribute__ ((__always_inline__))
123 __arm_stc (const unsigned int __coproc, const unsigned int __CRd,
124 void * __p)
126 __builtin_arm_stc (__coproc, __CRd, __p);
129 __extension__ static __inline void __attribute__ ((__always_inline__))
130 __arm_stcl (const unsigned int __coproc, const unsigned int __CRd,
131 void * __p)
133 __builtin_arm_stcl (__coproc, __CRd, __p);
136 __extension__ static __inline void __attribute__ ((__always_inline__))
137 __arm_mcr (const unsigned int __coproc, const unsigned int __opc1,
138 uint32_t __value, const unsigned int __CRn, const unsigned int __CRm,
139 const unsigned int __opc2)
141 __builtin_arm_mcr (__coproc, __opc1, __value, __CRn, __CRm, __opc2);
144 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
145 __arm_mrc (const unsigned int __coproc, const unsigned int __opc1,
146 const unsigned int __CRn, const unsigned int __CRm,
147 const unsigned int __opc2)
149 return __builtin_arm_mrc (__coproc, __opc1, __CRn, __CRm, __opc2);
151 #if __ARM_ARCH >= 5
152 __extension__ static __inline void __attribute__ ((__always_inline__))
153 __arm_cdp2 (const unsigned int __coproc, const unsigned int __opc1,
154 const unsigned int __CRd, const unsigned int __CRn,
155 const unsigned int __CRm, const unsigned int __opc2)
157 __builtin_arm_cdp2 (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
160 __extension__ static __inline void __attribute__ ((__always_inline__))
161 __arm_ldc2 (const unsigned int __coproc, const unsigned int __CRd,
162 const void * __p)
164 __builtin_arm_ldc2 (__coproc, __CRd, __p);
167 __extension__ static __inline void __attribute__ ((__always_inline__))
168 __arm_ldc2l (const unsigned int __coproc, const unsigned int __CRd,
169 const void * __p)
171 __builtin_arm_ldc2l (__coproc, __CRd, __p);
174 __extension__ static __inline void __attribute__ ((__always_inline__))
175 __arm_stc2 (const unsigned int __coproc, const unsigned int __CRd,
176 void * __p)
178 __builtin_arm_stc2 (__coproc, __CRd, __p);
181 __extension__ static __inline void __attribute__ ((__always_inline__))
182 __arm_stc2l (const unsigned int __coproc, const unsigned int __CRd,
183 void * __p)
185 __builtin_arm_stc2l (__coproc, __CRd, __p);
188 __extension__ static __inline void __attribute__ ((__always_inline__))
189 __arm_mcr2 (const unsigned int __coproc, const unsigned int __opc1,
190 uint32_t __value, const unsigned int __CRn,
191 const unsigned int __CRm, const unsigned int __opc2)
193 __builtin_arm_mcr2 (__coproc, __opc1, __value, __CRn, __CRm, __opc2);
196 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
197 __arm_mrc2 (const unsigned int __coproc, const unsigned int __opc1,
198 const unsigned int __CRn, const unsigned int __CRm,
199 const unsigned int __opc2)
201 return __builtin_arm_mrc2 (__coproc, __opc1, __CRn, __CRm, __opc2);
204 #if __ARM_ARCH >= 6 || defined (__ARM_ARCH_5TE__)
206 __extension__ static __inline void __attribute__ ((__always_inline__))
207 __arm_mcrr (const unsigned int __coproc, const unsigned int __opc1,
208 uint64_t __value, const unsigned int __CRm)
210 __builtin_arm_mcrr (__coproc, __opc1, __value, __CRm);
213 __extension__ static __inline uint64_t __attribute__ ((__always_inline__))
214 __arm_mrrc (const unsigned int __coproc, const unsigned int __opc1,
215 const unsigned int __CRm)
217 return __builtin_arm_mrrc (__coproc, __opc1, __CRm);
220 #if __ARM_ARCH >= 6
222 __extension__ static __inline void __attribute__ ((__always_inline__))
223 __arm_mcrr2 (const unsigned int __coproc, const unsigned int __opc1,
224 uint64_t __value, const unsigned int __CRm)
226 __builtin_arm_mcrr2 (__coproc, __opc1, __value, __CRm);
229 __extension__ static __inline uint64_t __attribute__ ((__always_inline__))
230 __arm_mrrc2 (const unsigned int __coproc, const unsigned int __opc1,
231 const unsigned int __CRm)
233 return __builtin_arm_mrrc2 (__coproc, __opc1, __CRm);
235 #endif /* __ARM_ARCH >= 6. */
236 #endif /* __ARM_ARCH >= 6 || defined (__ARM_ARCH_5TE__). */
237 #endif /* __ARM_ARCH >= 5. */
238 #endif /* (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4. */
240 #ifdef __ARM_FEATURE_SIMD32
241 typedef int32_t int16x2_t;
242 typedef uint32_t uint16x2_t;
243 typedef int32_t int8x4_t;
244 typedef uint32_t uint8x4_t;
246 __extension__ extern __inline int16x2_t
247 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
248 __sxtab16 (int16x2_t __a, int8x4_t __b)
250 return __builtin_arm_sxtab16 (__a, __b);
253 __extension__ extern __inline int16x2_t
254 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
255 __sxtb16 (int8x4_t __a)
257 return __builtin_arm_sxtb16 (__a);
260 __extension__ extern __inline uint16x2_t
261 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
262 __uxtab16 (uint16x2_t __a, uint8x4_t __b)
264 return __builtin_arm_uxtab16 (__a, __b);
267 __extension__ extern __inline uint16x2_t
268 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
269 __uxtb16 (uint8x4_t __a)
271 return __builtin_arm_uxtb16 (__a);
274 __extension__ extern __inline int8x4_t
275 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
276 __qadd8 (int8x4_t __a, int8x4_t __b)
278 return __builtin_arm_qadd8 (__a, __b);
281 __extension__ extern __inline int8x4_t
282 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
283 __qsub8 (int8x4_t __a, int8x4_t __b)
285 return __builtin_arm_qsub8 (__a, __b);
288 __extension__ extern __inline int8x4_t
289 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
290 __shadd8 (int8x4_t __a, int8x4_t __b)
292 return __builtin_arm_shadd8 (__a, __b);
295 __extension__ extern __inline int8x4_t
296 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
297 __shsub8 (int8x4_t __a, int8x4_t __b)
299 return __builtin_arm_shsub8 (__a, __b);
302 __extension__ extern __inline uint8x4_t
303 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
304 __uhadd8 (uint8x4_t __a, uint8x4_t __b)
306 return __builtin_arm_uhadd8 (__a, __b);
309 __extension__ extern __inline uint8x4_t
310 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
311 __uhsub8 (uint8x4_t __a, uint8x4_t __b)
313 return __builtin_arm_uhsub8 (__a, __b);
316 __extension__ extern __inline uint8x4_t
317 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
318 __uqadd8 (uint8x4_t __a, uint8x4_t __b)
320 return __builtin_arm_uqadd8 (__a, __b);
323 __extension__ extern __inline uint8x4_t
324 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
325 __uqsub8 (uint8x4_t __a, uint8x4_t __b)
327 return __builtin_arm_uqsub8 (__a, __b);
330 __extension__ extern __inline int16x2_t
331 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
332 __qadd16 (int16x2_t __a, int16x2_t __b)
334 return __builtin_arm_qadd16 (__a, __b);
337 __extension__ extern __inline int16x2_t
338 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
339 __qasx (int16x2_t __a, int16x2_t __b)
341 return __builtin_arm_qasx (__a, __b);
344 __extension__ extern __inline int16x2_t
345 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
346 __qsax (int16x2_t __a, int16x2_t __b)
348 return __builtin_arm_qsax (__a, __b);
351 __extension__ extern __inline int16x2_t
352 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
353 __qsub16 (int16x2_t __a, int16x2_t __b)
355 return __builtin_arm_qsub16 (__a, __b);
358 __extension__ extern __inline int16x2_t
359 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
360 __shadd16 (int16x2_t __a, int16x2_t __b)
362 return __builtin_arm_shadd16 (__a, __b);
365 __extension__ extern __inline int16x2_t
366 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
367 __shasx (int16x2_t __a, int16x2_t __b)
369 return __builtin_arm_shasx (__a, __b);
372 __extension__ extern __inline int16x2_t
373 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
374 __shsax (int16x2_t __a, int16x2_t __b)
376 return __builtin_arm_shsax (__a, __b);
379 __extension__ extern __inline int16x2_t
380 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
381 __shsub16 (int16x2_t __a, int16x2_t __b)
383 return __builtin_arm_shsub16 (__a, __b);
386 __extension__ extern __inline uint16x2_t
387 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
388 __uhadd16 (uint16x2_t __a, uint16x2_t __b)
390 return __builtin_arm_uhadd16 (__a, __b);
393 __extension__ extern __inline uint16x2_t
394 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
395 __uhasx (uint16x2_t __a, uint16x2_t __b)
397 return __builtin_arm_uhasx (__a, __b);
400 __extension__ extern __inline uint16x2_t
401 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
402 __uhsax (uint16x2_t __a, uint16x2_t __b)
404 return __builtin_arm_uhsax (__a, __b);
407 __extension__ extern __inline uint16x2_t
408 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
409 __uhsub16 (uint16x2_t __a, uint16x2_t __b)
411 return __builtin_arm_uhsub16 (__a, __b);
414 __extension__ extern __inline uint16x2_t
415 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
416 __uqadd16 (uint16x2_t __a, uint16x2_t __b)
418 return __builtin_arm_uqadd16 (__a, __b);
421 __extension__ extern __inline uint16x2_t
422 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
423 __uqasx (uint16x2_t __a, uint16x2_t __b)
425 return __builtin_arm_uqasx (__a, __b);
428 __extension__ extern __inline uint16x2_t
429 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
430 __uqsax (uint16x2_t __a, uint16x2_t __b)
432 return __builtin_arm_uqsax (__a, __b);
435 __extension__ extern __inline uint16x2_t
436 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
437 __uqsub16 (uint16x2_t __a, uint16x2_t __b)
439 return __builtin_arm_uqsub16 (__a, __b);
442 __extension__ extern __inline int32_t
443 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
444 __smusd (int16x2_t __a, int16x2_t __b)
446 return __builtin_arm_smusd (__a, __b);
449 __extension__ extern __inline int32_t
450 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
451 __smusdx (int16x2_t __a, int16x2_t __b)
453 return __builtin_arm_smusdx (__a, __b);
456 __extension__ extern __inline uint32_t
457 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
458 __usad8 (uint8x4_t __a, uint8x4_t __b)
460 return __builtin_arm_usad8 (__a, __b);
463 __extension__ extern __inline uint32_t
464 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
465 __usada8 (uint8x4_t __a, uint8x4_t __b, uint32_t __c)
467 return __builtin_arm_usada8 (__a, __b, __c);
470 __extension__ extern __inline int64_t
471 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
472 __smlald (int16x2_t __a, int16x2_t __b, int64_t __c)
474 return __builtin_arm_smlald (__a, __b, __c);
477 __extension__ extern __inline int64_t
478 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
479 __smlaldx (int16x2_t __a, int16x2_t __b, int64_t __c)
481 return __builtin_arm_smlaldx (__a, __b, __c);
484 __extension__ extern __inline int64_t
485 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
486 __smlsld (int16x2_t __a, int16x2_t __b, int64_t __c)
488 return __builtin_arm_smlsld (__a, __b, __c);
491 __extension__ extern __inline int64_t
492 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
493 __smlsldx (int16x2_t __a, int16x2_t __b, int64_t __c)
495 return __builtin_arm_smlsldx (__a, __b, __c);
498 __extension__ extern __inline uint8x4_t
499 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
500 __sel (uint8x4_t __a, uint8x4_t __b)
502 return __builtin_arm_sel (__a, __b);
505 __extension__ extern __inline int8x4_t
506 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
507 __sadd8 (int8x4_t __a, int8x4_t __b)
509 return __builtin_arm_sadd8 (__a, __b);
512 __extension__ extern __inline int8x4_t
513 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
514 __ssub8 (int8x4_t __a, int8x4_t __b)
516 return __builtin_arm_ssub8 (__a, __b);
519 __extension__ extern __inline uint8x4_t
520 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
521 __uadd8 (uint8x4_t __a, uint8x4_t __b)
523 return __builtin_arm_uadd8 (__a, __b);
526 __extension__ extern __inline uint8x4_t
527 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
528 __usub8 (uint8x4_t __a, uint8x4_t __b)
530 return __builtin_arm_usub8 (__a, __b);
533 __extension__ extern __inline int16x2_t
534 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
535 __sadd16 (int16x2_t __a, int16x2_t __b)
537 return __builtin_arm_sadd16 (__a, __b);
540 __extension__ extern __inline int16x2_t
541 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
542 __sasx (int16x2_t __a, int16x2_t __b)
544 return __builtin_arm_sasx (__a, __b);
547 __extension__ extern __inline int16x2_t
548 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
549 __ssax (int16x2_t __a, int16x2_t __b)
551 return __builtin_arm_ssax (__a, __b);
554 __extension__ extern __inline int16x2_t
555 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
556 __ssub16 (int16x2_t __a, int16x2_t __b)
558 return __builtin_arm_ssub16 (__a, __b);
561 __extension__ extern __inline uint16x2_t
562 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
563 __uadd16 (uint16x2_t __a, uint16x2_t __b)
565 return __builtin_arm_uadd16 (__a, __b);
568 __extension__ extern __inline uint16x2_t
569 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
570 __uasx (uint16x2_t __a, uint16x2_t __b)
572 return __builtin_arm_uasx (__a, __b);
575 __extension__ extern __inline uint16x2_t
576 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
577 __usax (uint16x2_t __a, uint16x2_t __b)
579 return __builtin_arm_usax (__a, __b);
582 __extension__ extern __inline uint16x2_t
583 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
584 __usub16 (uint16x2_t __a, uint16x2_t __b)
586 return __builtin_arm_usub16 (__a, __b);
589 __extension__ extern __inline int32_t
590 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
591 __smlad (int16x2_t __a, int16x2_t __b, int32_t __c)
593 return __builtin_arm_smlad (__a, __b, __c);
596 __extension__ extern __inline int32_t
597 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
598 __smladx (int16x2_t __a, int16x2_t __b, int32_t __c)
600 return __builtin_arm_smladx (__a, __b, __c);
603 __extension__ extern __inline int32_t
604 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
605 __smlsd (int16x2_t __a, int16x2_t __b, int32_t __c)
607 return __builtin_arm_smlsd (__a, __b, __c);
610 __extension__ extern __inline int32_t
611 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
612 __smlsdx (int16x2_t __a, int16x2_t __b, int32_t __c)
614 return __builtin_arm_smlsdx (__a, __b, __c);
617 __extension__ extern __inline int32_t
618 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
619 __smuad (int16x2_t __a, int16x2_t __b)
621 return __builtin_arm_smuad (__a, __b);
624 __extension__ extern __inline int32_t
625 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
626 __smuadx (int16x2_t __a, int16x2_t __b)
628 return __builtin_arm_smuadx (__a, __b);
631 #define __ssat16(__a, __sat) \
632 __extension__ \
633 ({ \
634 int16x2_t __arg = (__a); \
635 __builtin_sat_imm_check (__sat, 1, 16); \
636 int16x2_t __res = __builtin_arm_ssat16 (__arg, __sat); \
637 __res; \
640 #define __usat16(__a, __sat) \
641 __extension__ \
642 ({ \
643 int16x2_t __arg = (__a); \
644 __builtin_sat_imm_check (__sat, 0, 15); \
645 int16x2_t __res = __builtin_arm_usat16 (__arg, __sat); \
646 __res; \
649 #endif
651 #ifdef __ARM_FEATURE_SAT
653 #define __ssat(__a, __sat) \
654 __extension__ \
655 ({ \
656 int32_t __arg = (__a); \
657 __builtin_sat_imm_check (__sat, 1, 32); \
658 int32_t __res = __builtin_arm_ssat (__arg, __sat); \
659 __res; \
662 #define __usat(__a, __sat) \
663 __extension__ \
664 ({ \
665 int32_t __arg = (__a); \
666 __builtin_sat_imm_check (__sat, 0, 31); \
667 uint32_t __res = __builtin_arm_usat (__arg, __sat); \
668 __res; \
671 #endif
673 #ifdef __ARM_FEATURE_QBIT
674 __extension__ extern __inline void
675 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
676 __ignore_saturation (void)
678 /* ACLE designates this intrinsic as a hint.
679 Implement as a nop for now. */
682 /* These are defined as macros because the implementation of the builtins
683 requires easy access to the current function so wrapping it in an
684 always_inline function complicates things. */
686 #define __saturation_occurred __builtin_arm_saturation_occurred
688 #define __set_saturation_occurred(__a) \
689 __extension__ \
690 ({ \
691 int __arg = (__a); \
692 __builtin_arm_set_saturation (__arg); \
694 #endif
696 #ifdef __ARM_FEATURE_DSP
697 __extension__ extern __inline int32_t
698 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
699 __qadd (int32_t __a, int32_t __b)
701 return __builtin_arm_qadd (__a, __b);
704 __extension__ extern __inline int32_t
705 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
706 __qsub (int32_t __a, int32_t __b)
708 return __builtin_arm_qsub (__a, __b);
711 __extension__ extern __inline int32_t
712 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
713 __qdbl (int32_t __x)
715 return __qadd (__x, __x);
718 __extension__ extern __inline int32_t
719 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
720 __smlabb (int32_t __a, int32_t __b, int32_t __c)
722 return __builtin_arm_smlabb (__a, __b, __c);
725 __extension__ extern __inline int32_t
726 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
727 __smlatb (int32_t __a, int32_t __b, int32_t __c)
729 return __builtin_arm_smlatb (__a, __b, __c);
732 /* smlatb is equivalent to smlabt with the two multiplication operands
733 swapped around. */
734 __extension__ extern __inline int32_t
735 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
736 __smlabt (int32_t __a, int32_t __b, int32_t __c)
738 return __smlatb (__b, __a, __c);
741 __extension__ extern __inline int32_t
742 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
743 __smlatt (int32_t __a, int32_t __b, int32_t __c)
745 return __builtin_arm_smlatt (__a, __b, __c);
748 __extension__ extern __inline int32_t
749 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
750 __smlawb (int32_t __a, int32_t __b, int32_t __c)
752 return __builtin_arm_smlawb (__a, __b, __c);
755 __extension__ extern __inline int32_t
756 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
757 __smlawt (int32_t __a, int32_t __b, int32_t __c)
759 return __builtin_arm_smlawt (__a, __b, __c);
761 #endif
763 #pragma GCC push_options
764 #ifdef __ARM_FEATURE_CRC32
765 #ifdef __ARM_FP
766 #pragma GCC target ("arch=armv8-a+crc+simd")
767 #else
768 #pragma GCC target ("arch=armv8-a+crc")
769 #endif
771 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
772 __crc32b (uint32_t __a, uint8_t __b)
774 return __builtin_arm_crc32b (__a, __b);
777 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
778 __crc32h (uint32_t __a, uint16_t __b)
780 return __builtin_arm_crc32h (__a, __b);
783 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
784 __crc32w (uint32_t __a, uint32_t __b)
786 return __builtin_arm_crc32w (__a, __b);
789 #ifdef __ARM_32BIT_STATE
790 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
791 __crc32d (uint32_t __a, uint64_t __b)
793 uint32_t __d;
795 __d = __crc32w (__crc32w (__a, __b & 0xffffffffULL), __b >> 32);
796 return __d;
798 #endif
800 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
801 __crc32cb (uint32_t __a, uint8_t __b)
803 return __builtin_arm_crc32cb (__a, __b);
806 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
807 __crc32ch (uint32_t __a, uint16_t __b)
809 return __builtin_arm_crc32ch (__a, __b);
812 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
813 __crc32cw (uint32_t __a, uint32_t __b)
815 return __builtin_arm_crc32cw (__a, __b);
818 #ifdef __ARM_32BIT_STATE
819 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
820 __crc32cd (uint32_t __a, uint64_t __b)
822 uint32_t __d;
824 __d = __crc32cw (__crc32cw (__a, __b & 0xffffffffULL), __b >> 32);
825 return __d;
827 #endif
829 #endif /* __ARM_FEATURE_CRC32 */
830 #pragma GCC pop_options
832 #ifdef __cplusplus
834 #endif
836 #endif