diff options
| author | Vladislav Shchapov <vladislav@shchapov.ru> | 2026-02-02 00:11:53 +0500 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-03-11 00:56:15 +0100 |
| commit | 4c621b14a0cd3c4654ff469a02ac10e3356005b4 (patch) | |
| tree | e6f4d995ccb069c8a394ea8d8b764447335db81e | |
| parent | f9606139958fae7d5946fadc66bbbfdc21237c52 (diff) | |
| download | Project-Tick-4c621b14a0cd3c4654ff469a02ac10e3356005b4.tar.gz Project-Tick-4c621b14a0cd3c4654ff469a02ac10e3356005b4.zip | |
Simplify slide_hash_lsx
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
| -rw-r--r-- | arch/loongarch/slide_hash_lsx.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/arch/loongarch/slide_hash_lsx.c b/arch/loongarch/slide_hash_lsx.c index c3d58e9c75..f4c94ea70d 100644 --- a/arch/loongarch/slide_hash_lsx.c +++ b/arch/loongarch/slide_hash_lsx.c @@ -18,24 +18,15 @@ #include <lsxintrin.h> #include <assert.h> -static inline void slide_hash_chain(Pos *table0, Pos *table1, uint32_t entries0, - uint32_t entries1, const __m128i wsize) { - uint32_t entries; - Pos *table; - __m128i value0, value1, result0, result1; - - int on_chain = 0; - -next_chain: - table = (on_chain) ? table1 : table0; - entries = (on_chain) ? entries1 : entries0; - +static inline void slide_hash_chain(Pos *table, uint32_t entries, const __m128i wsize) { table += entries; table -= 16; /* ZALLOC allocates this pointer unless the user chose a custom allocator. * Our alloc function is aligned to 64 byte boundaries */ do { + __m128i value0, value1, result0, result1; + value0 = __lsx_vld(table, 0); value1 = __lsx_vld(table, 16); result0 = __lsx_vssub_hu(value0, wsize); @@ -46,13 +37,6 @@ next_chain: table -= 16; entries -= 16; } while (entries > 0); - - ++on_chain; - if (on_chain > 1) { - return; - } else { - goto next_chain; - } } Z_INTERNAL void slide_hash_lsx(deflate_state *s) { @@ -63,7 +47,8 @@ Z_INTERNAL void slide_hash_lsx(deflate_state *s) { assert(((uintptr_t)s->head & 15) == 0); assert(((uintptr_t)s->prev & 15) == 0); - slide_hash_chain(s->head, s->prev, HASH_SIZE, wsize, xmm_wsize); + slide_hash_chain(s->head, HASH_SIZE, xmm_wsize); + slide_hash_chain(s->prev, wsize, xmm_wsize); } #endif |
