Thomas Gleixner | 1a59d1b8 | 2019-05-27 08:55:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Anton Blanchard | ef1313d | 2013-10-14 21:03:58 +1100 | [diff] [blame] | 2 | /* |
Anton Blanchard | ef1313d | 2013-10-14 21:03:58 +1100 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) IBM Corporation, 2012 |
| 5 | * |
| 6 | * Author: Anton Blanchard <anton@au.ibm.com> |
| 7 | */ |
| 8 | #ifndef _ASM_POWERPC_XOR_H |
| 9 | #define _ASM_POWERPC_XOR_H |
| 10 | |
| 11 | #ifdef CONFIG_ALTIVEC |
| 12 | |
| 13 | #include <asm/cputable.h> |
Kevin Hao | b92a226 | 2016-07-23 14:42:40 +0530 | [diff] [blame] | 14 | #include <asm/cpu_has_feature.h> |
Mathieu Malaterre | 7cf76a6 | 2018-03-28 20:55:25 +0200 | [diff] [blame] | 15 | #include <asm/xor_altivec.h> |
Anton Blanchard | ef1313d | 2013-10-14 21:03:58 +1100 | [diff] [blame] | 16 | |
| 17 | static struct xor_block_template xor_block_altivec = { |
| 18 | .name = "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, |
| 23 | }; |
| 24 | |
| 25 | #define XOR_SPEED_ALTIVEC() \ |
| 26 | do { \ |
| 27 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) \ |
| 28 | xor_speed(&xor_block_altivec); \ |
| 29 | } while (0) |
| 30 | #else |
| 31 | #define XOR_SPEED_ALTIVEC() |
| 32 | #endif |
| 33 | |
| 34 | /* Also try the generic routines. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #include <asm-generic/xor.h> |
Anton Blanchard | ef1313d | 2013-10-14 21:03:58 +1100 | [diff] [blame] | 36 | |
| 37 | #undef XOR_TRY_TEMPLATES |
| 38 | #define XOR_TRY_TEMPLATES \ |
| 39 | do { \ |
| 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(); \ |
| 45 | } while (0) |
| 46 | |
| 47 | #endif /* _ASM_POWERPC_XOR_H */ |