Skip to content
Snippets Groups Projects
Commit cdaaa4ea authored by Krassy Boykinov's avatar Krassy Boykinov Committed by Jakub Jirutka
Browse files

community/zlib-ng: upgrade to 2.1.8

parent 4bbd155a
No related branches found
No related tags found
2 merge requests!75268main/postgresql15: security upgrade to 15.9,!75022community/linux-edge: add hexdump to makedepends
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=zlib-ng
pkgver=2.1.6
pkgrel=1
pkgver=2.1.8
pkgrel=0
pkgdesc="zlib replacement with optimizations for next generation systems"
url="https://github.com/zlib-ng/zlib-ng"
arch="all"
......@@ -10,9 +10,7 @@ license="Zlib"
makedepends="cmake samurai"
checkdepends="gzip xxd zlib-dev"
subpackages="$pkgname-dev"
source="https://github.com/zlib-ng/zlib-ng/archive/$pkgver/zlib-ng-$pkgver.tar.gz
fix-rvv-detection-riscv64.patch
"
source="https://github.com/zlib-ng/zlib-ng/archive/$pkgver/zlib-ng-$pkgver.tar.gz"
# secfixes:
# 2.0.6-r0:
......@@ -48,6 +46,5 @@ package() {
}
sha512sums="
59ef586c09b9a63788475abfd6dd59ed602316b38f543f801bea802ff8bec8b55a89bee90375b8bbffa3bdebc7d92a00903f4b7c94cdc1a53a36e2e1fd71d13a zlib-ng-2.1.6.tar.gz
22433ea48e49688acc6ba318a629362e71a704fe148aa8d0cde00ab9c88603ad0923ea4b3d756fa5261fb56801535111ec277b8665f8ac51a2220a8351c09e73 fix-rvv-detection-riscv64.patch
062c5669791ec7f29e3bc17031c3c4dfec84053d38b39202d2fa91d61e54e6506fe7e086874880caf01a96e0052a69ecc6d749a5a9291d37fdb9d1037d7749e9 zlib-ng-2.1.8.tar.gz
"
diff --git a/arch/riscv/riscv_features.c b/arch/riscv/riscv_features.c
index b066f42..259a63a 100644
--- a/arch/riscv/riscv_features.c
+++ b/arch/riscv/riscv_features.c
@@ -42,4 +42,20 @@ void Z_INTERNAL riscv_check_features(struct riscv_cpu_features *features) {
riscv_check_features_runtime(features);
else
riscv_check_features_compile_time(features);
+ if (features->has_rvv) {
+ size_t e8m1_vec_len;
+ int64_t vtype_reg_val;
+ // Check that a vuint8m1_t vector is at least 16 bytes and that tail
+ // agnostic and mask agnostic mode are supported
+ //
+ __asm__ volatile(
+ "vsetvli %0, zero, e8, m1, ta, ma\n\t"
+ "csrr %1, vtype"
+ : "=r"(e8m1_vec_len), "=r"(vtype_reg_val));
+
+ // The RVV target is supported if the VILL bit of VTYPE (the MSB bit of
+ // VTYPE) is not set and the length of a vuint8m1_t vector is at least 16
+ // bytes
+ features->has_rvv = (vtype_reg_val >= 0 && e8m1_vec_len >= 16);
+ }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment