xref: /openbmc/linux/arch/arm/lib/xor-neon.c (revision 9a29f5fc)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * linux/arch/arm/lib/xor-neon.c
4  *
5  * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org>
6  */
7 
8 #include <linux/raid/xor.h>
9 #include <linux/module.h>
10 
11 MODULE_LICENSE("GPL");
12 
13 #ifndef __ARM_NEON__
14 #error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon'
15 #endif
16 
17 /*
18  * Pull in the reference implementations while instructing GCC (through
19  * -ftree-vectorize) to attempt to exploit implicit parallelism and emit
20  * NEON instructions. Clang does this by default at O2 so no pragma is
21  * needed.
22  */
23 #ifdef CONFIG_CC_IS_GCC
24 #pragma GCC optimize "tree-vectorize"
25 #endif
26 
27 #pragma GCC diagnostic ignored "-Wunused-variable"
28 #include <asm-generic/xor.h>
29 
30 struct xor_block_template const xor_block_neon_inner = {
31 	.name	= "__inner_neon__",
32 	.do_2	= xor_8regs_2,
33 	.do_3	= xor_8regs_3,
34 	.do_4	= xor_8regs_4,
35 	.do_5	= xor_8regs_5,
36 };
37 EXPORT_SYMBOL(xor_block_neon_inner);
38