1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) IBM Corporation, 2012
10 * Sparse (as at v0.5.0) gets very, very confused by this file.
11 * Make it a bit simpler for it.
13 #if !defined(__CHECKER__)
16 #define vec_xor(a, b) a ^ b
17 #define vector __attribute__((vector_size(16)))
22 typedef vector signed char unative_t;
25 unative_t *V = (unative_t *)V##_in; \
26 unative_t V##_0, V##_1, V##_2, V##_3
46 V1##_0 = vec_xor(V1##_0, V2##_0); \
47 V1##_1 = vec_xor(V1##_1, V2##_1); \
48 V1##_2 = vec_xor(V1##_2, V2##_2); \
49 V1##_3 = vec_xor(V1##_3, V2##_3); \
52 void __xor_altivec_2(unsigned long bytes,
53 unsigned long * __restrict v1_in,
54 const unsigned long * __restrict v2_in)
58 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
68 } while (--lines > 0);
71 void __xor_altivec_3(unsigned long bytes,
72 unsigned long * __restrict v1_in,
73 const unsigned long * __restrict v2_in,
74 const unsigned long * __restrict v3_in)
79 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
92 } while (--lines > 0);
95 void __xor_altivec_4(unsigned long bytes,
96 unsigned long * __restrict v1_in,
97 const unsigned long * __restrict v2_in,
98 const unsigned long * __restrict v3_in,
99 const unsigned long * __restrict v4_in)
105 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
121 } while (--lines > 0);
124 void __xor_altivec_5(unsigned long bytes,
125 unsigned long * __restrict v1_in,
126 const unsigned long * __restrict v2_in,
127 const unsigned long * __restrict v3_in,
128 const unsigned long * __restrict v4_in,
129 const unsigned long * __restrict v5_in)
136 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
155 } while (--lines > 0);