1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * arch/arm64/include/asm/xor.h
5 * Authors: Jackie Liu <liuyun01@kylinos.cn>
6 * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
9 #include <linux/hardirq.h>
10 #include <asm-generic/xor.h>
11 #include <asm/hwcap.h>
14 #ifdef CONFIG_KERNEL_MODE_NEON
16 extern struct xor_block_template const xor_block_inner_neon;
19 xor_neon_2(unsigned long bytes, unsigned long * __restrict p1,
20 const unsigned long * __restrict p2)
23 xor_block_inner_neon.do_2(bytes, p1, p2);
28 xor_neon_3(unsigned long bytes, unsigned long * __restrict p1,
29 const unsigned long * __restrict p2,
30 const unsigned long * __restrict p3)
33 xor_block_inner_neon.do_3(bytes, p1, p2, p3);
38 xor_neon_4(unsigned long bytes, unsigned long * __restrict p1,
39 const unsigned long * __restrict p2,
40 const unsigned long * __restrict p3,
41 const unsigned long * __restrict p4)
44 xor_block_inner_neon.do_4(bytes, p1, p2, p3, p4);
49 xor_neon_5(unsigned long bytes, unsigned long * __restrict p1,
50 const unsigned long * __restrict p2,
51 const unsigned long * __restrict p3,
52 const unsigned long * __restrict p4,
53 const unsigned long * __restrict p5)
56 xor_block_inner_neon.do_5(bytes, p1, p2, p3, p4, p5);
60 static struct xor_block_template xor_block_arm64 = {
67 #undef XOR_TRY_TEMPLATES
68 #define XOR_TRY_TEMPLATES \
70 xor_speed(&xor_block_8regs); \
71 xor_speed(&xor_block_32regs); \
72 if (cpu_has_neon()) { \
73 xor_speed(&xor_block_arm64);\
77 #endif /* ! CONFIG_KERNEL_MODE_NEON */