1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) IBM Corporation, 2012
6 * Author: Anton Blanchard <anton@au.ibm.com>
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, unsigned long *v1_in,
57 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
67 } while (--lines > 0);
70 void __xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
71 unsigned long *v2_in, unsigned long *v3_in)
76 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
89 } while (--lines > 0);
92 void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
93 unsigned long *v2_in, unsigned long *v3_in,
100 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
116 } while (--lines > 0);
119 void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
120 unsigned long *v2_in, unsigned long *v3_in,
121 unsigned long *v4_in, unsigned long *v5_in)
128 unsigned long lines = bytes / (sizeof(unative_t)) / 4;
147 } while (--lines > 0);