History

lavc/vc1dsp: use saturating arithmetic for RVV inv_trans_dc

T-Head C908 (cycles): vc1dsp.vc1_inv_trans_4x4_dc_c: 113.7 vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 46.5 (before) vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 45.5 (after) vc1dsp.vc1_inv_trans_4x8_dc_c: 230.7 vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 65.7 (before) vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 52.5 (after) vc1dsp.vc1_inv_trans_8x4_dc_c: 246.7 vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 56.7 (before) vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 45.5 (after) vc1dsp.vc1_inv_trans_8x8_dc_c: 419.7 vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 81.2 (before) vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 53.5 (after)

Rémi Denis-Courmont committed 2 years ago

Commit 324eba61 parent 784a72a1 file · +12 −10Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/riscv/vc1dsp_rvv.S+12−10
@@ -38,18 +38,20 @@ func ff_vc1_inv_trans_\cols\()x\rows\()_dc_rvv, zve64x, zba · 37 unmodified lines
38.endif38.endif
39 addi t2, t2, 6439 addi t2, t2, 64
40 srai t2, t2, 740 srai t2, t2, 7
41.if \rows * \cols == 6441.if \rows * \cols >= 32
42 vsetvli zero, t0, e16, m8, ta, ma42 vsetvli zero, t0, e8, m\mat_lmul, ta, ma
43.elseif \rows * \cols == 32
44 vsetvli zero, t0, e16, m4, ta, ma
45.else43.else
46 vsetivli zero, \rows * \cols, e16, m2, ta, ma44 vsetivli zero, \rows * \cols, e8, m\mat_lmul, ta, ma
47.endif45.endif
48 vzext.vf2 v8, v046 bgez t2, 1f
49 vadd.vx v8, v8, t247
50 vmax.vx v8, v8, zero48 neg t2, t2
51 vsetvli zero, zero, e8, m\mat_lmul, ta, ma49 vssubu.vx v0, v0, t2
52 vnclipu.wi v0, v8, 050 vsetivli zero, \rows, e8, m\row_lmul, ta, ma
51 vsse\w\().v v0, (a0), a1
52 ret
531:
54 vsaddu.vx v0, v0, t2
53 vsetivli zero, \rows, e8, m\row_lmul, ta, ma55 vsetivli zero, \rows, e8, m\row_lmul, ta, ma
54 vsse\w\().v v0, (a0), a156 vsse\w\().v v0, (a0), a1
55 ret57 ret

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