History

Revert "lavc/sbrdsp: R-V V neg_odd_64"

While this function can easily be written with vectors, it just fails to get any performance improvement. For reference, this is a simpler loop-free implementation that does get better performance than the current one depending on hardware, but still more or less the same metrics as the C code: func ff_sbr_neg_odd_64_rvv, zve64x li a1, 32 addi a0, a0, 7 li t0, 8 vsetvli zero, a1, e8, m2, ta, ma li t1, 0x80 vlse8.v v8, (a0), t0 vxor.vx v8, v8, t1 vsse8.v v8, (a0), t0 ret endfunc This reverts commit d06fd18f8f4c6a81ef94cbb600620d83ad51269d.

Rémi Denis-Courmont committed 2 years ago

Commit 7591eb41 parent d452db82 files · +0 −22Browse files

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

Unified · Split

2 files
  1. libavcodec/riscv/sbrdsp_init.c +0 −5
  2. libavcodec/riscv/sbrdsp_rvv.S +0 −17
libavcodec/riscv/sbrdsp_init.c+0−5
@@ -26,7 +26,6 @@ · 25 unmodified lines
26 26
27void ff_sbr_sum64x5_rvv(float *z);27void ff_sbr_sum64x5_rvv(float *z);
28float ff_sbr_sum_square_rvv(float (*x)[2], int n);28float ff_sbr_sum_square_rvv(float (*x)[2], int n);
29void ff_sbr_neg_odd_64_rvv(float *x);
30void ff_sbr_autocorrelate_rvv(const float x[40][2], float phi[3][2][2]);29void ff_sbr_autocorrelate_rvv(const float x[40][2], float phi[3][2][2]);
31void ff_sbr_hf_gen_rvv(float (*X_high)[2], const float (*X_low)[2],30void ff_sbr_hf_gen_rvv(float (*X_high)[2], const float (*X_low)[2],
32 const float alpha0[2], const float alpha1[2],31 const float alpha0[2], const float alpha1[2],
@@ -64,9 +63,5 @@ av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) · 31 unmodified lines
64 }63 }
65 c->autocorrelate = ff_sbr_autocorrelate_rvv;64 c->autocorrelate = ff_sbr_autocorrelate_rvv;
66 }65 }
67#if __riscv_xlen >= 64
68 if ((flags & AV_CPU_FLAG_RVV_I64) && (flags & AV_CPU_FLAG_RVB_ADDR))
69 c->neg_odd_64 = ff_sbr_neg_odd_64_rvv;
70#endif
71#endif66#endif
72}67}
libavcodec/riscv/sbrdsp_rvv.S+0−17
@@ -68,23 +68,6 @@ NOHWF fmv.x.w a0, fa0 · 67 unmodified lines
68 ret68 ret
69endfunc69endfunc
70 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
87
88func ff_sbr_autocorrelate_rvv, zve32f71func ff_sbr_autocorrelate_rvv, zve32f
89 vsetvli t0, zero, e32, m4, ta, ma72 vsetvli t0, zero, e32, m4, ta, ma
90 vmv.v.x v0, zero73 vmv.v.x v0, zero

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