diff options
| author | sdlyyxy <[email protected]> | 2023-06-25 11:14:15 +0800 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2023-07-05 13:28:45 -0400 |
| commit | a03b7af06188134ab633bf9447ce5a4193a2dd95 (patch) | |
| tree | 9fb7b1f9aae5086cf3a4937c13e3bb4d80f91c0b /c | |
| parent | 38a06e78d3f39cff749a8230d94394d62e00251d (diff) | |
NEON: only use __builtin_shufflevector on clang
Diffstat (limited to 'c')
| -rw-r--r-- | c/blake3_neon.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/c/blake3_neon.c b/c/blake3_neon.c index 3e58703..ec38cdb 100644 --- a/c/blake3_neon.c +++ b/c/blake3_neon.c @@ -44,7 +44,14 @@ INLINE uint32x4_t rot12_128(uint32x4_t x) { } INLINE uint32x4_t rot8_128(uint32x4_t x) { +#if defined(__clang__) return vreinterpretq_u32_u8(__builtin_shufflevector(vreinterpretq_u8_u32(x), vreinterpretq_u8_u32(x), 1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12)); +#elif __GNUC__ * 10000 + __GNUC_MINOR__ * 100 >=40700 + static const uint8x16_t r8 = {1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12}; + return vreinterpretq_u32_u8(__builtin_shuffle(vreinterpretq_u8_u32(x), vreinterpretq_u8_u32(x), r8)); +#else + return vsriq_n_u32(vshlq_n_u32(x, 32-8), x, 8); +#endif } INLINE uint32x4_t rot7_128(uint32x4_t x) { |
