From: Nathan Moein Vaziri Date: Thu, 2 Apr 2026 02:23:27 +0000 (-0700) Subject: Move S390 VX vector typedefs into vx_intrins.h X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;ds=inline;p=thirdparty%2Fzlib-ng.git Move S390 VX vector typedefs into vx_intrins.h The `vector` keyword requires -fzvector which is not available on all GCC versions (e.g. EL10). Use __attribute__((vector_size(16))) typedefs instead, matching the existing style in crc32_vx.c. --- diff --git a/arch/s390/crc32_vx.c b/arch/s390/crc32_vx.c index b8383db1f..0c0fdfcc4 100644 --- a/arch/s390/crc32_vx.c +++ b/arch/s390/crc32_vx.c @@ -19,10 +19,6 @@ #include "vx_intrins.h" -typedef unsigned char uv16qi __attribute__((vector_size(16))); -typedef unsigned int uv4si __attribute__((vector_size(16))); -typedef unsigned long long uv2di __attribute__((vector_size(16))); - static uint32_t crc32_le_vgfm_16(uint32_t crc, const uint8_t *buf, size_t len) { /* * The CRC-32 constant block contains reduction constants to fold and diff --git a/arch/s390/slide_hash_vx.c b/arch/s390/slide_hash_vx.c index 03f722e99..0939bc984 100644 --- a/arch/s390/slide_hash_vx.c +++ b/arch/s390/slide_hash_vx.c @@ -10,11 +10,11 @@ #include "vx_intrins.h" static inline void slide_hash_chain(Pos *table, uint32_t entries, uint16_t wsize) { - const vector unsigned short vmx_wsize = vec_splats(wsize); + const uv8hi vmx_wsize = vec_splats(wsize); Pos *p = table; do { - vector unsigned short value, result; + uv8hi value, result; value = vec_xl(0, p); result = vec_sub(value, vec_min(value, vmx_wsize)); diff --git a/arch/s390/vx_intrins.h b/arch/s390/vx_intrins.h index ad82d98d8..f5b217db5 100644 --- a/arch/s390/vx_intrins.h +++ b/arch/s390/vx_intrins.h @@ -3,6 +3,11 @@ #include +typedef unsigned char uv16qi __attribute__((vector_size(16))); +typedef unsigned short uv8hi __attribute__((vector_size(16))); +typedef unsigned int uv4si __attribute__((vector_size(16))); +typedef unsigned long long uv2di __attribute__((vector_size(16))); + #ifndef vec_sub #define vec_sub(a, b) ((a) - (b)) #endif