]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/arm/arm_acle.h
[ARM] Implement support for ACLE Coprocessor LDC and STC intrinsics
[thirdparty/gcc.git] / gcc / config / arm / arm_acle.h
CommitLineData
582e2e43
KT
1/* ARM Non-NEON ACLE intrinsics include file.
2
cbe34bb5 3 Copyright (C) 2013-2017 Free Software Foundation, Inc.
582e2e43
KT
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
32extern "C" {
33#endif
34
d57daa0c
AV
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
3811581f
AV
44__extension__ static __inline void __attribute__ ((__always_inline__))
45__arm_ldc (const unsigned int __coproc, const unsigned int __CRd,
46 const void * __p)
47{
48 return __builtin_arm_ldc (__coproc, __CRd, __p);
49}
50
51__extension__ static __inline void __attribute__ ((__always_inline__))
52__arm_ldcl (const unsigned int __coproc, const unsigned int __CRd,
53 const void * __p)
54{
55 return __builtin_arm_ldcl (__coproc, __CRd, __p);
56}
57
58__extension__ static __inline void __attribute__ ((__always_inline__))
59__arm_stc (const unsigned int __coproc, const unsigned int __CRd,
60 void * __p)
61{
62 return __builtin_arm_stc (__coproc, __CRd, __p);
63}
64
65__extension__ static __inline void __attribute__ ((__always_inline__))
66__arm_stcl (const unsigned int __coproc, const unsigned int __CRd,
67 void * __p)
68{
69 return __builtin_arm_stcl (__coproc, __CRd, __p);
70}
d57daa0c
AV
71#if __ARM_ARCH >= 5
72__extension__ static __inline void __attribute__ ((__always_inline__))
73__arm_cdp2 (const unsigned int __coproc, const unsigned int __opc1,
74 const unsigned int __CRd, const unsigned int __CRn,
75 const unsigned int __CRm, const unsigned int __opc2)
76{
77 return __builtin_arm_cdp2 (__coproc, __opc1, __CRd, __CRn, __CRm, __opc2);
78}
3811581f
AV
79
80__extension__ static __inline void __attribute__ ((__always_inline__))
81__arm_ldc2 (const unsigned int __coproc, const unsigned int __CRd,
82 const void * __p)
83{
84 return __builtin_arm_ldc2 (__coproc, __CRd, __p);
85}
86
87__extension__ static __inline void __attribute__ ((__always_inline__))
88__arm_ldc2l (const unsigned int __coproc, const unsigned int __CRd,
89 const void * __p)
90{
91 return __builtin_arm_ldc2l (__coproc, __CRd, __p);
92}
93
94__extension__ static __inline void __attribute__ ((__always_inline__))
95__arm_stc2 (const unsigned int __coproc, const unsigned int __CRd,
96 void * __p)
97{
98 return __builtin_arm_stc2 (__coproc, __CRd, __p);
99}
100
101__extension__ static __inline void __attribute__ ((__always_inline__))
102__arm_stc2l (const unsigned int __coproc, const unsigned int __CRd,
103 void * __p)
104{
105 return __builtin_arm_stc2l (__coproc, __CRd, __p);
106}
d57daa0c
AV
107#endif /* __ARM_ARCH >= 5. */
108#endif /* (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4. */
109
582e2e43
KT
110#ifdef __ARM_FEATURE_CRC32
111__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 112__crc32b (uint32_t __a, uint8_t __b)
582e2e43 113{
706f749a 114 return __builtin_arm_crc32b (__a, __b);
582e2e43
KT
115}
116
117__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 118__crc32h (uint32_t __a, uint16_t __b)
582e2e43 119{
706f749a 120 return __builtin_arm_crc32h (__a, __b);
582e2e43
KT
121}
122
123__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 124__crc32w (uint32_t __a, uint32_t __b)
582e2e43 125{
706f749a 126 return __builtin_arm_crc32w (__a, __b);
582e2e43
KT
127}
128
129#ifdef __ARM_32BIT_STATE
130__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 131__crc32d (uint32_t __a, uint64_t __b)
582e2e43 132{
706f749a 133 uint32_t __d;
582e2e43 134
706f749a
KT
135 __d = __crc32w (__crc32w (__a, __b & 0xffffffffULL), __b >> 32);
136 return __d;
582e2e43
KT
137}
138#endif
139
140__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 141__crc32cb (uint32_t __a, uint8_t __b)
582e2e43 142{
706f749a 143 return __builtin_arm_crc32cb (__a, __b);
582e2e43
KT
144}
145
146__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 147__crc32ch (uint32_t __a, uint16_t __b)
582e2e43 148{
706f749a 149 return __builtin_arm_crc32ch (__a, __b);
582e2e43
KT
150}
151
152__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 153__crc32cw (uint32_t __a, uint32_t __b)
582e2e43 154{
706f749a 155 return __builtin_arm_crc32cw (__a, __b);
582e2e43
KT
156}
157
158#ifdef __ARM_32BIT_STATE
159__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
706f749a 160__crc32cd (uint32_t __a, uint64_t __b)
582e2e43 161{
706f749a 162 uint32_t __d;
582e2e43 163
706f749a
KT
164 __d = __crc32cw (__crc32cw (__a, __b & 0xffffffffULL), __b >> 32);
165 return __d;
582e2e43
KT
166}
167#endif
168
169#endif
170
171#ifdef __cplusplus
172}
173#endif
174
175#endif