xref: /openbmc/linux/arch/loongarch/lib/xor_simd.h (revision 479965a2)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Simple interface to link xor_simd.c and xor_simd_glue.c
4  *
5  * Separating these files ensures that no SIMD instructions are run outside of
6  * the kfpu critical section.
7  */
8 
9 #ifndef __LOONGARCH_LIB_XOR_SIMD_H
10 #define __LOONGARCH_LIB_XOR_SIMD_H
11 
12 #ifdef CONFIG_CPU_HAS_LSX
13 void __xor_lsx_2(unsigned long bytes, unsigned long * __restrict p1,
14 		 const unsigned long * __restrict p2);
15 void __xor_lsx_3(unsigned long bytes, unsigned long * __restrict p1,
16 		 const unsigned long * __restrict p2, const unsigned long * __restrict p3);
17 void __xor_lsx_4(unsigned long bytes, unsigned long * __restrict p1,
18 		 const unsigned long * __restrict p2, const unsigned long * __restrict p3,
19 		 const unsigned long * __restrict p4);
20 void __xor_lsx_5(unsigned long bytes, unsigned long * __restrict p1,
21 		 const unsigned long * __restrict p2, const unsigned long * __restrict p3,
22 		 const unsigned long * __restrict p4, const unsigned long * __restrict p5);
23 #endif /* CONFIG_CPU_HAS_LSX */
24 
25 #ifdef CONFIG_CPU_HAS_LASX
26 void __xor_lasx_2(unsigned long bytes, unsigned long * __restrict p1,
27 		  const unsigned long * __restrict p2);
28 void __xor_lasx_3(unsigned long bytes, unsigned long * __restrict p1,
29 		  const unsigned long * __restrict p2, const unsigned long * __restrict p3);
30 void __xor_lasx_4(unsigned long bytes, unsigned long * __restrict p1,
31 		  const unsigned long * __restrict p2, const unsigned long * __restrict p3,
32 		  const unsigned long * __restrict p4);
33 void __xor_lasx_5(unsigned long bytes, unsigned long * __restrict p1,
34 		  const unsigned long * __restrict p2, const unsigned long * __restrict p3,
35 		  const unsigned long * __restrict p4, const unsigned long * __restrict p5);
36 #endif /* CONFIG_CPU_HAS_LASX */
37 
38 #endif /* __LOONGARCH_LIB_XOR_SIMD_H */
39