1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * linux/arch/arm/lib/xor-neon.c 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org> 6*4882a593Smuzhiyun */ 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun #include <linux/raid/xor.h> 9*4882a593Smuzhiyun #include <linux/module.h> 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun MODULE_LICENSE("GPL"); 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun #ifndef __ARM_NEON__ 14*4882a593Smuzhiyun #error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon' 15*4882a593Smuzhiyun #endif 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun /* 18*4882a593Smuzhiyun * Pull in the reference implementations while instructing GCC (through 19*4882a593Smuzhiyun * -ftree-vectorize) to attempt to exploit implicit parallelism and emit 20*4882a593Smuzhiyun * NEON instructions. 21*4882a593Smuzhiyun */ 22*4882a593Smuzhiyun #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 23*4882a593Smuzhiyun #pragma GCC optimize "tree-vectorize" 24*4882a593Smuzhiyun #else 25*4882a593Smuzhiyun /* 26*4882a593Smuzhiyun * While older versions of GCC do not generate incorrect code, they fail to 27*4882a593Smuzhiyun * recognize the parallel nature of these functions, and emit plain ARM code, 28*4882a593Smuzhiyun * which is known to be slower than the optimized ARM code in asm-arm/xor.h. 29*4882a593Smuzhiyun * 30*4882a593Smuzhiyun * #warning This code requires at least version 4.6 of GCC 31*4882a593Smuzhiyun */ 32*4882a593Smuzhiyun #endif 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #pragma GCC diagnostic ignored "-Wunused-variable" 35*4882a593Smuzhiyun #include <asm-generic/xor.h> 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun struct xor_block_template const xor_block_neon_inner = { 38*4882a593Smuzhiyun .name = "__inner_neon__", 39*4882a593Smuzhiyun .do_2 = xor_8regs_2, 40*4882a593Smuzhiyun .do_3 = xor_8regs_3, 41*4882a593Smuzhiyun .do_4 = xor_8regs_4, 42*4882a593Smuzhiyun .do_5 = xor_8regs_5, 43*4882a593Smuzhiyun }; 44*4882a593Smuzhiyun EXPORT_SYMBOL(xor_block_neon_inner); 45