History

lavc/bswapdsp: purge RISC-V V bswap32

This cannot beat the Zbb implementation, and it is unlikely that a real meaningful CPU design would support V and not Zbb. The best loop rewrite that I could come up with (4 shifts, 2 ands, 3 ors) is still ~40% slower than Zbb. A proper faster vector implementation should be feasible with the cryptographic vector extensions, but that is a story for another time.

Rémi Denis-Courmont committed 3 years ago

Commit 61e5ca41 parent 5de1db52 files · +1 −27Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/riscv/bswapdsp_init.c +1 −4
  2. libavcodec/riscv/bswapdsp_rvv.S +0 −23
libavcodec/riscv/bswapdsp_init.c+1−4
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include "libavcodec/bswapdsp.h"
2727
2828 void ff_bswap32_buf_rvb(uint32_t *dst, const uint32_t *src, int len);
29−void ff_bswap32_buf_rvv(uint32_t *dst, const uint32_t *src, int len);
3029 void ff_bswap16_buf_rvv(uint16_t *dst, const uint16_t *src, int len);
3130
3231 av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c)
@@ -39,10 +38,8 @@ av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c) · 6 unmodified lines
3938 c->bswap_buf = ff_bswap32_buf_rvb;
4039 #endif
4140 #if HAVE_RVV
42− if (flags & AV_CPU_FLAG_RVV_I32) {
43− c->bswap_buf = ff_bswap32_buf_rvv;
41+ if (flags & AV_CPU_FLAG_RVV_I32)
4442 c->bswap16_buf = ff_bswap16_buf_rvv;
45− }
4643 #endif
4744 }
4845 }
libavcodec/riscv/bswapdsp_rvv.S+0−23
@@ -21,29 +21,6 @@ · 20 unmodified lines
2121 #include "config.h"
2222 #include "libavutil/riscv/asm.S"
2323
24−func ff_bswap32_buf_rvv, zve32x
25− li t4, 4
26− addi t1, a0, 1
27− addi t2, a0, 2
28− addi t3, a0, 3
29−1:
30− vsetvli t0, a2, e8, m1, ta, ma
31− vlseg4e8.v v8, (a1)
32− sub a2, a2, t0
33− sh2add a1, t0, a1
34− vsse8.v v8, (t3), t4
35− sh2add t3, t0, t3
36− vsse8.v v9, (t2), t4
37− sh2add t2, t0, t2
38− vsse8.v v10, (t1), t4
39− sh2add t1, t0, t1
40− vsse8.v v11, (a0), t4
41− sh2add a0, t0, a0
42− bnez a2, 1b
43−
44− ret
45−endfunc
46−
4724 func ff_bswap16_buf_rvv, zve32x
4825 1:
4926 vsetvli t0, a2, e16, m8, ta, ma

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t