Skip to content

Commit 21eda8b

Browse files
authored
Report SkylakeX as Haswell if compiler does not support AVX512
... or make was invoked with NO_AVX512=1
1 parent 256eb58 commit 21eda8b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

getarch.c

+19
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9191
#include <unistd.h>
9292
#endif
9393

94+
#if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6))
95+
#else
96+
#define NO_AVX512
97+
#endif
9498
/* #define FORCE_P2 */
9599
/* #define FORCE_KATMAI */
96100
/* #define FORCE_COPPERMINE */
@@ -327,6 +331,20 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
327331
#endif
328332

329333
#ifdef FORCE_SKYLAKEX
334+
#ifdef NO_AVX512
335+
#define FORCE
336+
#define FORCE_INTEL
337+
#define ARCHITECTURE "X86"
338+
#define SUBARCHITECTURE "HASWELL"
339+
#define ARCHCONFIG "-DHASWELL " \
340+
"-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
341+
"-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
342+
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
343+
"-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
344+
"-DFMA3"
345+
#define LIBNAME "haswell"
346+
#define CORENAME "HASWELL"
347+
#else
330348
#define FORCE
331349
#define FORCE_INTEL
332350
#define ARCHITECTURE "X86"
@@ -340,6 +358,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
340358
#define LIBNAME "skylakex"
341359
#define CORENAME "SKYLAKEX"
342360
#endif
361+
#endif
343362

344363
#ifdef FORCE_ATOM
345364
#define FORCE

0 commit comments

Comments
 (0)