| 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_QSHL_H) |
| 29 |
#define SIMDE_ARM_NEON_QSHL_H |
| 30 |
|
| 31 |
#include "types.h" |
| 32 |
#include "cls.h" |
| 33 |
|
| 34 |
HEDLEY_DIAGNOSTIC_PUSH |
| 35 |
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS |
| 36 |
SIMDE_BEGIN_DECLS_ |
| 37 |
|
| 38 |
SIMDE_FUNCTION_ATTRIBUTES |
| 39 |
int8_t |
| 40 |
simde_vqshlb_s8(int8_t a, int8_t b) { |
| 41 |
int8_t r; |
| 42 |
|
| 43 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 44 |
r = vqshlb_s8(a, b); |
| 45 |
#else |
| 46 |
if (b < -7) |
| 47 |
b = -7; |
| 48 |
|
| 49 |
if (b <= 0) { |
| 50 |
r = a >> -b; |
| 51 |
} else if (b < 7) { |
| 52 |
r = HEDLEY_STATIC_CAST(int8_t, a << b); |
| 53 |
if ((r >> b) != a) { |
| 54 |
r = (a < 0) ? INT8_MIN : INT8_MAX; |
| 55 |
} |
| 56 |
} else if (a == 0) { |
| 57 |
r = 0; |
| 58 |
} else { |
| 59 |
r = (a < 0) ? INT8_MIN : INT8_MAX; |
| 60 |
} |
| 61 |
#endif |
| 62 |
|
| 63 |
return r; |
| 64 |
} |
| 65 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 66 |
#undef vqshlb_s8 |
| 67 |
#define vqshlb_s8(a, b) simde_vqshlb_s8((a), (b)) |
| 68 |
#endif |
| 69 |
|
| 70 |
SIMDE_FUNCTION_ATTRIBUTES |
| 71 |
int16_t |
| 72 |
simde_vqshlh_s16(int16_t a, int16_t b) { |
| 73 |
int16_t r; |
| 74 |
|
| 75 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 76 |
r = vqshlh_s16(a, b); |
| 77 |
#else |
| 78 |
int8_t b8 = HEDLEY_STATIC_CAST(int8_t, b); |
| 79 |
|
| 80 |
if (b8 < -15) |
| 81 |
b8 = -15; |
| 82 |
|
| 83 |
if (b8 <= 0) { |
| 84 |
r = a >> -b8; |
| 85 |
} else if (b8 < 15) { |
| 86 |
r = HEDLEY_STATIC_CAST(int16_t, a << b8); |
| 87 |
if ((r >> b8) != a) { |
| 88 |
r = (a < 0) ? INT16_MIN : INT16_MAX; |
| 89 |
} |
| 90 |
} else if (a == 0) { |
| 91 |
r = 0; |
| 92 |
} else { |
| 93 |
r = (a < 0) ? INT16_MIN : INT16_MAX; |
| 94 |
} |
| 95 |
#endif |
| 96 |
|
| 97 |
return r; |
| 98 |
} |
| 99 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 100 |
#undef vqshlh_s16 |
| 101 |
#define vqshlh_s16(a, b) simde_vqshlh_s16((a), (b)) |
| 102 |
#endif |
| 103 |
|
| 104 |
SIMDE_FUNCTION_ATTRIBUTES |
| 105 |
int32_t |
| 106 |
simde_vqshls_s32(int32_t a, int32_t b) { |
| 107 |
int32_t r; |
| 108 |
|
| 109 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 110 |
r = vqshls_s32(a, b); |
| 111 |
#else |
| 112 |
int8_t b8 = HEDLEY_STATIC_CAST(int8_t, b); |
| 113 |
|
| 114 |
if (b8 < -31) |
| 115 |
b8 = -31; |
| 116 |
|
| 117 |
if (b8 <= 0) { |
| 118 |
r = a >> -b8; |
| 119 |
} else if (b8 < 31) { |
| 120 |
r = HEDLEY_STATIC_CAST(int32_t, a << b8); |
| 121 |
if ((r >> b8) != a) { |
| 122 |
r = (a < 0) ? INT32_MIN : INT32_MAX; |
| 123 |
} |
| 124 |
} else if (a == 0) { |
| 125 |
r = 0; |
| 126 |
} else { |
| 127 |
r = (a < 0) ? INT32_MIN : INT32_MAX; |
| 128 |
} |
| 129 |
#endif |
| 130 |
|
| 131 |
return r; |
| 132 |
} |
| 133 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 134 |
#undef vqshls_s32 |
| 135 |
#define vqshls_s32(a, b) simde_vqshls_s32((a), (b)) |
| 136 |
#endif |
| 137 |
|
| 138 |
SIMDE_FUNCTION_ATTRIBUTES |
| 139 |
int64_t |
| 140 |
simde_vqshld_s64(int64_t a, int64_t b) { |
| 141 |
int64_t r; |
| 142 |
|
| 143 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 144 |
r = vqshld_s64(a, b); |
| 145 |
#else |
| 146 |
int8_t b8 = HEDLEY_STATIC_CAST(int8_t, b); |
| 147 |
|
| 148 |
if (b8 < -63) |
| 149 |
b8 = -63; |
| 150 |
|
| 151 |
if (b8 <= 0) { |
| 152 |
r = a >> -b8; |
| 153 |
} else if (b8 < 63) { |
| 154 |
r = HEDLEY_STATIC_CAST(int64_t, a << b8); |
| 155 |
if ((r >> b8) != a) { |
| 156 |
r = (a < 0) ? INT64_MIN : INT64_MAX; |
| 157 |
} |
| 158 |
} else if (a == 0) { |
| 159 |
r = 0; |
| 160 |
} else { |
| 161 |
r = (a < 0) ? INT64_MIN : INT64_MAX; |
| 162 |
} |
| 163 |
#endif |
| 164 |
|
| 165 |
return r; |
| 166 |
} |
| 167 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 168 |
#undef vqshld_s64 |
| 169 |
#define vqshld_s64(a, b) simde_vqshld_s64((a), (b)) |
| 170 |
#endif |
| 171 |
|
| 172 |
SIMDE_FUNCTION_ATTRIBUTES |
| 173 |
uint8_t |
| 174 |
simde_vqshlb_u8(uint8_t a, int8_t b) { |
| 175 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 176 |
#if defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(11,0,0) |
| 177 |
return vqshlb_u8(a, HEDLEY_STATIC_CAST(uint8_t, b)); |
| 178 |
#elif HEDLEY_HAS_WARNING("-Wsign-conversion") |
| 179 |
/* https://github.com/llvm/llvm-project/commit/f0a78bdfdc6d56b25e0081884580b3960a3c2429 */ |
| 180 |
HEDLEY_DIAGNOSTIC_PUSH |
| 181 |
#pragma clang diagnostic ignored "-Wsign-conversion" |
| 182 |
return vqshlb_u8(a, b); |
| 183 |
HEDLEY_DIAGNOSTIC_POP |
| 184 |
#else |
| 185 |
return vqshlb_u8(a, b); |
| 186 |
#endif |
| 187 |
#else |
| 188 |
uint8_t r; |
| 189 |
|
| 190 |
if (b < -7) |
| 191 |
b = -7; |
| 192 |
|
| 193 |
if (b <= 0) { |
| 194 |
r = a >> -b; |
| 195 |
} else if (b < 7) { |
| 196 |
r = HEDLEY_STATIC_CAST(uint8_t, a << b); |
| 197 |
if ((r >> b) != a) { |
| 198 |
r = UINT8_MAX; |
| 199 |
} |
| 200 |
} else if (a == 0) { |
| 201 |
r = 0; |
| 202 |
} else { |
| 203 |
r = UINT8_MAX; |
| 204 |
} |
| 205 |
|
| 206 |
return r; |
| 207 |
#endif |
| 208 |
} |
| 209 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 210 |
#undef vqshlb_u8 |
| 211 |
#define vqshlb_u8(a, b) simde_vqshlb_u8((a), (b)) |
| 212 |
#endif |
| 213 |
|
| 214 |
SIMDE_FUNCTION_ATTRIBUTES |
| 215 |
uint16_t |
| 216 |
simde_vqshlh_u16(uint16_t a, int16_t b) { |
| 217 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 218 |
#if defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(11,0,0) |
| 219 |
return vqshlh_u16(a, HEDLEY_STATIC_CAST(uint16_t, b)); |
| 220 |
#elif HEDLEY_HAS_WARNING("-Wsign-conversion") |
| 221 |
HEDLEY_DIAGNOSTIC_PUSH |
| 222 |
#pragma clang diagnostic ignored "-Wsign-conversion" |
| 223 |
return vqshlh_u16(a, b); |
| 224 |
HEDLEY_DIAGNOSTIC_POP |
| 225 |
#else |
| 226 |
return vqshlh_u16(a, b); |
| 227 |
#endif |
| 228 |
#else |
| 229 |
uint16_t r; |
| 230 |
|
| 231 |
if (b < -15) |
| 232 |
b = -15; |
| 233 |
|
| 234 |
if (b <= 0) { |
| 235 |
r = a >> -b; |
| 236 |
} else if (b < 15) { |
| 237 |
r = HEDLEY_STATIC_CAST(uint16_t, a << b); |
| 238 |
if ((r >> b) != a) { |
| 239 |
r = UINT16_MAX; |
| 240 |
} |
| 241 |
} else if (a == 0) { |
| 242 |
r = 0; |
| 243 |
} else { |
| 244 |
r = UINT16_MAX; |
| 245 |
} |
| 246 |
|
| 247 |
return r; |
| 248 |
#endif |
| 249 |
} |
| 250 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 251 |
#undef vqshlh_u16 |
| 252 |
#define vqshlh_u16(a, b) simde_vqshlh_u16((a), (b)) |
| 253 |
#endif |
| 254 |
|
| 255 |
SIMDE_FUNCTION_ATTRIBUTES |
| 256 |
uint32_t |
| 257 |
simde_vqshls_u32(uint32_t a, int32_t b) { |
| 258 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 259 |
#if defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(11,0,0) |
| 260 |
return vqshls_u32(a, HEDLEY_STATIC_CAST(uint16_t, b)); |
| 261 |
#elif HEDLEY_HAS_WARNING("-Wsign-conversion") |
| 262 |
HEDLEY_DIAGNOSTIC_PUSH |
| 263 |
#pragma clang diagnostic ignored "-Wsign-conversion" |
| 264 |
return vqshls_u32(a, b); |
| 265 |
HEDLEY_DIAGNOSTIC_POP |
| 266 |
#else |
| 267 |
return vqshls_u32(a, b); |
| 268 |
#endif |
| 269 |
#else |
| 270 |
uint32_t r; |
| 271 |
|
| 272 |
if (b < -31) |
| 273 |
b = -31; |
| 274 |
|
| 275 |
if (b <= 0) { |
| 276 |
r = HEDLEY_STATIC_CAST(uint32_t, a >> -b); |
| 277 |
} else if (b < 31) { |
| 278 |
r = a << b; |
| 279 |
if ((r >> b) != a) { |
| 280 |
r = UINT32_MAX; |
| 281 |
} |
| 282 |
} else if (a == 0) { |
| 283 |
r = 0; |
| 284 |
} else { |
| 285 |
r = UINT32_MAX; |
| 286 |
} |
| 287 |
|
| 288 |
return r; |
| 289 |
#endif |
| 290 |
} |
| 291 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 292 |
#undef vqshls_u32 |
| 293 |
#define vqshls_u32(a, b) simde_vqshls_u32((a), (b)) |
| 294 |
#endif |
| 295 |
|
| 296 |
SIMDE_FUNCTION_ATTRIBUTES |
| 297 |
uint64_t |
| 298 |
simde_vqshld_u64(uint64_t a, int64_t b) { |
| 299 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 300 |
#if defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(11,0,0) |
| 301 |
return vqshld_u64(a, HEDLEY_STATIC_CAST(uint16_t, b)); |
| 302 |
#elif HEDLEY_HAS_WARNING("-Wsign-conversion") |
| 303 |
HEDLEY_DIAGNOSTIC_PUSH |
| 304 |
#pragma clang diagnostic ignored "-Wsign-conversion" |
| 305 |
return vqshld_u64(a, b); |
| 306 |
HEDLEY_DIAGNOSTIC_POP |
| 307 |
#else |
| 308 |
return vqshld_u64(a, b); |
| 309 |
#endif |
| 310 |
#else |
| 311 |
uint64_t r; |
| 312 |
|
| 313 |
if (b < -63) |
| 314 |
b = -63; |
| 315 |
|
| 316 |
if (b <= 0) { |
| 317 |
r = a >> -b; |
| 318 |
} else if (b < 63) { |
| 319 |
r = HEDLEY_STATIC_CAST(uint64_t, a << b); |
| 320 |
if ((r >> b) != a) { |
| 321 |
r = UINT64_MAX; |
| 322 |
} |
| 323 |
} else if (a == 0) { |
| 324 |
r = 0; |
| 325 |
} else { |
| 326 |
r = UINT64_MAX; |
| 327 |
} |
| 328 |
|
| 329 |
return r; |
| 330 |
#endif |
| 331 |
} |
| 332 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 333 |
#undef vqshldb_u64 |
| 334 |
#define vqshld_u64(a, b) simde_vqshld_u64((a), (b)) |
| 335 |
#endif |
| 336 |
|
| 337 |
SIMDE_FUNCTION_ATTRIBUTES |
| 338 |
simde_int8x8_t |
| 339 |
simde_vqshl_s8 (const simde_int8x8_t a, const simde_int8x8_t b) { |
| 340 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 341 |
return vqshl_s8(a, b); |
| 342 |
#else |
| 343 |
simde_int8x8_private |
| 344 |
r_, |
| 345 |
a_ = simde_int8x8_to_private(a), |
| 346 |
b_ = simde_int8x8_to_private(b); |
| 347 |
|
| 348 |
SIMDE_VECTORIZE |
| 349 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 350 |
r_.values[i] = simde_vqshlb_s8(a_.values[i], b_.values[i]); |
| 351 |
} |
| 352 |
|
| 353 |
return simde_int8x8_from_private(r_); |
| 354 |
#endif |
| 355 |
} |
| 356 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 357 |
#undef vqshl_s8 |
| 358 |
#define vqshl_s8(a, b) simde_vqshl_s8((a), (b)) |
| 359 |
#endif |
| 360 |
|
| 361 |
SIMDE_FUNCTION_ATTRIBUTES |
| 362 |
simde_int16x4_t |
| 363 |
simde_vqshl_s16 (const simde_int16x4_t a, const simde_int16x4_t b) { |
| 364 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 365 |
return vqshl_s16(a, b); |
| 366 |
#else |
| 367 |
simde_int16x4_private |
| 368 |
r_, |
| 369 |
a_ = simde_int16x4_to_private(a), |
| 370 |
b_ = simde_int16x4_to_private(b); |
| 371 |
|
| 372 |
SIMDE_VECTORIZE |
| 373 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 374 |
r_.values[i] = simde_vqshlh_s16(a_.values[i], b_.values[i]); |
| 375 |
} |
| 376 |
|
| 377 |
return simde_int16x4_from_private(r_); |
| 378 |
#endif |
| 379 |
} |
| 380 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 381 |
#undef vqshl_s16 |
| 382 |
#define vqshl_s16(a, b) simde_vqshl_s16((a), (b)) |
| 383 |
#endif |
| 384 |
|
| 385 |
SIMDE_FUNCTION_ATTRIBUTES |
| 386 |
simde_int32x2_t |
| 387 |
simde_vqshl_s32 (const simde_int32x2_t a, const simde_int32x2_t b) { |
| 388 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 389 |
return vqshl_s32(a, b); |
| 390 |
#else |
| 391 |
simde_int32x2_private |
| 392 |
r_, |
| 393 |
a_ = simde_int32x2_to_private(a), |
| 394 |
b_ = simde_int32x2_to_private(b); |
| 395 |
|
| 396 |
SIMDE_VECTORIZE |
| 397 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 398 |
r_.values[i] = simde_vqshls_s32(a_.values[i], b_.values[i]); |
| 399 |
} |
| 400 |
|
| 401 |
return simde_int32x2_from_private(r_); |
| 402 |
#endif |
| 403 |
} |
| 404 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 405 |
#undef vqshl_s32 |
| 406 |
#define vqshl_s32(a, b) simde_vqshl_s32((a), (b)) |
| 407 |
#endif |
| 408 |
|
| 409 |
SIMDE_FUNCTION_ATTRIBUTES |
| 410 |
simde_int64x1_t |
| 411 |
simde_vqshl_s64 (const simde_int64x1_t a, const simde_int64x1_t b) { |
| 412 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 413 |
return vqshl_s64(a, b); |
| 414 |
#else |
| 415 |
simde_int64x1_private |
| 416 |
r_, |
| 417 |
a_ = simde_int64x1_to_private(a), |
| 418 |
b_ = simde_int64x1_to_private(b); |
| 419 |
|
| 420 |
SIMDE_VECTORIZE |
| 421 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 422 |
r_.values[i] = simde_vqshld_s64(a_.values[i], b_.values[i]); |
| 423 |
} |
| 424 |
|
| 425 |
return simde_int64x1_from_private(r_); |
| 426 |
#endif |
| 427 |
} |
| 428 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 429 |
#undef vqshl_s64 |
| 430 |
#define vqshl_s64(a, b) simde_vqshl_s64((a), (b)) |
| 431 |
#endif |
| 432 |
|
| 433 |
SIMDE_FUNCTION_ATTRIBUTES |
| 434 |
simde_uint8x8_t |
| 435 |
simde_vqshl_u8 (const simde_uint8x8_t a, const simde_int8x8_t b) { |
| 436 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 437 |
return vqshl_u8(a, b); |
| 438 |
#else |
| 439 |
simde_uint8x8_private |
| 440 |
r_, |
| 441 |
a_ = simde_uint8x8_to_private(a); |
| 442 |
simde_int8x8_private |
| 443 |
b_ = simde_int8x8_to_private(b); |
| 444 |
|
| 445 |
SIMDE_VECTORIZE |
| 446 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 447 |
r_.values[i] = simde_vqshlb_u8(a_.values[i], b_.values[i]); |
| 448 |
} |
| 449 |
|
| 450 |
return simde_uint8x8_from_private(r_); |
| 451 |
#endif |
| 452 |
} |
| 453 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 454 |
#undef vqshl_u8 |
| 455 |
#define vqshl_u8(a, b) simde_vqshl_u8((a), (b)) |
| 456 |
#endif |
| 457 |
|
| 458 |
SIMDE_FUNCTION_ATTRIBUTES |
| 459 |
simde_uint16x4_t |
| 460 |
simde_vqshl_u16 (const simde_uint16x4_t a, const simde_int16x4_t b) { |
| 461 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 462 |
return vqshl_u16(a, b); |
| 463 |
#else |
| 464 |
simde_uint16x4_private |
| 465 |
r_, |
| 466 |
a_ = simde_uint16x4_to_private(a); |
| 467 |
simde_int16x4_private |
| 468 |
b_ = simde_int16x4_to_private(b); |
| 469 |
|
| 470 |
SIMDE_VECTORIZE |
| 471 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 472 |
r_.values[i] = simde_vqshlh_u16(a_.values[i], b_.values[i]); |
| 473 |
} |
| 474 |
|
| 475 |
return simde_uint16x4_from_private(r_); |
| 476 |
#endif |
| 477 |
} |
| 478 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 479 |
#undef vqshl_u16 |
| 480 |
#define vqshl_u16(a, b) simde_vqshl_u16((a), (b)) |
| 481 |
#endif |
| 482 |
|
| 483 |
SIMDE_FUNCTION_ATTRIBUTES |
| 484 |
simde_uint32x2_t |
| 485 |
simde_vqshl_u32 (const simde_uint32x2_t a, const simde_int32x2_t b) { |
| 486 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 487 |
return vqshl_u32(a, b); |
| 488 |
#else |
| 489 |
simde_uint32x2_private |
| 490 |
r_, |
| 491 |
a_ = simde_uint32x2_to_private(a); |
| 492 |
simde_int32x2_private |
| 493 |
b_ = simde_int32x2_to_private(b); |
| 494 |
|
| 495 |
SIMDE_VECTORIZE |
| 496 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 497 |
r_.values[i] = simde_vqshls_u32(a_.values[i], b_.values[i]); |
| 498 |
} |
| 499 |
|
| 500 |
return simde_uint32x2_from_private(r_); |
| 501 |
#endif |
| 502 |
} |
| 503 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 504 |
#undef vqshl_u32 |
| 505 |
#define vqshl_u32(a, b) simde_vqshl_u32((a), (b)) |
| 506 |
#endif |
| 507 |
|
| 508 |
SIMDE_FUNCTION_ATTRIBUTES |
| 509 |
simde_uint64x1_t |
| 510 |
simde_vqshl_u64 (const simde_uint64x1_t a, const simde_int64x1_t b) { |
| 511 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 512 |
return vqshl_u64(a, b); |
| 513 |
#else |
| 514 |
simde_uint64x1_private |
| 515 |
r_, |
| 516 |
a_ = simde_uint64x1_to_private(a); |
| 517 |
simde_int64x1_private |
| 518 |
b_ = simde_int64x1_to_private(b); |
| 519 |
|
| 520 |
SIMDE_VECTORIZE |
| 521 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 522 |
r_.values[i] = simde_vqshld_u64(a_.values[i], b_.values[i]); |
| 523 |
} |
| 524 |
|
| 525 |
return simde_uint64x1_from_private(r_); |
| 526 |
#endif |
| 527 |
} |
| 528 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 529 |
#undef vqshl_u64 |
| 530 |
#define vqshl_u64(a, b) simde_vqshl_u64((a), (b)) |
| 531 |
#endif |
| 532 |
|
| 533 |
SIMDE_FUNCTION_ATTRIBUTES |
| 534 |
simde_int8x16_t |
| 535 |
simde_vqshlq_s8 (const simde_int8x16_t a, const simde_int8x16_t b) { |
| 536 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 537 |
return vqshlq_s8(a, b); |
| 538 |
#else |
| 539 |
simde_int8x16_private |
| 540 |
r_, |
| 541 |
a_ = simde_int8x16_to_private(a), |
| 542 |
b_ = simde_int8x16_to_private(b); |
| 543 |
|
| 544 |
SIMDE_VECTORIZE |
| 545 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 546 |
r_.values[i] = simde_vqshlb_s8(a_.values[i], b_.values[i]); |
| 547 |
} |
| 548 |
|
| 549 |
return simde_int8x16_from_private(r_); |
| 550 |
#endif |
| 551 |
} |
| 552 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 553 |
#undef vqshlq_s8 |
| 554 |
#define vqshlq_s8(a, b) simde_vqshlq_s8((a), (b)) |
| 555 |
#endif |
| 556 |
|
| 557 |
SIMDE_FUNCTION_ATTRIBUTES |
| 558 |
simde_int16x8_t |
| 559 |
simde_vqshlq_s16 (const simde_int16x8_t a, const simde_int16x8_t b) { |
| 560 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 561 |
return vqshlq_s16(a, b); |
| 562 |
#else |
| 563 |
simde_int16x8_private |
| 564 |
r_, |
| 565 |
a_ = simde_int16x8_to_private(a), |
| 566 |
b_ = simde_int16x8_to_private(b); |
| 567 |
|
| 568 |
SIMDE_VECTORIZE |
| 569 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 570 |
r_.values[i] = simde_vqshlh_s16(a_.values[i], b_.values[i]); |
| 571 |
} |
| 572 |
|
| 573 |
return simde_int16x8_from_private(r_); |
| 574 |
#endif |
| 575 |
} |
| 576 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 577 |
#undef vqshlq_s16 |
| 578 |
#define vqshlq_s16(a, b) simde_vqshlq_s16((a), (b)) |
| 579 |
#endif |
| 580 |
|
| 581 |
SIMDE_FUNCTION_ATTRIBUTES |
| 582 |
simde_int32x4_t |
| 583 |
simde_vqshlq_s32 (const simde_int32x4_t a, const simde_int32x4_t b) { |
| 584 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 585 |
return vqshlq_s32(a, b); |
| 586 |
#else |
| 587 |
simde_int32x4_private |
| 588 |
r_, |
| 589 |
a_ = simde_int32x4_to_private(a), |
| 590 |
b_ = simde_int32x4_to_private(b); |
| 591 |
|
| 592 |
SIMDE_VECTORIZE |
| 593 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 594 |
r_.values[i] = simde_vqshls_s32(a_.values[i], b_.values[i]); |
| 595 |
} |
| 596 |
|
| 597 |
return simde_int32x4_from_private(r_); |
| 598 |
#endif |
| 599 |
} |
| 600 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 601 |
#undef vqshlq_s32 |
| 602 |
#define vqshlq_s32(a, b) simde_vqshlq_s32((a), (b)) |
| 603 |
#endif |
| 604 |
|
| 605 |
SIMDE_FUNCTION_ATTRIBUTES |
| 606 |
simde_int64x2_t |
| 607 |
simde_vqshlq_s64 (const simde_int64x2_t a, const simde_int64x2_t b) { |
| 608 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 609 |
return vqshlq_s64(a, b); |
| 610 |
#else |
| 611 |
simde_int64x2_private |
| 612 |
r_, |
| 613 |
a_ = simde_int64x2_to_private(a), |
| 614 |
b_ = simde_int64x2_to_private(b); |
| 615 |
|
| 616 |
SIMDE_VECTORIZE |
| 617 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 618 |
r_.values[i] = simde_vqshld_s64(a_.values[i], b_.values[i]); |
| 619 |
} |
| 620 |
|
| 621 |
return simde_int64x2_from_private(r_); |
| 622 |
#endif |
| 623 |
} |
| 624 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 625 |
#undef vqshlq_s64 |
| 626 |
#define vqshlq_s64(a, b) simde_vqshlq_s64((a), (b)) |
| 627 |
#endif |
| 628 |
|
| 629 |
SIMDE_FUNCTION_ATTRIBUTES |
| 630 |
simde_uint8x16_t |
| 631 |
simde_vqshlq_u8 (const simde_uint8x16_t a, const simde_int8x16_t b) { |
| 632 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 633 |
return vqshlq_u8(a, b); |
| 634 |
#else |
| 635 |
simde_uint8x16_private |
| 636 |
r_, |
| 637 |
a_ = simde_uint8x16_to_private(a); |
| 638 |
simde_int8x16_private |
| 639 |
b_ = simde_int8x16_to_private(b); |
| 640 |
|
| 641 |
SIMDE_VECTORIZE |
| 642 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 643 |
r_.values[i] = simde_vqshlb_u8(a_.values[i], b_.values[i]); |
| 644 |
} |
| 645 |
|
| 646 |
return simde_uint8x16_from_private(r_); |
| 647 |
#endif |
| 648 |
} |
| 649 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 650 |
#undef vqshlq_u8 |
| 651 |
#define vqshlq_u8(a, b) simde_vqshlq_u8((a), (b)) |
| 652 |
#endif |
| 653 |
|
| 654 |
SIMDE_FUNCTION_ATTRIBUTES |
| 655 |
simde_uint16x8_t |
| 656 |
simde_vqshlq_u16 (const simde_uint16x8_t a, const simde_int16x8_t b) { |
| 657 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 658 |
return vqshlq_u16(a, b); |
| 659 |
#else |
| 660 |
simde_uint16x8_private |
| 661 |
r_, |
| 662 |
a_ = simde_uint16x8_to_private(a); |
| 663 |
simde_int16x8_private |
| 664 |
b_ = simde_int16x8_to_private(b); |
| 665 |
|
| 666 |
SIMDE_VECTORIZE |
| 667 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 668 |
r_.values[i] = simde_vqshlh_u16(a_.values[i], b_.values[i]); |
| 669 |
} |
| 670 |
|
| 671 |
return simde_uint16x8_from_private(r_); |
| 672 |
#endif |
| 673 |
} |
| 674 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 675 |
#undef vqshlq_u16 |
| 676 |
#define vqshlq_u16(a, b) simde_vqshlq_u16((a), (b)) |
| 677 |
#endif |
| 678 |
|
| 679 |
SIMDE_FUNCTION_ATTRIBUTES |
| 680 |
simde_uint32x4_t |
| 681 |
simde_vqshlq_u32 (const simde_uint32x4_t a, const simde_int32x4_t b) { |
| 682 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 683 |
return vqshlq_u32(a, b); |
| 684 |
#else |
| 685 |
simde_uint32x4_private |
| 686 |
r_, |
| 687 |
a_ = simde_uint32x4_to_private(a); |
| 688 |
simde_int32x4_private |
| 689 |
b_ = simde_int32x4_to_private(b); |
| 690 |
|
| 691 |
SIMDE_VECTORIZE |
| 692 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 693 |
r_.values[i] = simde_vqshls_u32(a_.values[i], b_.values[i]); |
| 694 |
} |
| 695 |
|
| 696 |
return simde_uint32x4_from_private(r_); |
| 697 |
#endif |
| 698 |
} |
| 699 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 700 |
#undef vqshlq_u32 |
| 701 |
#define vqshlq_u32(a, b) simde_vqshlq_u32((a), (b)) |
| 702 |
#endif |
| 703 |
|
| 704 |
SIMDE_FUNCTION_ATTRIBUTES |
| 705 |
simde_uint64x2_t |
| 706 |
simde_vqshlq_u64 (const simde_uint64x2_t a, const simde_int64x2_t b) { |
| 707 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 708 |
return vqshlq_u64(a, b); |
| 709 |
#else |
| 710 |
simde_uint64x2_private |
| 711 |
r_, |
| 712 |
a_ = simde_uint64x2_to_private(a); |
| 713 |
simde_int64x2_private |
| 714 |
b_ = simde_int64x2_to_private(b); |
| 715 |
|
| 716 |
SIMDE_VECTORIZE |
| 717 |
for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) { |
| 718 |
r_.values[i] = simde_vqshld_u64(a_.values[i], b_.values[i]); |
| 719 |
} |
| 720 |
|
| 721 |
return simde_uint64x2_from_private(r_); |
| 722 |
#endif |
| 723 |
} |
| 724 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 725 |
#undef vqshlq_u64 |
| 726 |
#define vqshlq_u64(a, b) simde_vqshlq_u64((a), (b)) |
| 727 |
#endif |
| 728 |
|
| 729 |
SIMDE_END_DECLS_ |
| 730 |
HEDLEY_DIAGNOSTIC_POP |
| 731 |
|
| 732 |
#endif /* !defined(SIMDE_ARM_NEON_QSHL_H) */ |