Skip to content

Commit

Permalink
add vrev8.v byteswap
Browse files Browse the repository at this point in the history
  • Loading branch information
camel-cdr committed Aug 17, 2024
1 parent d4ffade commit 92b2e5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bench/byteswap.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#if HAS_RVV_1_0

#ifdef MX
.global MX(byteswap32_rvv_vrev8_)
MX(byteswap32_rvv_vrev8_):
1:
vsetvli t0, a1, e32, MX(), ta, ma
vle32.v v0, (a0)
vrev8.v v8, v0
vse32.v v8, (a0)
sub a1, a1, t0
slli t1, t0, 2
add a0, a0, t1
bnez a1, 1b
ret
#endif

#if MX_N == 4 || MX_N == 2 || MX_N == 1

# a0 = ptr, a1 = len
Expand Down
1 change: 1 addition & 0 deletions bench/byteswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ byteswap32_SWAR_rev8(uint32_t *ptr, size_t n)
#define IMPLS_RVV(f)
#else
#define IMPLS_RVV(f) \
MX(f,rvv_vrev8) \
f(rvv_gatherei16_m1) \
f(rvv_gatherei16_m2) \
f(rvv_gatherei16_m4) \
Expand Down

0 comments on commit 92b2e5a

Please sign in to comment.