1 /* ARM Non-NEON ACLE intrinsics include file.
3 Copyright (C) 2013-2018 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
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
)
41 return __builtin_arm_cdp (__coproc
, __opc1
, __CRd
, __CRn
, __CRm
, __opc2
);
44 __extension__
static __inline
void __attribute__ ((__always_inline__
))
45 __arm_ldc (const unsigned int __coproc
, const unsigned int __CRd
,
48 return __builtin_arm_ldc (__coproc
, __CRd
, __p
);
51 __extension__
static __inline
void __attribute__ ((__always_inline__
))
52 __arm_ldcl (const unsigned int __coproc
, const unsigned int __CRd
,
55 return __builtin_arm_ldcl (__coproc
, __CRd
, __p
);
58 __extension__
static __inline
void __attribute__ ((__always_inline__
))
59 __arm_stc (const unsigned int __coproc
, const unsigned int __CRd
,
62 return __builtin_arm_stc (__coproc
, __CRd
, __p
);
65 __extension__
static __inline
void __attribute__ ((__always_inline__
))
66 __arm_stcl (const unsigned int __coproc
, const unsigned int __CRd
,
69 return __builtin_arm_stcl (__coproc
, __CRd
, __p
);
72 __extension__
static __inline
void __attribute__ ((__always_inline__
))
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
)
77 return __builtin_arm_mcr (__coproc
, __opc1
, __value
, __CRn
, __CRm
, __opc2
);
80 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
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
)
85 return __builtin_arm_mrc (__coproc
, __opc1
, __CRn
, __CRm
, __opc2
);
88 __extension__
static __inline
void __attribute__ ((__always_inline__
))
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
)
93 return __builtin_arm_cdp2 (__coproc
, __opc1
, __CRd
, __CRn
, __CRm
, __opc2
);
96 __extension__
static __inline
void __attribute__ ((__always_inline__
))
97 __arm_ldc2 (const unsigned int __coproc
, const unsigned int __CRd
,
100 return __builtin_arm_ldc2 (__coproc
, __CRd
, __p
);
103 __extension__
static __inline
void __attribute__ ((__always_inline__
))
104 __arm_ldc2l (const unsigned int __coproc
, const unsigned int __CRd
,
107 return __builtin_arm_ldc2l (__coproc
, __CRd
, __p
);
110 __extension__
static __inline
void __attribute__ ((__always_inline__
))
111 __arm_stc2 (const unsigned int __coproc
, const unsigned int __CRd
,
114 return __builtin_arm_stc2 (__coproc
, __CRd
, __p
);
117 __extension__
static __inline
void __attribute__ ((__always_inline__
))
118 __arm_stc2l (const unsigned int __coproc
, const unsigned int __CRd
,
121 return __builtin_arm_stc2l (__coproc
, __CRd
, __p
);
124 __extension__
static __inline
void __attribute__ ((__always_inline__
))
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
)
129 return __builtin_arm_mcr2 (__coproc
, __opc1
, __value
, __CRn
, __CRm
, __opc2
);
132 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
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
)
137 return __builtin_arm_mrc2 (__coproc
, __opc1
, __CRn
, __CRm
, __opc2
);
140 #if __ARM_ARCH >= 6 || defined (__ARM_ARCH_5TE__)
142 __extension__
static __inline
void __attribute__ ((__always_inline__
))
143 __arm_mcrr (const unsigned int __coproc
, const unsigned int __opc1
,
144 uint64_t __value
, const unsigned int __CRm
)
146 return __builtin_arm_mcrr (__coproc
, __opc1
, __value
, __CRm
);
149 __extension__
static __inline
uint64_t __attribute__ ((__always_inline__
))
150 __arm_mrrc (const unsigned int __coproc
, const unsigned int __opc1
,
151 const unsigned int __CRm
)
153 return __builtin_arm_mrrc (__coproc
, __opc1
, __CRm
);
158 __extension__
static __inline
void __attribute__ ((__always_inline__
))
159 __arm_mcrr2 (const unsigned int __coproc
, const unsigned int __opc1
,
160 uint64_t __value
, const unsigned int __CRm
)
162 return __builtin_arm_mcrr2 (__coproc
, __opc1
, __value
, __CRm
);
165 __extension__
static __inline
uint64_t __attribute__ ((__always_inline__
))
166 __arm_mrrc2 (const unsigned int __coproc
, const unsigned int __opc1
,
167 const unsigned int __CRm
)
169 return __builtin_arm_mrrc2 (__coproc
, __opc1
, __CRm
);
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. */
176 #pragma GCC push_options
178 #pragma GCC target ("arch=armv8-a+crc")
180 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
181 __crc32b (uint32_t __a
, uint8_t __b
)
183 return __builtin_arm_crc32b (__a
, __b
);
186 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
187 __crc32h (uint32_t __a
, uint16_t __b
)
189 return __builtin_arm_crc32h (__a
, __b
);
192 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
193 __crc32w (uint32_t __a
, uint32_t __b
)
195 return __builtin_arm_crc32w (__a
, __b
);
198 #ifdef __ARM_32BIT_STATE
199 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
200 __crc32d (uint32_t __a
, uint64_t __b
)
204 __d
= __crc32w (__crc32w (__a
, __b
& 0xffffffffULL
), __b
>> 32);
209 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
210 __crc32cb (uint32_t __a
, uint8_t __b
)
212 return __builtin_arm_crc32cb (__a
, __b
);
215 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
216 __crc32ch (uint32_t __a
, uint16_t __b
)
218 return __builtin_arm_crc32ch (__a
, __b
);
221 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
222 __crc32cw (uint32_t __a
, uint32_t __b
)
224 return __builtin_arm_crc32cw (__a
, __b
);
227 #ifdef __ARM_32BIT_STATE
228 __extension__
static __inline
uint32_t __attribute__ ((__always_inline__
))
229 __crc32cd (uint32_t __a
, uint64_t __b
)
233 __d
= __crc32cw (__crc32cw (__a
, __b
& 0xffffffffULL
), __b
>> 32);
238 #endif /* __ARM_ARCH >= 8. */
239 #pragma GCC pop_options