1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) IBM Corporation, 2012
6 * Author: Anton Blanchard <anton@au.ibm.com>
8 #ifndef _ASM_POWERPC_XOR_H
9 #define _ASM_POWERPC_XOR_H
13 #include <asm/cputable.h>
14 #include <asm/cpu_has_feature.h>
15 #include <asm/xor_altivec.h>
17 static struct xor_block_template xor_block_altivec
= {
19 .do_2
= xor_altivec_2
,
20 .do_3
= xor_altivec_3
,
21 .do_4
= xor_altivec_4
,
22 .do_5
= xor_altivec_5
,
25 #define XOR_SPEED_ALTIVEC() \
27 if (cpu_has_feature(CPU_FTR_ALTIVEC)) \
28 xor_speed(&xor_block_altivec); \
31 #define XOR_SPEED_ALTIVEC()
34 /* Also try the generic routines. */
35 #include <asm-generic/xor.h>
37 #undef XOR_TRY_TEMPLATES
38 #define XOR_TRY_TEMPLATES \
40 xor_speed(&xor_block_8regs); \
41 xor_speed(&xor_block_8regs_p); \
42 xor_speed(&xor_block_32regs); \
43 xor_speed(&xor_block_32regs_p); \
44 XOR_SPEED_ALTIVEC(); \
47 #endif /* _ASM_POWERPC_XOR_H */