Skip to content

Commit

Permalink
NEON rot7/rot12 use shl+sri
Browse files Browse the repository at this point in the history
  • Loading branch information
sdlyyxy authored and oconnor663 committed Jul 5, 2023
1 parent a03b7af commit 7038dad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c/blake3_neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ INLINE uint32x4_t rot16_128(uint32x4_t x) {
}

INLINE uint32x4_t rot12_128(uint32x4_t x) {
return vorrq_u32(vshrq_n_u32(x, 12), vshlq_n_u32(x, 32 - 12));
return vsriq_n_u32(vshlq_n_u32(x, 32-12), x, 12);
}

INLINE uint32x4_t rot8_128(uint32x4_t x) {
Expand All @@ -55,7 +55,7 @@ INLINE uint32x4_t rot8_128(uint32x4_t x) {
}

INLINE uint32x4_t rot7_128(uint32x4_t x) {
return vorrq_u32(vshrq_n_u32(x, 7), vshlq_n_u32(x, 32 - 7));
return vsriq_n_u32(vshlq_n_u32(x, 32-7), x, 7);
}

// TODO: compress_neon
Expand Down

0 comments on commit 7038dad

Please sign in to comment.