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
2525
2626 void ff_sbr_sum64x5_rvv(float *z);
2727 float ff_sbr_sum_square_rvv(float (*x)[2], int n);
28+void ff_sbr_neg_odd_64_rvv(float *x);
2829
2930 av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c)
3031 {
@@ -35,5 +36,9 @@ av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) · 4 unmodified lines
3536 c->sum64x5 = ff_sbr_sum64x5_rvv;
3637 c->sum_square = ff_sbr_sum_square_rvv;
3738 }
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
3843 #endif
3944 }
libavcodec/riscv/sbrdsp_rvv.S+17−0
@@ -67,3 +67,20 @@ func ff_sbr_sum_square_rvv, zve32f · 66 unmodified lines
6767 NOHWF fmv.x.w a0, fa0
6868 ret
6969 endfunc
70+
71+#if __riscv_xlen >= 64
72+func ff_sbr_neg_odd_64_rvv, zve64x
73+ li a1, 32
74+ li t1, 1 << 63
75+1:
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
85+endfunc
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