1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * LoongArch SIMD XOR operations
5 * Copyright (C) 2023 WANG Xuerui <git@xen0n.name>
8 #include <linux/export.h>
9 #include <linux/sched.h>
11 #include <asm/xor_simd.h>
14 #define MAKE_XOR_GLUE_2(flavor) \
15 void xor_##flavor##_2(unsigned long bytes, unsigned long * __restrict p1, \
16 const unsigned long * __restrict p2) \
19 __xor_##flavor##_2(bytes, p1, p2); \
22 EXPORT_SYMBOL_GPL(xor_##flavor##_2)
24 #define MAKE_XOR_GLUE_3(flavor) \
25 void xor_##flavor##_3(unsigned long bytes, unsigned long * __restrict p1, \
26 const unsigned long * __restrict p2, \
27 const unsigned long * __restrict p3) \
30 __xor_##flavor##_3(bytes, p1, p2, p3); \
33 EXPORT_SYMBOL_GPL(xor_##flavor##_3)
35 #define MAKE_XOR_GLUE_4(flavor) \
36 void xor_##flavor##_4(unsigned long bytes, unsigned long * __restrict p1, \
37 const unsigned long * __restrict p2, \
38 const unsigned long * __restrict p3, \
39 const unsigned long * __restrict p4) \
42 __xor_##flavor##_4(bytes, p1, p2, p3, p4); \
45 EXPORT_SYMBOL_GPL(xor_##flavor##_4)
47 #define MAKE_XOR_GLUE_5(flavor) \
48 void xor_##flavor##_5(unsigned long bytes, unsigned long * __restrict p1, \
49 const unsigned long * __restrict p2, \
50 const unsigned long * __restrict p3, \
51 const unsigned long * __restrict p4, \
52 const unsigned long * __restrict p5) \
55 __xor_##flavor##_5(bytes, p1, p2, p3, p4, p5); \
58 EXPORT_SYMBOL_GPL(xor_##flavor##_5)
60 #define MAKE_XOR_GLUES(flavor) \
61 MAKE_XOR_GLUE_2(flavor); \
62 MAKE_XOR_GLUE_3(flavor); \
63 MAKE_XOR_GLUE_4(flavor); \
64 MAKE_XOR_GLUE_5(flavor)
66 #ifdef CONFIG_CPU_HAS_LSX
70 #ifdef CONFIG_CPU_HAS_LASX