2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 * Copyright (C) IBM Corporation, 2012
18 * Author: Anton Blanchard <anton@au.ibm.com>
22 * Sparse (as at v0.5.0) gets very, very confused by this file.
23 * Make it a bit simpler for it.
25 #if !defined(__CHECKER__)
28 #define vec_xor(a, b) a ^ b
29 #define vector __attribute__((vector_size(16)))
34 typedef vector
signed char unative_t
;
37 unative_t *V = (unative_t *)V##_in; \
38 unative_t V##_0, V##_1, V##_2, V##_3
58 V1##_0 = vec_xor(V1##_0, V2##_0); \
59 V1##_1 = vec_xor(V1##_1, V2##_1); \
60 V1##_2 = vec_xor(V1##_2, V2##_2); \
61 V1##_3 = vec_xor(V1##_3, V2##_3); \
64 void __xor_altivec_2(unsigned long bytes
, unsigned long *v1_in
,
69 unsigned long lines
= bytes
/ (sizeof(unative_t
)) / 4;
79 } while (--lines
> 0);
82 void __xor_altivec_3(unsigned long bytes
, unsigned long *v1_in
,
83 unsigned long *v2_in
, unsigned long *v3_in
)
88 unsigned long lines
= bytes
/ (sizeof(unative_t
)) / 4;
101 } while (--lines
> 0);
104 void __xor_altivec_4(unsigned long bytes
, unsigned long *v1_in
,
105 unsigned long *v2_in
, unsigned long *v3_in
,
106 unsigned long *v4_in
)
112 unsigned long lines
= bytes
/ (sizeof(unative_t
)) / 4;
128 } while (--lines
> 0);
131 void __xor_altivec_5(unsigned long bytes
, unsigned long *v1_in
,
132 unsigned long *v2_in
, unsigned long *v3_in
,
133 unsigned long *v4_in
, unsigned long *v5_in
)
140 unsigned long lines
= bytes
/ (sizeof(unative_t
)) / 4;
159 } while (--lines
> 0);