| 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 Sean Maher <[email protected]> |
| 26 |
*/ |
| 27 |
|
| 28 |
#if !defined(SIMDE_ARM_NEON_LD4_H) |
| 29 |
#define SIMDE_ARM_NEON_LD4_H |
| 30 |
|
| 31 |
#include "types.h" |
| 32 |
|
| 33 |
HEDLEY_DIAGNOSTIC_PUSH |
| 34 |
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS |
| 35 |
#if HEDLEY_GCC_VERSION_CHECK(7,0,0) |
| 36 |
SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_ |
| 37 |
#endif |
| 38 |
SIMDE_BEGIN_DECLS_ |
| 39 |
|
| 40 |
#if !defined(SIMDE_BUG_INTEL_857088) |
| 41 |
|
| 42 |
SIMDE_FUNCTION_ATTRIBUTES |
| 43 |
simde_float32x2x4_t |
| 44 |
simde_vld4_f32(simde_float32 const ptr[HEDLEY_ARRAY_PARAM(8)]) { |
| 45 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 46 |
return vld4_f32(ptr); |
| 47 |
#else |
| 48 |
simde_float32x2_private a_[4]; |
| 49 |
for (size_t i = 0; i < (sizeof(simde_float32x2_t) / sizeof(*ptr)) * 4 ; i++) { |
| 50 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 51 |
} |
| 52 |
simde_float32x2x4_t s_ = { { simde_float32x2_from_private(a_[0]), simde_float32x2_from_private(a_[1]), |
| 53 |
simde_float32x2_from_private(a_[2]), simde_float32x2_from_private(a_[3]) } }; |
| 54 |
return (s_); |
| 55 |
#endif |
| 56 |
} |
| 57 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 58 |
#undef vld4_f32 |
| 59 |
#define vld4_f32(a) simde_vld4_f32((a)) |
| 60 |
#endif |
| 61 |
|
| 62 |
SIMDE_FUNCTION_ATTRIBUTES |
| 63 |
simde_float64x1x4_t |
| 64 |
simde_vld4_f64(simde_float64 const ptr[HEDLEY_ARRAY_PARAM(4)]) { |
| 65 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 66 |
return vld4_f64(ptr); |
| 67 |
#else |
| 68 |
simde_float64x1_private a_[4]; |
| 69 |
for (size_t i = 0; i < (sizeof(simde_float64x1_t) / sizeof(*ptr)) * 4 ; i++) { |
| 70 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 71 |
} |
| 72 |
simde_float64x1x4_t s_ = { { simde_float64x1_from_private(a_[0]), simde_float64x1_from_private(a_[1]), |
| 73 |
simde_float64x1_from_private(a_[2]), simde_float64x1_from_private(a_[3]) } }; |
| 74 |
return s_; |
| 75 |
#endif |
| 76 |
} |
| 77 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 78 |
#undef vld4_f64 |
| 79 |
#define vld4_f64(a) simde_vld4_f64((a)) |
| 80 |
#endif |
| 81 |
|
| 82 |
SIMDE_FUNCTION_ATTRIBUTES |
| 83 |
simde_int8x8x4_t |
| 84 |
simde_vld4_s8(int8_t const ptr[HEDLEY_ARRAY_PARAM(32)]) { |
| 85 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 86 |
return vld4_s8(ptr); |
| 87 |
#else |
| 88 |
simde_int8x8_private a_[4]; |
| 89 |
for (size_t i = 0; i < (sizeof(simde_int8x8_t) / sizeof(*ptr)) * 4 ; i++) { |
| 90 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 91 |
} |
| 92 |
simde_int8x8x4_t s_ = { { simde_int8x8_from_private(a_[0]), simde_int8x8_from_private(a_[1]), |
| 93 |
simde_int8x8_from_private(a_[2]), simde_int8x8_from_private(a_[3]) } }; |
| 94 |
return s_; |
| 95 |
#endif |
| 96 |
} |
| 97 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 98 |
#undef vld4_s8 |
| 99 |
#define vld4_s8(a) simde_vld4_s8((a)) |
| 100 |
#endif |
| 101 |
|
| 102 |
SIMDE_FUNCTION_ATTRIBUTES |
| 103 |
simde_int16x4x4_t |
| 104 |
simde_vld4_s16(int16_t const ptr[HEDLEY_ARRAY_PARAM(16)]) { |
| 105 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 106 |
return vld4_s16(ptr); |
| 107 |
#else |
| 108 |
simde_int16x4_private a_[4]; |
| 109 |
for (size_t i = 0; i < (sizeof(simde_int16x4_t) / sizeof(*ptr)) * 4 ; i++) { |
| 110 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 111 |
} |
| 112 |
simde_int16x4x4_t s_ = { { simde_int16x4_from_private(a_[0]), simde_int16x4_from_private(a_[1]), |
| 113 |
simde_int16x4_from_private(a_[2]), simde_int16x4_from_private(a_[3]) } }; |
| 114 |
return s_; |
| 115 |
#endif |
| 116 |
} |
| 117 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 118 |
#undef vld4_s16 |
| 119 |
#define vld4_s16(a) simde_vld4_s16((a)) |
| 120 |
#endif |
| 121 |
|
| 122 |
SIMDE_FUNCTION_ATTRIBUTES |
| 123 |
simde_int32x2x4_t |
| 124 |
simde_vld4_s32(int32_t const ptr[HEDLEY_ARRAY_PARAM(8)]) { |
| 125 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 126 |
return vld4_s32(ptr); |
| 127 |
#else |
| 128 |
simde_int32x2_private a_[4]; |
| 129 |
for (size_t i = 0; i < (sizeof(simde_int32x2_t) / sizeof(*ptr)) * 4 ; i++) { |
| 130 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 131 |
} |
| 132 |
simde_int32x2x4_t s_ = { { simde_int32x2_from_private(a_[0]), simde_int32x2_from_private(a_[1]), |
| 133 |
simde_int32x2_from_private(a_[2]), simde_int32x2_from_private(a_[3]) } }; |
| 134 |
return s_; |
| 135 |
#endif |
| 136 |
} |
| 137 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 138 |
#undef vld4_s32 |
| 139 |
#define vld4_s32(a) simde_vld4_s32((a)) |
| 140 |
#endif |
| 141 |
|
| 142 |
SIMDE_FUNCTION_ATTRIBUTES |
| 143 |
simde_int64x1x4_t |
| 144 |
simde_vld4_s64(int64_t const ptr[HEDLEY_ARRAY_PARAM(4)]) { |
| 145 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 146 |
return vld4_s64(ptr); |
| 147 |
#else |
| 148 |
simde_int64x1_private a_[4]; |
| 149 |
for (size_t i = 0; i < (sizeof(simde_int64x1_t) / sizeof(*ptr)) * 4 ; i++) { |
| 150 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 151 |
} |
| 152 |
simde_int64x1x4_t s_ = { { simde_int64x1_from_private(a_[0]), simde_int64x1_from_private(a_[1]), |
| 153 |
simde_int64x1_from_private(a_[2]), simde_int64x1_from_private(a_[3]) } }; |
| 154 |
return s_; |
| 155 |
#endif |
| 156 |
} |
| 157 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 158 |
#undef vld4_s64 |
| 159 |
#define vld4_s64(a) simde_vld4_s64((a)) |
| 160 |
#endif |
| 161 |
|
| 162 |
SIMDE_FUNCTION_ATTRIBUTES |
| 163 |
simde_uint8x8x4_t |
| 164 |
simde_vld4_u8(uint8_t const ptr[HEDLEY_ARRAY_PARAM(32)]) { |
| 165 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 166 |
return vld4_u8(ptr); |
| 167 |
#else |
| 168 |
simde_uint8x8_private a_[4]; |
| 169 |
for (size_t i = 0; i < (sizeof(simde_uint8x8_t) / sizeof(*ptr)) * 4 ; i++) { |
| 170 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 171 |
} |
| 172 |
simde_uint8x8x4_t s_ = { { simde_uint8x8_from_private(a_[0]), simde_uint8x8_from_private(a_[1]), |
| 173 |
simde_uint8x8_from_private(a_[2]), simde_uint8x8_from_private(a_[3]) } }; |
| 174 |
return s_; |
| 175 |
#endif |
| 176 |
} |
| 177 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 178 |
#undef vld4_u8 |
| 179 |
#define vld4_u8(a) simde_vld4_u8((a)) |
| 180 |
#endif |
| 181 |
|
| 182 |
SIMDE_FUNCTION_ATTRIBUTES |
| 183 |
simde_uint16x4x4_t |
| 184 |
simde_vld4_u16(uint16_t const ptr[HEDLEY_ARRAY_PARAM(16)]) { |
| 185 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 186 |
return vld4_u16(ptr); |
| 187 |
#else |
| 188 |
simde_uint16x4_private a_[4]; |
| 189 |
for (size_t i = 0; i < (sizeof(simde_uint16x4_t) / sizeof(*ptr)) * 4 ; i++) { |
| 190 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 191 |
} |
| 192 |
simde_uint16x4x4_t s_ = { { simde_uint16x4_from_private(a_[0]), simde_uint16x4_from_private(a_[1]), |
| 193 |
simde_uint16x4_from_private(a_[2]), simde_uint16x4_from_private(a_[3]) } }; |
| 194 |
return s_; |
| 195 |
#endif |
| 196 |
} |
| 197 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 198 |
#undef vld4_u16 |
| 199 |
#define vld4_u16(a) simde_vld4_u16((a)) |
| 200 |
#endif |
| 201 |
|
| 202 |
SIMDE_FUNCTION_ATTRIBUTES |
| 203 |
simde_uint32x2x4_t |
| 204 |
simde_vld4_u32(uint32_t const ptr[HEDLEY_ARRAY_PARAM(8)]) { |
| 205 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 206 |
return vld4_u32(ptr); |
| 207 |
#else |
| 208 |
simde_uint32x2_private a_[4]; |
| 209 |
for (size_t i = 0; i < (sizeof(simde_uint32x2_t) / sizeof(*ptr)) * 4 ; i++) { |
| 210 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 211 |
} |
| 212 |
simde_uint32x2x4_t s_ = { { simde_uint32x2_from_private(a_[0]), simde_uint32x2_from_private(a_[1]), |
| 213 |
simde_uint32x2_from_private(a_[2]), simde_uint32x2_from_private(a_[3]) } }; |
| 214 |
return s_; |
| 215 |
#endif |
| 216 |
} |
| 217 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 218 |
#undef vld4_u32 |
| 219 |
#define vld4_u32(a) simde_vld4_u32((a)) |
| 220 |
#endif |
| 221 |
|
| 222 |
SIMDE_FUNCTION_ATTRIBUTES |
| 223 |
simde_uint64x1x4_t |
| 224 |
simde_vld4_u64(uint64_t const ptr[HEDLEY_ARRAY_PARAM(4)]) { |
| 225 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 226 |
return vld4_u64(ptr); |
| 227 |
#else |
| 228 |
simde_uint64x1_private a_[4]; |
| 229 |
for (size_t i = 0; i < (sizeof(simde_uint64x1_t) / sizeof(*ptr)) * 4 ; i++) { |
| 230 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 231 |
} |
| 232 |
simde_uint64x1x4_t s_ = { { simde_uint64x1_from_private(a_[0]), simde_uint64x1_from_private(a_[1]), |
| 233 |
simde_uint64x1_from_private(a_[2]), simde_uint64x1_from_private(a_[3]) } }; |
| 234 |
return s_; |
| 235 |
#endif |
| 236 |
} |
| 237 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 238 |
#undef vld4_u64 |
| 239 |
#define vld4_u64(a) simde_vld4_u64((a)) |
| 240 |
#endif |
| 241 |
|
| 242 |
SIMDE_FUNCTION_ATTRIBUTES |
| 243 |
simde_float32x4x4_t |
| 244 |
simde_vld4q_f32(simde_float32 const ptr[HEDLEY_ARRAY_PARAM(16)]) { |
| 245 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 246 |
return vld4q_f32(ptr); |
| 247 |
#else |
| 248 |
simde_float32x4_private a_[4]; |
| 249 |
for (size_t i = 0; i < (sizeof(simde_float32x4_t) / sizeof(*ptr)) * 4 ; i++) { |
| 250 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 251 |
} |
| 252 |
simde_float32x4x4_t s_ = { { simde_float32x4_from_private(a_[0]), simde_float32x4_from_private(a_[1]), |
| 253 |
simde_float32x4_from_private(a_[2]), simde_float32x4_from_private(a_[3]) } }; |
| 254 |
return s_; |
| 255 |
#endif |
| 256 |
} |
| 257 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 258 |
#undef vld4q_f32 |
| 259 |
#define vld4q_f32(a) simde_vld4q_f32((a)) |
| 260 |
#endif |
| 261 |
|
| 262 |
SIMDE_FUNCTION_ATTRIBUTES |
| 263 |
simde_float64x2x4_t |
| 264 |
simde_vld4q_f64(simde_float64 const ptr[HEDLEY_ARRAY_PARAM(8)]) { |
| 265 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 266 |
return vld4q_f64(ptr); |
| 267 |
#else |
| 268 |
simde_float64x2_private a_[4]; |
| 269 |
for (size_t i = 0; i < (sizeof(simde_float64x2_t) / sizeof(*ptr)) * 4 ; i++) { |
| 270 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 271 |
} |
| 272 |
simde_float64x2x4_t s_ = { { simde_float64x2_from_private(a_[0]), simde_float64x2_from_private(a_[1]), |
| 273 |
simde_float64x2_from_private(a_[2]), simde_float64x2_from_private(a_[3]) } }; |
| 274 |
return s_; |
| 275 |
#endif |
| 276 |
} |
| 277 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 278 |
#undef vld4q_f64 |
| 279 |
#define vld4q_f64(a) simde_vld4q_f64((a)) |
| 280 |
#endif |
| 281 |
|
| 282 |
SIMDE_FUNCTION_ATTRIBUTES |
| 283 |
simde_int8x16x4_t |
| 284 |
simde_vld4q_s8(int8_t const ptr[HEDLEY_ARRAY_PARAM(64)]) { |
| 285 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 286 |
return vld4q_s8(ptr); |
| 287 |
#else |
| 288 |
simde_int8x16_private a_[4]; |
| 289 |
for (size_t i = 0; i < (sizeof(simde_int8x16_t) / sizeof(*ptr)) * 4 ; i++) { |
| 290 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 291 |
} |
| 292 |
simde_int8x16x4_t s_ = { { simde_int8x16_from_private(a_[0]), simde_int8x16_from_private(a_[1]), |
| 293 |
simde_int8x16_from_private(a_[2]), simde_int8x16_from_private(a_[3]) } }; |
| 294 |
return s_; |
| 295 |
#endif |
| 296 |
} |
| 297 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 298 |
#undef vld4q_s8 |
| 299 |
#define vld4q_s8(a) simde_vld4q_s8((a)) |
| 300 |
#endif |
| 301 |
|
| 302 |
SIMDE_FUNCTION_ATTRIBUTES |
| 303 |
simde_int16x8x4_t |
| 304 |
simde_vld4q_s16(int16_t const ptr[HEDLEY_ARRAY_PARAM(32)]) { |
| 305 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 306 |
return vld4q_s16(ptr); |
| 307 |
#else |
| 308 |
simde_int16x8_private a_[4]; |
| 309 |
for (size_t i = 0; i < (sizeof(simde_int16x8_t) / sizeof(*ptr)) * 4 ; i++) { |
| 310 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 311 |
} |
| 312 |
simde_int16x8x4_t s_ = { { simde_int16x8_from_private(a_[0]), simde_int16x8_from_private(a_[1]), |
| 313 |
simde_int16x8_from_private(a_[2]), simde_int16x8_from_private(a_[3]) } }; |
| 314 |
return s_; |
| 315 |
#endif |
| 316 |
} |
| 317 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 318 |
#undef vld4q_s16 |
| 319 |
#define vld4q_s16(a) simde_vld4q_s16((a)) |
| 320 |
#endif |
| 321 |
|
| 322 |
SIMDE_FUNCTION_ATTRIBUTES |
| 323 |
simde_int32x4x4_t |
| 324 |
simde_vld4q_s32(int32_t const ptr[HEDLEY_ARRAY_PARAM(16)]) { |
| 325 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 326 |
return vld4q_s32(ptr); |
| 327 |
#else |
| 328 |
simde_int32x4_private a_[4]; |
| 329 |
for (size_t i = 0; i < (sizeof(simde_int32x4_t) / sizeof(*ptr)) * 4 ; i++) { |
| 330 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 331 |
} |
| 332 |
simde_int32x4x4_t s_ = { { simde_int32x4_from_private(a_[0]), simde_int32x4_from_private(a_[1]), |
| 333 |
simde_int32x4_from_private(a_[2]), simde_int32x4_from_private(a_[3]) } }; |
| 334 |
return s_; |
| 335 |
#endif |
| 336 |
} |
| 337 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 338 |
#undef vld4q_s32 |
| 339 |
#define vld4q_s32(a) simde_vld4q_s32((a)) |
| 340 |
#endif |
| 341 |
|
| 342 |
SIMDE_FUNCTION_ATTRIBUTES |
| 343 |
simde_int64x2x4_t |
| 344 |
simde_vld4q_s64(int64_t const ptr[HEDLEY_ARRAY_PARAM(8)]) { |
| 345 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 346 |
return vld4q_s64(ptr); |
| 347 |
#else |
| 348 |
simde_int64x2_private a_[4]; |
| 349 |
for (size_t i = 0; i < (sizeof(simde_int64x2_t) / sizeof(*ptr)) * 4 ; i++) { |
| 350 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 351 |
} |
| 352 |
simde_int64x2x4_t s_ = { { simde_int64x2_from_private(a_[0]), simde_int64x2_from_private(a_[1]), |
| 353 |
simde_int64x2_from_private(a_[2]), simde_int64x2_from_private(a_[3]) } }; |
| 354 |
return s_; |
| 355 |
#endif |
| 356 |
} |
| 357 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 358 |
#undef vld4q_s64 |
| 359 |
#define vld4q_s64(a) simde_vld4q_s64((a)) |
| 360 |
#endif |
| 361 |
|
| 362 |
SIMDE_FUNCTION_ATTRIBUTES |
| 363 |
simde_uint8x16x4_t |
| 364 |
simde_vld4q_u8(uint8_t const ptr[HEDLEY_ARRAY_PARAM(64)]) { |
| 365 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 366 |
return vld4q_u8(ptr); |
| 367 |
#elif defined(SIMDE_WASM_SIMD128_NATIVE) |
| 368 |
// Let a, b, c, d be the 4 uint8x16 to return, they are laid out in memory: |
| 369 |
// [a0, b0, c0, d0, a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, |
| 370 |
// a4, b4, c4, d4, a5, b5, c5, d5, a6, b6, c6, d6, a7, b7, c7, d7, |
| 371 |
// a8, b8, c8, d8, a9, b9, c9, d9, a10, b10, c10, d10, a11, b11, c11, d11, |
| 372 |
// a12, b12, c12, d12, a13, b13, c13, d13, a14, b14, c14, d14, a15, b15, c15, d15] |
| 373 |
v128_t a_ = wasm_v128_load(&ptr[0]); |
| 374 |
v128_t b_ = wasm_v128_load(&ptr[16]); |
| 375 |
v128_t c_ = wasm_v128_load(&ptr[32]); |
| 376 |
v128_t d_ = wasm_v128_load(&ptr[48]); |
| 377 |
|
| 378 |
v128_t a_low_b_low = wasm_i8x16_shuffle(a_, b_, 0, 4, 8, 12, 16, 20, 24, 28, |
| 379 |
1, 5, 9, 13, 17, 21, 25, 29); |
| 380 |
v128_t a_high_b_high = wasm_i8x16_shuffle(c_, d_, 0, 4, 8, 12, 16, 20, 24, |
| 381 |
28, 1, 5, 9, 13, 17, 21, 25, 29); |
| 382 |
v128_t a = wasm_i8x16_shuffle(a_low_b_low, a_high_b_high, 0, 1, 2, 3, 4, 5, |
| 383 |
6, 7, 16, 17, 18, 19, 20, 21, 22, 23); |
| 384 |
v128_t b = wasm_i8x16_shuffle(a_low_b_low, a_high_b_high, 8, 9, 10, 11, 12, |
| 385 |
13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31); |
| 386 |
|
| 387 |
v128_t c_low_d_low = wasm_i8x16_shuffle(a_, b_, 2, 6, 10, 14, 18, 22, 26, |
| 388 |
30, 3, 7, 11, 15, 19, 23, 27, 31); |
| 389 |
v128_t c_high_d_high = wasm_i8x16_shuffle(c_, d_, 2, 6, 10, 14, 18, 22, 26, |
| 390 |
30, 3, 7, 11, 15, 19, 23, 27, 31); |
| 391 |
v128_t c = wasm_i8x16_shuffle(c_low_d_low, c_high_d_high, 0, 1, 2, 3, 4, 5, |
| 392 |
6, 7, 16, 17, 18, 19, 20, 21, 22, 23); |
| 393 |
v128_t d = wasm_i8x16_shuffle(c_low_d_low, c_high_d_high, 8, 9, 10, 11, 12, |
| 394 |
13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31); |
| 395 |
|
| 396 |
simde_uint8x16_private r_[4]; |
| 397 |
r_[0].v128 = a; |
| 398 |
r_[1].v128 = b; |
| 399 |
r_[2].v128 = c; |
| 400 |
r_[3].v128 = d; |
| 401 |
simde_uint8x16x4_t s_ = {{simde_uint8x16_from_private(r_[0]), |
| 402 |
simde_uint8x16_from_private(r_[1]), |
| 403 |
simde_uint8x16_from_private(r_[2]), |
| 404 |
simde_uint8x16_from_private(r_[3])}}; |
| 405 |
return s_; |
| 406 |
#else |
| 407 |
simde_uint8x16_private a_[4]; |
| 408 |
for (size_t i = 0; i < (sizeof(simde_uint8x16_t) / sizeof(*ptr)) * 4 ; i++) { |
| 409 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 410 |
} |
| 411 |
simde_uint8x16x4_t s_ = { { simde_uint8x16_from_private(a_[0]), simde_uint8x16_from_private(a_[1]), |
| 412 |
simde_uint8x16_from_private(a_[2]), simde_uint8x16_from_private(a_[3]) } }; |
| 413 |
return s_; |
| 414 |
#endif |
| 415 |
} |
| 416 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 417 |
#undef vld4q_u8 |
| 418 |
#define vld4q_u8(a) simde_vld4q_u8((a)) |
| 419 |
#endif |
| 420 |
|
| 421 |
SIMDE_FUNCTION_ATTRIBUTES |
| 422 |
simde_uint16x8x4_t |
| 423 |
simde_vld4q_u16(uint16_t const ptr[HEDLEY_ARRAY_PARAM(32)]) { |
| 424 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 425 |
return vld4q_u16(ptr); |
| 426 |
#else |
| 427 |
simde_uint16x8_private a_[4]; |
| 428 |
for (size_t i = 0; i < (sizeof(simde_uint16x8_t) / sizeof(*ptr)) * 4 ; i++) { |
| 429 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 430 |
} |
| 431 |
simde_uint16x8x4_t s_ = { { simde_uint16x8_from_private(a_[0]), simde_uint16x8_from_private(a_[1]), |
| 432 |
simde_uint16x8_from_private(a_[2]), simde_uint16x8_from_private(a_[3]) } }; |
| 433 |
return s_; |
| 434 |
#endif |
| 435 |
} |
| 436 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 437 |
#undef vld4q_u16 |
| 438 |
#define vld4q_u16(a) simde_vld4q_u16((a)) |
| 439 |
#endif |
| 440 |
|
| 441 |
SIMDE_FUNCTION_ATTRIBUTES |
| 442 |
simde_uint32x4x4_t |
| 443 |
simde_vld4q_u32(uint32_t const ptr[HEDLEY_ARRAY_PARAM(16)]) { |
| 444 |
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 445 |
return vld4q_u32(ptr); |
| 446 |
#else |
| 447 |
simde_uint32x4_private a_[4]; |
| 448 |
for (size_t i = 0; i < (sizeof(simde_uint32x4_t) / sizeof(*ptr)) * 4 ; i++) { |
| 449 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 450 |
} |
| 451 |
simde_uint32x4x4_t s_ = { { simde_uint32x4_from_private(a_[0]), simde_uint32x4_from_private(a_[1]), |
| 452 |
simde_uint32x4_from_private(a_[2]), simde_uint32x4_from_private(a_[3]) } }; |
| 453 |
return s_; |
| 454 |
#endif |
| 455 |
} |
| 456 |
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES) |
| 457 |
#undef vld4q_u32 |
| 458 |
#define vld4q_u32(a) simde_vld4q_u32((a)) |
| 459 |
#endif |
| 460 |
|
| 461 |
SIMDE_FUNCTION_ATTRIBUTES |
| 462 |
simde_uint64x2x4_t |
| 463 |
simde_vld4q_u64(uint64_t const ptr[HEDLEY_ARRAY_PARAM(8)]) { |
| 464 |
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 465 |
return vld4q_u64(ptr); |
| 466 |
#else |
| 467 |
simde_uint64x2_private a_[4]; |
| 468 |
for (size_t i = 0; i < (sizeof(simde_uint64x2_t) / sizeof(*ptr)) * 4 ; i++) { |
| 469 |
a_[i % 4].values[i / 4] = ptr[i]; |
| 470 |
} |
| 471 |
simde_uint64x2x4_t s_ = { { simde_uint64x2_from_private(a_[0]), simde_uint64x2_from_private(a_[1]), |
| 472 |
simde_uint64x2_from_private(a_[2]), simde_uint64x2_from_private(a_[3]) } }; |
| 473 |
return s_; |
| 474 |
#endif |
| 475 |
} |
| 476 |
#if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) |
| 477 |
#undef vld4q_u64 |
| 478 |
#define vld4q_u64(a) simde_vld4q_u64((a)) |
| 479 |
#endif |
| 480 |
|
| 481 |
#endif /* !defined(SIMDE_BUG_INTEL_857088) */ |
| 482 |
|
| 483 |
SIMDE_END_DECLS_ |
| 484 |
HEDLEY_DIAGNOSTIC_POP |
| 485 |
|
| 486 |
#endif /* !defined(SIMDE_ARM_NEON_LD4_H) */ |