summaryrefslogtreecommitdiff
path: root/adler32.c
diff options
context:
space:
mode:
authorAdenilson Cavalcanti <cavalcantii@chromium.org>2024-03-18 19:57:28 +0000
committerCopybara-Service <copybara-worker@google.com>2024-03-18 13:29:15 -0700
commit24c07df5033183efad8607cba62e746bea7180bf (patch)
treeb32f04dc3feca68731b11b9a19c4b864e9f51171 /adler32.c
parent24342f69e01ccf34e8fd3ac21edd2b65d2a33267 (diff)
downloadzlib-24c07df5033183efad8607cba62e746bea7180bf.tar.gz
[zlib][riscv] Adding support for RISCV
Adding code to perform CPU features detection at runtime as also calls in the entry points before processing (e.g. deflateInit(), etc). Also add the missing bits in the CMake buildsystem to pass the proper compiler flags and set up the defines that guard optimizations (e.g. DEFLATE_SLIDE_HASH_RVV, ADLER32_SIMD_RVV for now). Todo: update the GN buildsystem next. Bug: 329282661 Change-Id: Ic5a2846b0404393d6d7ffcbd75db800725887ae5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369154 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1274387} NOKEYCHECK=True GitOrigin-RevId: fd5ebdf2a679244930de70972e6d435e274fceee
Diffstat (limited to 'adler32.c')
-rw-r--r--adler32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/adler32.c b/adler32.c
index 99a2944..ebd1889 100644
--- a/adler32.c
+++ b/adler32.c
@@ -90,7 +90,8 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
return adler | (sum2 << 16);
}
-#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
+#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON) \
+ || defined(RISCV_RVV)
/*
* Use SIMD to compute the adler32. Since this function can be
* freely used, check CPU features here. zlib convention is to