2 * arch/arm64/include/asm/xor.h
4 * Authors: Jackie Liu <liuyun01@kylinos.cn>
5 * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/hardirq.h>
13 #include <asm-generic/xor.h>
14 #include <asm/hwcap.h>
17 #ifdef CONFIG_KERNEL_MODE_NEON
19 extern struct xor_block_template const xor_block_inner_neon;
22 xor_neon_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
25 xor_block_inner_neon.do_2(bytes, p1, p2);
30 xor_neon_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
34 xor_block_inner_neon.do_3(bytes, p1, p2, p3);
39 xor_neon_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
40 unsigned long *p3, unsigned long *p4)
43 xor_block_inner_neon.do_4(bytes, p1, p2, p3, p4);
48 xor_neon_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
49 unsigned long *p3, unsigned long *p4, unsigned long *p5)
52 xor_block_inner_neon.do_5(bytes, p1, p2, p3, p4, p5);
56 static struct xor_block_template xor_block_arm64 = {
63 #undef XOR_TRY_TEMPLATES
64 #define XOR_TRY_TEMPLATES \
66 xor_speed(&xor_block_8regs); \
67 xor_speed(&xor_block_32regs); \
68 if (cpu_has_neon()) { \
69 xor_speed(&xor_block_arm64);\
73 #endif /* ! CONFIG_KERNEL_MODE_NEON */