Debian Codegraph @

third-party/simde/arm/neon/rsra_n.h

raw
1 /* SPDX-License-Identifier: MIT
2 *
3 * Permission is hereby granted, free of charge, to any person
4 * obtaining a copy of this software and associated documentation
5 * files (the "Software"), to deal in the Software without
6 * restriction, including without limitation the rights to use, copy,
7 * modify, merge, publish, distribute, sublicense, and/or sell copies
8 * of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *
23 * Copyright:
24 * 2020 Evan Nemerson <[email protected]>
25 * 2020 Christopher Moore <[email protected]>
26 */
27
28 #if !defined(SIMDE_ARM_NEON_RSRA_N_H)
29 #define SIMDE_ARM_NEON_RSRA_N_H
30
31 #include "add.h"
32 #include "combine.h"
33 #include "get_low.h"
34 #include "rshr_n.h"
35 #include "types.h"
36
37 HEDLEY_DIAGNOSTIC_PUSH
38 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
39 SIMDE_BEGIN_DECLS_
40
41 /* Remark: For these instructions
42 * 1 <= n <= data element size in bits
43 * so 0 <= n - 1 < data element size in bits
44 */
45
46 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
47 #define simde_vrsrad_n_s64(a, b, n) vrsrad_n_s64(a, b, n)
48 #else
49 #define simde_vrsrad_n_s64(a, b, n) simde_vaddd_s64((a), simde_vrshrd_n_s64((b), (n)))
50 #endif
51 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
52 #undef vrsrad_n_s64
53 #define vrsrad_n_s64(a, b, n) simde_vrsrad_n_s64((a), (b), (n))
54 #endif
55
56 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
57 #define simde_vrsrad_n_u64(a, b, n) vrsrad_n_u64(a, b, n)
58 #else
59 #define simde_vrsrad_n_u64(a, b, n) simde_vaddd_u64((a), simde_vrshrd_n_u64((b), (n)))
60 #endif
61 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
62 #undef vrsrad_n_u64
63 #define vrsrad_n_u64(a, b, n) simde_vrsrad_n_u64((a), (b), (n))
64 #endif
65
66 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
67 #define simde_vrsraq_n_s8(a, b, n) vrsraq_n_s8((a), (b), (n))
68 #else
69 #define simde_vrsraq_n_s8(a, b, n) simde_vaddq_s8((a), simde_vrshrq_n_s8((b), (n)))
70 #endif
71 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
72 #undef vrsraq_n_s8
73 #define vrsraq_n_s8(a, b, n) simde_vrsraq_n_s8((a), (b), (n))
74 #endif
75
76 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
77 #define simde_vrsraq_n_s16(a, b, n) vrsraq_n_s16((a), (b), (n))
78 #else
79 #define simde_vrsraq_n_s16(a, b, n) simde_vaddq_s16((a), simde_vrshrq_n_s16((b), (n)))
80 #endif
81 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
82 #undef vrsraq_n_s16
83 #define vrsraq_n_s16(a, b, n) simde_vrsraq_n_s16((a), (b), (n))
84 #endif
85
86 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
87 #define simde_vrsraq_n_s32(a, b, n) vrsraq_n_s32((a), (b), (n))
88 #else
89 #define simde_vrsraq_n_s32(a, b, n) simde_vaddq_s32((a), simde_vrshrq_n_s32((b), (n)))
90 #endif
91 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
92 #undef vrsraq_n_s32
93 #define vrsraq_n_s32(a, b, n) simde_vrsraq_n_s32((a), (b), (n))
94 #endif
95
96 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
97 #define simde_vrsraq_n_s64(a, b, n) vrsraq_n_s64((a), (b), (n))
98 #else
99 #define simde_vrsraq_n_s64(a, b, n) simde_vaddq_s64((a), simde_vrshrq_n_s64((b), (n)))
100 #endif
101 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
102 #undef vrsraq_n_s64
103 #define vrsraq_n_s64(a, b, n) simde_vrsraq_n_s64((a), (b), (n))
104 #endif
105
106 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
107 #define simde_vrsraq_n_u8(a, b, n) vrsraq_n_u8((a), (b), (n))
108 #else
109 #define simde_vrsraq_n_u8(a, b, n) simde_vaddq_u8((a), simde_vrshrq_n_u8((b), (n)))
110 #endif
111 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
112 #undef vrsraq_n_u8
113 #define vrsraq_n_u8(a, b, n) simde_vrsraq_n_u8((a), (b), (n))
114 #endif
115
116 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
117 #define simde_vrsraq_n_u16(a, b, n) vrsraq_n_u16((a), (b), (n))
118 #else
119 #define simde_vrsraq_n_u16(a, b, n) simde_vaddq_u16((a), simde_vrshrq_n_u16((b), (n)))
120 #endif
121 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
122 #undef vrsraq_n_u16
123 #define vrsraq_n_u16(a, b, n) simde_vrsraq_n_u16((a), (b), (n))
124 #endif
125
126 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
127 #define simde_vrsraq_n_u32(a, b, n) vrsraq_n_u32((a), (b), (n))
128 #else
129 #define simde_vrsraq_n_u32(a, b, n) simde_vaddq_u32((a), simde_vrshrq_n_u32((b), (n)))
130 #endif
131 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
132 #undef vrsraq_n_u32
133 #define vrsraq_n_u32(a, b, n) simde_vrsraq_n_u32((a), (b), (n))
134 #endif
135
136 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
137 #define simde_vrsraq_n_u64(a, b, n) vrsraq_n_u64((a), (b), (n))
138 #else
139 #define simde_vrsraq_n_u64(a, b, n) simde_vaddq_u64((a), simde_vrshrq_n_u64((b), (n)))
140 #endif
141 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
142 #undef vrsraq_n_u64
143 #define vrsraq_n_u64(a, b, n) simde_vrsraq_n_u64((a), (b), (n))
144 #endif
145
146 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
147 #define simde_vrsra_n_s8(a, b, n) vrsra_n_s8((a), (b), (n))
148 #else
149 #define simde_vrsra_n_s8(a, b, n) simde_vadd_s8((a), simde_vrshr_n_s8((b), (n)))
150 #endif
151 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
152 #undef vrsra_n_s8
153 #define vrsra_n_s8(a, b, n) simde_vrsra_n_s8((a), (b), (n))
154 #endif
155
156 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
157 #define simde_vrsra_n_s16(a, b, n) vrsra_n_s16((a), (b), (n))
158 #else
159 #define simde_vrsra_n_s16(a, b, n) simde_vadd_s16((a), simde_vrshr_n_s16((b), (n)))
160 #endif
161 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
162 #undef vrsra_n_s16
163 #define vrsra_n_s16(a, b, n) simde_vrsra_n_s16((a), (b), (n))
164 #endif
165
166 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
167 #define simde_vrsra_n_s32(a, b, n) vrsra_n_s32((a), (b), (n))
168 #else
169 #define simde_vrsra_n_s32(a, b, n) simde_vadd_s32((a), simde_vrshr_n_s32((b), (n)))
170 #endif
171 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
172 #undef vrsra_n_s32
173 #define vrsra_n_s32(a, b, n) simde_vrsra_n_s32((a), (b), (n))
174 #endif
175
176 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
177 #define simde_vrsra_n_s64(a, b, n) vrsra_n_s64((a), (b), (n))
178 #else
179 #define simde_vrsra_n_s64(a, b, n) simde_vadd_s64((a), simde_vrshr_n_s64((b), (n)))
180 #endif
181 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
182 #undef vrsra_n_s64
183 #define vrsra_n_s64(a, b, n) simde_vrsra_n_s64((a), (b), (n))
184 #endif
185
186 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
187 #define simde_vrsra_n_u8(a, b, n) vrsra_n_u8((a), (b), (n))
188 #else
189 #define simde_vrsra_n_u8(a, b, n) simde_vadd_u8((a), simde_vrshr_n_u8((b), (n)))
190 #endif
191 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
192 #undef vrsra_n_u8
193 #define vrsra_n_u8(a, b, n) simde_vrsra_n_u8((a), (b), (n))
194 #endif
195
196 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
197 #define simde_vrsra_n_u16(a, b, n) vrsra_n_u16((a), (b), (n))
198 #else
199 #define simde_vrsra_n_u16(a, b, n) simde_vadd_u16((a), simde_vrshr_n_u16((b), (n)))
200 #endif
201 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
202 #undef vrsra_n_u16
203 #define vrsra_n_u16(a, b, n) simde_vrsra_n_u16((a), (b), (n))
204 #endif
205
206 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
207 #define simde_vrsra_n_u32(a, b, n) vrsra_n_u32((a), (b), (n))
208 #else
209 #define simde_vrsra_n_u32(a, b, n) simde_vadd_u32((a), simde_vrshr_n_u32((b), (n)))
210 #endif
211 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
212 #undef vrsra_n_u32
213 #define vrsra_n_u32(a, b, n) simde_vrsra_n_u32((a), (b), (n))
214 #endif
215
216 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
217 #define simde_vrsra_n_u64(a, b, n) vrsra_n_u64((a), (b), (n))
218 #else
219 #define simde_vrsra_n_u64(a, b, n) simde_vadd_u64((a), simde_vrshr_n_u64((b), (n)))
220 #endif
221 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
222 #undef vrsra_n_u64
223 #define vrsra_n_u64(a, b, n) simde_vrsra_n_u64((a), (b), (n))
224 #endif
225
226 SIMDE_END_DECLS_
227 HEDLEY_DIAGNOSTIC_POP
228
229 #endif /* !defined(SIMDE_ARM_NEON_RSRA_N_H) */