From b2933a0557d211fa3b3d86d9d9ee4d38ebb854b1 Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 25 Jun 2016 12:55:25 -0700 Subject: [PATCH] COntrol the prefetch strategy --- lib/simd/Intel512common.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/simd/Intel512common.h b/lib/simd/Intel512common.h index 6878bcfb..a05f978c 100644 --- a/lib/simd/Intel512common.h +++ b/lib/simd/Intel512common.h @@ -28,6 +28,14 @@ Author: paboyle #ifndef GRID_ASM_INTEL_COMMON_512_H #define GRID_ASM_INTEL_COMMON_512_H +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Peformance options +//////////////////////////////////////////////////////////////////////////////////////////////////// +#define AVX512_PF_L1 +#undef AVX512_PF_L2_LINEAR +#undef AVX512_PF_L2_TABLE +#undef AVX512_PF_L2_WRITE + //////////////////////////////////////////////////////////////////////////////////////////////////// // Opcodes common //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -88,10 +96,30 @@ Author: paboyle #define VMOVf(A,DEST) "vmovaps " #A ", " #DEST ";\n" #define VMOVd(A,DEST) "vmovapd " #A ", " #DEST ";\n" +#ifdef AVX512_PF_L1 #define VPREFETCHG(O,A) "prefetcht0 "#O"*64("#A");\n" +#else +#define VPREFETCHG(O,A) +#endif + +#ifdef AVX512_PF_L2_LINEAR #define VPREFETCH2(O,A) "prefetcht1 "#O"*64("#A");\n" +#else +#define VPREFETCH2(O,A) +#endif + +#ifdef AVX512_PF_L2_TABLE #define VPREFETCHP(O,A) "prefetcht1 "#O"*64("#A");\n" +#else +#define VPREFETCHP(O,A) +#endif + +#ifdef AVX512_PF_L2_WRITE #define VPREFETCHW(O,A) "prefetchwt1 "#O"*64("#A");\n" +#else +#define VPREFETCHW(O,A) +#endif + #define VPREFETCHNTA(O,A) #define VPREFETCH(O,A)