Debian Codegraph @

third-party/simde/arm/neon/sra_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_SRA_N_H)
29 #define SIMDE_ARM_NEON_SRA_N_H
30
31 #include "add.h"
32 #include "shr_n.h"
33 #include "types.h"
34
35 HEDLEY_DIAGNOSTIC_PUSH
36 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
37 SIMDE_BEGIN_DECLS_
38
39 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
40 #define simde_vsrad_n_s64(a, b, n) vsrad_n_s64((a), (b), (n))
41 #else
42 #define simde_vsrad_n_s64(a, b, n) simde_vaddd_s64((a), simde_vshrd_n_s64((b), (n)))
43 #endif
44 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
45 #undef vsrad_n_s64
46 #define vsrad_n_s64(a, b, n) simde_vsrad_n_s64((a), (b), (n))
47 #endif
48
49 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
50 #define simde_vsrad_n_u64(a, b, n) vsrad_n_u64((a), (b), (n))
51 #else
52 #define simde_vsrad_n_u64(a, b, n) simde_vaddd_u64((a), simde_vshrd_n_u64((b), (n)))
53 #endif
54 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
55 #undef vsrad_n_u64
56 #define vsrad_n_u64(a, b, n) simde_vsrad_n_u64((a), (b), (n))
57 #endif
58
59 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
60 #define simde_vsra_n_s8(a, b, n) vsra_n_s8((a), (b), (n))
61 #else
62 #define simde_vsra_n_s8(a, b, n) simde_vadd_s8((a), simde_vshr_n_s8((b), (n)))
63 #endif
64 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
65 #undef vsra_n_s8
66 #define vsra_n_s8(a, b, n) simde_vsra_n_s8((a), (b), (n))
67 #endif
68
69 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
70 #define simde_vsra_n_s16(a, b, n) vsra_n_s16((a), (b), (n))
71 #else
72 #define simde_vsra_n_s16(a, b, n) simde_vadd_s16((a), simde_vshr_n_s16((b), (n)))
73 #endif
74 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
75 #undef vsra_n_s16
76 #define vsra_n_s16(a, b, n) simde_vsra_n_s16((a), (b), (n))
77 #endif
78
79 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
80 #define simde_vsra_n_s32(a, b, n) vsra_n_s32((a), (b), (n))
81 #else
82 #define simde_vsra_n_s32(a, b, n) simde_vadd_s32((a), simde_vshr_n_s32((b), (n)))
83 #endif
84 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
85 #undef vsra_n_s32
86 #define vsra_n_s32(a, b, n) simde_vsra_n_s32((a), (b), (n))
87 #endif
88
89 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
90 #define simde_vsra_n_s64(a, b, n) vsra_n_s64((a), (b), (n))
91 #else
92 #define simde_vsra_n_s64(a, b, n) simde_vadd_s64((a), simde_vshr_n_s64((b), (n)))
93 #endif
94 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
95 #undef vsra_n_s64
96 #define vsra_n_s64(a, b, n) simde_vsra_n_s64((a), (b), (n))
97 #endif
98
99 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
100 #define simde_vsra_n_u8(a, b, n) vsra_n_u8((a), (b), (n))
101 #else
102 #define simde_vsra_n_u8(a, b, n) simde_vadd_u8((a), simde_vshr_n_u8((b), (n)))
103 #endif
104 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
105 #undef vsra_n_u8
106 #define vsra_n_u8(a, b, n) simde_vsra_n_u8((a), (b), (n))
107 #endif
108
109 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
110 #define simde_vsra_n_u16(a, b, n) vsra_n_u16((a), (b), (n))
111 #else
112 #define simde_vsra_n_u16(a, b, n) simde_vadd_u16((a), simde_vshr_n_u16((b), (n)))
113 #endif
114 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
115 #undef vsra_n_u16
116 #define vsra_n_u16(a, b, n) simde_vsra_n_u16((a), (b), (n))
117 #endif
118
119 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
120 #define simde_vsra_n_u32(a, b, n) vsra_n_u32((a), (b), (n))
121 #else
122 #define simde_vsra_n_u32(a, b, n) simde_vadd_u32((a), simde_vshr_n_u32((b), (n)))
123 #endif
124 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
125 #undef vsra_n_u32
126 #define vsra_n_u32(a, b, n) simde_vsra_n_u32((a), (b), (n))
127 #endif
128
129 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
130 #define simde_vsra_n_u64(a, b, n) vsra_n_u64((a), (b), (n))
131 #else
132 #define simde_vsra_n_u64(a, b, n) simde_vadd_u64((a), simde_vshr_n_u64((b), (n)))
133 #endif
134 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
135 #undef vsra_n_u64
136 #define vsra_n_u64(a, b, n) simde_vsra_n_u64((a), (b), (n))
137 #endif
138
139 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
140 #define simde_vsraq_n_s8(a, b, n) vsraq_n_s8((a), (b), (n))
141 #else
142 #define simde_vsraq_n_s8(a, b, n) simde_vaddq_s8((a), simde_vshrq_n_s8((b), (n)))
143 #endif
144 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
145 #undef vsraq_n_s8
146 #define vsraq_n_s8(a, b, n) simde_vsraq_n_s8((a), (b), (n))
147 #endif
148
149 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
150 #define simde_vsraq_n_s16(a, b, n) vsraq_n_s16((a), (b), (n))
151 #else
152 #define simde_vsraq_n_s16(a, b, n) simde_vaddq_s16((a), simde_vshrq_n_s16((b), (n)))
153 #endif
154 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
155 #undef vsraq_n_s16
156 #define vsraq_n_s16(a, b, n) simde_vsraq_n_s16((a), (b), (n))
157 #endif
158
159 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
160 #define simde_vsraq_n_s32(a, b, n) vsraq_n_s32((a), (b), (n))
161 #else
162 #define simde_vsraq_n_s32(a, b, n) simde_vaddq_s32((a), simde_vshrq_n_s32((b), (n)))
163 #endif
164 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
165 #undef vsraq_n_s32
166 #define vsraq_n_s32(a, b, n) simde_vsraq_n_s32((a), (b), (n))
167 #endif
168
169 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
170 #define simde_vsraq_n_s64(a, b, n) vsraq_n_s64((a), (b), (n))
171 #else
172 #define simde_vsraq_n_s64(a, b, n) simde_vaddq_s64((a), simde_vshrq_n_s64((b), (n)))
173 #endif
174 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
175 #undef vsraq_n_s64
176 #define vsraq_n_s64(a, b, n) simde_vsraq_n_s64((a), (b), (n))
177 #endif
178
179 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
180 #define simde_vsraq_n_u8(a, b, n) vsraq_n_u8((a), (b), (n))
181 #else
182 #define simde_vsraq_n_u8(a, b, n) simde_vaddq_u8((a), simde_vshrq_n_u8((b), (n)))
183 #endif
184 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
185 #undef vsraq_n_u8
186 #define vsraq_n_u8(a, b, n) simde_vsraq_n_u8((a), (b), (n))
187 #endif
188
189 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
190 #define simde_vsraq_n_u16(a, b, n) vsraq_n_u16((a), (b), (n))
191 #else
192 #define simde_vsraq_n_u16(a, b, n) simde_vaddq_u16((a), simde_vshrq_n_u16((b), (n)))
193 #endif
194 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
195 #undef vsraq_n_u16
196 #define vsraq_n_u16(a, b, n) simde_vsraq_n_u16((a), (b), (n))
197 #endif
198
199 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
200 #define simde_vsraq_n_u32(a, b, n) vsraq_n_u32((a), (b), (n))
201 #else
202 #define simde_vsraq_n_u32(a, b, n) simde_vaddq_u32((a), simde_vshrq_n_u32((b), (n)))
203 #endif
204 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
205 #undef vsraq_n_u32
206 #define vsraq_n_u32(a, b, n) simde_vsraq_n_u32((a), (b), (n))
207 #endif
208
209 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
210 #define simde_vsraq_n_u64(a, b, n) vsraq_n_u64((a), (b), (n))
211 #else
212 #define simde_vsraq_n_u64(a, b, n) simde_vaddq_u64((a), simde_vshrq_n_u64((b), (n)))
213 #endif
214 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
215 #undef vsraq_n_u64
216 #define vsraq_n_u64(a, b, n) simde_vsraq_n_u64((a), (b), (n))
217 #endif
218
219 SIMDE_END_DECLS_
220 HEDLEY_DIAGNOSTIC_POP
221
222 #endif /* !defined(SIMDE_ARM_NEON_SRA_N_H) */