Skip to content

Commit 2ca44eb

Browse files
nmoinvazDead2
authored andcommitted
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.
1 parent f227f6e commit 2ca44eb

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

arch/s390/crc32_vx.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
#include "vx_intrins.h"
2121

22-
typedef unsigned char uv16qi __attribute__((vector_size(16)));
23-
typedef unsigned int uv4si __attribute__((vector_size(16)));
24-
typedef unsigned long long uv2di __attribute__((vector_size(16)));
25-
2622
static uint32_t crc32_le_vgfm_16(uint32_t crc, const uint8_t *buf, size_t len) {
2723
/*
2824
* The CRC-32 constant block contains reduction constants to fold and

arch/s390/slide_hash_vx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#include "vx_intrins.h"
1111

1212
static inline void slide_hash_chain(Pos *table, uint32_t entries, uint16_t wsize) {
13-
const vector unsigned short vmx_wsize = vec_splats(wsize);
13+
const uv8hi vmx_wsize = vec_splats(wsize);
1414
Pos *p = table;
1515

1616
do {
17-
vector unsigned short value, result;
17+
uv8hi value, result;
1818

1919
value = vec_xl(0, p);
2020
result = vec_sub(value, vec_min(value, vmx_wsize));

arch/s390/vx_intrins.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
#include <vecintrin.h>
55

6+
typedef unsigned char uv16qi __attribute__((vector_size(16)));
7+
typedef unsigned short uv8hi __attribute__((vector_size(16)));
8+
typedef unsigned int uv4si __attribute__((vector_size(16)));
9+
typedef unsigned long long uv2di __attribute__((vector_size(16)));
10+
611
#ifndef vec_sub
712
#define vec_sub(a, b) ((a) - (b))
813
#endif

0 commit comments

Comments
 (0)