History

lavc/sbrdsp: R-V V neg_odd_64

With 128-bit vectors, this is mostly pointless but also harmless. Performance gains should be more noticeable with larger vector sizes. neg_odd_64_c: 76.2 neg_odd_64_rvv_i64: 74.7

Rémi Denis-Courmont committed 3 years ago

Commit d06fd181 parent b0aba7d2 files · +22 −0Browse files

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

Unified · Split

2 files
  1. libavcodec/riscv/sbrdsp_init.c +5 −0
  2. libavcodec/riscv/sbrdsp_rvv.S +17 −0
libavcodec/riscv/sbrdsp_init.c+5−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
25 25
26void ff_sbr_sum64x5_rvv(float *z);26void ff_sbr_sum64x5_rvv(float *z);
27float ff_sbr_sum_square_rvv(float (*x)[2], int n);27float ff_sbr_sum_square_rvv(float (*x)[2], int n);
28void ff_sbr_neg_odd_64_rvv(float *x);
28 29
29av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c)30av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c)
30{31{
@@ -35,5 +36,9 @@ av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) · 4 unmodified lines
35 c->sum64x5 = ff_sbr_sum64x5_rvv;36 c->sum64x5 = ff_sbr_sum64x5_rvv;
36 c->sum_square = ff_sbr_sum_square_rvv;37 c->sum_square = ff_sbr_sum_square_rvv;
37 }38 }
39#if __riscv_xlen >= 64
40 if ((flags & AV_CPU_FLAG_RVV_I64) && (flags & AV_CPU_FLAG_RVB_ADDR))
41 c->neg_odd_64 = ff_sbr_neg_odd_64_rvv;
42#endif
38#endif43#endif
39}44}
libavcodec/riscv/sbrdsp_rvv.S+17−0
@@ -67,3 +67,20 @@ func ff_sbr_sum_square_rvv, zve32f · 66 unmodified lines
67NOHWF fmv.x.w a0, fa067NOHWF fmv.x.w a0, fa0
68 ret68 ret
69endfunc69endfunc
70
71#if __riscv_xlen >= 64
72func ff_sbr_neg_odd_64_rvv, zve64x
73 li a1, 32
74 li t1, 1 << 63
751:
76 vsetvli t0, a1, e64, m8, ta, ma
77 vle64.v v8, (a0)
78 sub a1, a1, t0
79 vxor.vx v8, v8, t1
80 vse64.v v8, (a0)
81 sh3add a0, t0, a0
82 bnez t0, 1b
83
84 ret
85endfunc
86#endif

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