1 /* AArch64 Non-NEON ACLE intrinsics include file.
2
3 Copyright (C) 2014-2019 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
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #pragma GCC push_options
37 #pragma GCC target ("arch=armv8.3-a")
38 __extension__ static __inline int32_t __attribute__ ((__always_inline__))
__jcvt(double __a)39 __jcvt (double __a)
40 {
41 return __builtin_aarch64_jcvtzs (__a);
42 }
43
44 #pragma GCC push_options
45 #pragma GCC target ("arch=armv8.5-a")
46 __extension__ static __inline float __attribute__ ((__always_inline__))
__rint32zf(float __a)47 __rint32zf (float __a)
48 {
49 return __builtin_aarch64_frint32zsf (__a);
50 }
51
52 __extension__ static __inline double __attribute__ ((__always_inline__))
__rint32z(double __a)53 __rint32z (double __a)
54 {
55 return __builtin_aarch64_frint32zdf (__a);
56 }
57
58 __extension__ static __inline float __attribute__ ((__always_inline__))
__rint64zf(float __a)59 __rint64zf (float __a)
60 {
61 return __builtin_aarch64_frint64zsf (__a);
62 }
63
64 __extension__ static __inline double __attribute__ ((__always_inline__))
__rint64z(double __a)65 __rint64z (double __a)
66 {
67 return __builtin_aarch64_frint64zdf (__a);
68 }
69
70 __extension__ static __inline float __attribute__ ((__always_inline__))
__rint32xf(float __a)71 __rint32xf (float __a)
72 {
73 return __builtin_aarch64_frint32xsf (__a);
74 }
75
76 __extension__ static __inline double __attribute__ ((__always_inline__))
__rint32x(double __a)77 __rint32x (double __a)
78 {
79 return __builtin_aarch64_frint32xdf (__a);
80 }
81
82 __extension__ static __inline float __attribute__ ((__always_inline__))
__rint64xf(float __a)83 __rint64xf (float __a)
84 {
85 return __builtin_aarch64_frint64xsf (__a);
86 }
87
88 __extension__ static __inline double __attribute__ ((__always_inline__))
__rint64x(double __a)89 __rint64x (double __a)
90 {
91 return __builtin_aarch64_frint64xdf (__a);
92 }
93 #pragma GCC pop_options
94
95 #pragma GCC pop_options
96
97 #pragma GCC push_options
98
99 #pragma GCC target ("+nothing+crc")
100
101 #ifdef __cplusplus
102 extern "C" {
103 #endif
104
105 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32b(uint32_t __a,uint8_t __b)106 __crc32b (uint32_t __a, uint8_t __b)
107 {
108 return __builtin_aarch64_crc32b (__a, __b);
109 }
110
111 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32cb(uint32_t __a,uint8_t __b)112 __crc32cb (uint32_t __a, uint8_t __b)
113 {
114 return __builtin_aarch64_crc32cb (__a, __b);
115 }
116
117 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32ch(uint32_t __a,uint16_t __b)118 __crc32ch (uint32_t __a, uint16_t __b)
119 {
120 return __builtin_aarch64_crc32ch (__a, __b);
121 }
122
123 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32cw(uint32_t __a,uint32_t __b)124 __crc32cw (uint32_t __a, uint32_t __b)
125 {
126 return __builtin_aarch64_crc32cw (__a, __b);
127 }
128
129 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32cd(uint32_t __a,uint64_t __b)130 __crc32cd (uint32_t __a, uint64_t __b)
131 {
132 return __builtin_aarch64_crc32cx (__a, __b);
133 }
134
135 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32h(uint32_t __a,uint16_t __b)136 __crc32h (uint32_t __a, uint16_t __b)
137 {
138 return __builtin_aarch64_crc32h (__a, __b);
139 }
140
141 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32w(uint32_t __a,uint32_t __b)142 __crc32w (uint32_t __a, uint32_t __b)
143 {
144 return __builtin_aarch64_crc32w (__a, __b);
145 }
146
147 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32d(uint32_t __a,uint64_t __b)148 __crc32d (uint32_t __a, uint64_t __b)
149 {
150 return __builtin_aarch64_crc32x (__a, __b);
151 }
152
153 #pragma GCC pop_options
154
155 #pragma GCC push_options
156 #pragma GCC target ("+nothing+rng")
157 __extension__ static __inline int __attribute__ ((__always_inline__))
__rndr(uint64_t * __res)158 __rndr (uint64_t *__res)
159 {
160 return __builtin_aarch64_rndr (__res);
161 }
162
163 __extension__ static __inline int __attribute__ ((__always_inline__))
__rndrrs(uint64_t * __res)164 __rndrrs (uint64_t *__res)
165 {
166 return __builtin_aarch64_rndrrs (__res);
167 }
168
169 #pragma GCC pop_options
170
171 #ifdef __cplusplus
172 }
173 #endif
174
175 #pragma GCC pop_options
176
177 #endif
178