From 2ca44eb31ab90d82d76a1a6cdc1ebf6e61e5721f Mon Sep 17 00:00:00 2001 From: Nathan Moein Vaziri Date: Wed, 1 Apr 2026 19:23:27 -0700 Subject: [PATCH] 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. --- arch/s390/crc32_vx.c | 4 ---- arch/s390/slide_hash_vx.c | 4 ++-- arch/s390/vx_intrins.h | 5 +++++ 3 files changed, 7 insertions(+), 6 deletions(-) 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 -- 2.47.3