0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _ASM_POWERPC_XOR_H
0009 #define _ASM_POWERPC_XOR_H
0010
0011 #ifdef CONFIG_ALTIVEC
0012
0013 #include <asm/cputable.h>
0014 #include <asm/cpu_has_feature.h>
0015 #include <asm/xor_altivec.h>
0016
0017 static struct xor_block_template xor_block_altivec = {
0018 .name = "altivec",
0019 .do_2 = xor_altivec_2,
0020 .do_3 = xor_altivec_3,
0021 .do_4 = xor_altivec_4,
0022 .do_5 = xor_altivec_5,
0023 };
0024
0025 #define XOR_SPEED_ALTIVEC() \
0026 do { \
0027 if (cpu_has_feature(CPU_FTR_ALTIVEC)) \
0028 xor_speed(&xor_block_altivec); \
0029 } while (0)
0030 #else
0031 #define XOR_SPEED_ALTIVEC()
0032 #endif
0033
0034
0035 #include <asm-generic/xor.h>
0036
0037 #undef XOR_TRY_TEMPLATES
0038 #define XOR_TRY_TEMPLATES \
0039 do { \
0040 xor_speed(&xor_block_8regs); \
0041 xor_speed(&xor_block_8regs_p); \
0042 xor_speed(&xor_block_32regs); \
0043 xor_speed(&xor_block_32regs_p); \
0044 XOR_SPEED_ALTIVEC(); \
0045 } while (0)
0046
0047 #endif