]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/arm/arm_acle.h
[ARM] Implement support for ACLE Coprocessor CDP intrinsics
[thirdparty/gcc.git] / gcc / config / arm / arm_acle.h
1 /* ARM Non-NEON ACLE intrinsics include file.
2
3 Copyright (C) 2013-2017 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__))
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 return __builtin_arm_cdp (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
42 }
43
44 #if __ARM_ARCH >= 5
45 __extension__ static __inline void __attribute__ ((__always_inline__))
46 __arm_cdp2 (const unsigned int __coproc, const unsigned int __opc1,
47 const unsigned int __CRd, const unsigned int __CRn,
48 const unsigned int __CRm, const unsigned int __opc2)
49 {
50 return __builtin_arm_cdp2 (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
51 }
52 #endif /* __ARM_ARCH >= 5. */
53 #endif /* (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4. */
54
55 #ifdef __ARM_FEATURE_CRC32
56 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
57 __crc32b (uint32_t __a, uint8_t __b)
58 {
59 return __builtin_arm_crc32b (__a, __b);
60 }
61
62 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
63 __crc32h (uint32_t __a, uint16_t __b)
64 {
65 return __builtin_arm_crc32h (__a, __b);
66 }
67
68 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
69 __crc32w (uint32_t __a, uint32_t __b)
70 {
71 return __builtin_arm_crc32w (__a, __b);
72 }
73
74 #ifdef __ARM_32BIT_STATE
75 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
76 __crc32d (uint32_t __a, uint64_t __b)
77 {
78 uint32_t __d;
79
80 __d = __crc32w (__crc32w (__a, __b & 0xffffffffULL), __b >> 32);
81 return __d;
82 }
83 #endif
84
85 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
86 __crc32cb (uint32_t __a, uint8_t __b)
87 {
88 return __builtin_arm_crc32cb (__a, __b);
89 }
90
91 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
92 __crc32ch (uint32_t __a, uint16_t __b)
93 {
94 return __builtin_arm_crc32ch (__a, __b);
95 }
96
97 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
98 __crc32cw (uint32_t __a, uint32_t __b)
99 {
100 return __builtin_arm_crc32cw (__a, __b);
101 }
102
103 #ifdef __ARM_32BIT_STATE
104 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
105 __crc32cd (uint32_t __a, uint64_t __b)
106 {
107 uint32_t __d;
108
109 __d = __crc32cw (__crc32cw (__a, __b & 0xffffffffULL), __b >> 32);
110 return __d;
111 }
112 #endif
113
114 #endif
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif