xor_64.h 709 字节
Newer Older
H
H. Peter Anvin 已提交
1 2
#ifndef _ASM_X86_XOR_64_H
#define _ASM_X86_XOR_64_H
V
Vegard Nossum 已提交
3

L
Linus Torvalds 已提交
4
static struct xor_block_template xor_block_sse = {
5 6 7 8 9
	.name = "generic_sse",
	.do_2 = xor_sse_2,
	.do_3 = xor_sse_3,
	.do_4 = xor_sse_4,
	.do_5 = xor_sse_5,
L
Linus Torvalds 已提交
10 11
};

12 13

/* Also try the AVX routines */
14
#include <asm/xor_avx.h>
15

L
Linus Torvalds 已提交
16
#undef XOR_TRY_TEMPLATES
17 18
#define XOR_TRY_TEMPLATES			\
do {						\
19
	AVX_XOR_SPEED;				\
20 21
	xor_speed(&xor_block_sse);		\
} while (0)
L
Linus Torvalds 已提交
22 23 24 25

/* We force the use of the SSE xor block because it can write around L2.
   We may also be able to load into the L1 only depending on how the cpu
   deals with a load to a line that is being prefetched.  */
26 27
#define XOR_SELECT_TEMPLATE(FASTEST) \
	AVX_SELECT(&xor_block_sse)
V
Vegard Nossum 已提交
28

H
H. Peter Anvin 已提交
29
#endif /* _ASM_X86_XOR_64_H */