aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi@remlab.net>2024-07-27 14:55:04 +0300
committerRémi Denis-Courmont <remi@remlab.net>2024-07-30 18:41:51 +0300
commitbd0c3edb136fb79a8d99fd0dfc50c15e40a2355b (patch)
tree30826c633d18acc03834fa9723d8c72c39aef6cb /libavutil
parent5171baa2289322d57aa36df321582719293f231c (diff)
downloadffmpeg-bd0c3edb136fb79a8d99fd0dfc50c15e40a2355b.tar.gz
lavu/riscv: count bytes rather than words for bswap32
This removes the dependency on Zba at essentially zero cost.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/riscv/bswap_rvb.S10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavutil/riscv/bswap_rvb.S b/libavutil/riscv/bswap_rvb.S
index 3ff53ccb56..bc07779c44 100644
--- a/libavutil/riscv/bswap_rvb.S
+++ b/libavutil/riscv/bswap_rvb.S
@@ -20,21 +20,21 @@
#if (__riscv_xlen >= 64)
.macro bswap32_rvb out, in, count
- andi t0, \count, 4
+ andi t0, \count, 1
beqz t0, 1f
/* Align input to 64-bit */
lwu t0, (\in)
addi \out, \out, 4
rev8 t0, t0
- addi \count, \count, -1
+ addi \count, \count, -4
srli t0, t0, __riscv_xlen - 32
addi \in, \in, 4
sw t0, -4(\out)
1:
- andi t3, \count, -2
- sh2add \count, \count, \out
+ andi t3, \count, -8
+ add \count, \count, \out
beqz t3, 3f
- sh2add t3, t3, \out
+ add t3, t3, \out
2: /* 2 elements (64 bits) at a time on a 64-bit boundary */
ld t0, (\in)
addi \out, \out, 8