]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
Optimize chunkcopy_rvv:
authorLFF <junzhao.liang@qq.com>
Sat, 7 Jun 2025 08:23:29 +0000 (16:23 +0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 25 Jun 2025 10:06:33 +0000 (12:06 +0200)
commit962ab42190c0fd197595c8f47e2c9ea91fd7c0aa
treeb092489b6a6e7000db65213ae9e0cb6cf43e341f
parentc6bfa9698eafa77eece7ee2d29fbe51d602b41d7
Optimize chunkcopy_rvv:

1. Skip aligning memcpy when dist >= len.
Obviously aligning memcpy is redundant when dist >= len which
contains extra very slow load&store instrutions. And I noticed
that dist is way larger than len in most cases by adding printf in
chunkcopy_rvv with apt install (very narrow situation but makes
sense). So I tend to move the comparing before aligning memcpy
since it is only needed by the overlap situation.

2. Make the largest copy while len > dist.
Chunkcopy_rvv only copies as much memory as possible once after
aligning memcpy then uses sizeof(chunk_t) to finish the rest
copying. However, we should do the largest copy as long as
len < dist.
arch/riscv/chunkset_rvv.c