]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Move S390 VX vector typedefs into vx_intrins.h develop
authorNathan Moein Vaziri <nathan@nathanm.com>
Thu, 2 Apr 2026 02:23:27 +0000 (19:23 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 10 Apr 2026 11:38:03 +0000 (13:38 +0200)
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
arch/s390/slide_hash_vx.c
arch/s390/vx_intrins.h

index b8383db1f130b9696a0d32b2f5a0fd5b11ad4d43..0c0fdfcc4ef049c8d358b0bb2a0ab9daa3f13072 100644 (file)
 
 #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
index 03f722e9922700577f775f9056bb184842e8bc61..0939bc984f622a37a203407abfbf2aea145bb142 100644 (file)
 #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));
index ad82d98d85e6090644fe5553e50d74ce6952d972..f5b217db55581993097528eb804a9dba9f6cfc1a 100644 (file)
@@ -3,6 +3,11 @@
 
 #include <vecintrin.h>
 
+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