From b12c8dc26803a20e3c7f897ed3acab69f7692e83 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 11 May 2016 02:59:15 +0000 Subject: [PATCH] Reorder preprocessor lines in libdivide.h so that LIBDIVIDE_USE_SSE2 is defined before emmintrin.h is included. Fixes ticket #23. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5720 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/libdivide.h | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/polymer/eduke32/build/include/libdivide.h b/polymer/eduke32/build/include/libdivide.h index 266867624..35c36891a 100644 --- a/polymer/eduke32/build/include/libdivide.h +++ b/polymer/eduke32/build/include/libdivide.h @@ -15,10 +15,22 @@ #define LIBDIVIDE_VC 1 #endif +#if defined(__x86_64__) || defined(_WIN64) || defined(_M_64) +#define LIBDIVIDE_IS_X86_64 1 +#endif + +#if defined(__i386__) +#define LIBDIVIDE_IS_i386 1 +#endif + #include #include #include +#if LIBDIVIDE_IS_X86_64 || defined __SSE2__ || (defined _M_IX86_FP && _M_IX86_FP == 2) +#define LIBDIVIDE_USE_SSE2 1 +#endif + #if LIBDIVIDE_USE_SSE2 #include #endif @@ -35,22 +47,10 @@ #define HAS_INT128_T 1 #endif -#if defined(__x86_64__) || defined(_WIN64) || defined(_M_64) -#define LIBDIVIDE_IS_X86_64 1 -#endif - -#if defined(__i386__) -#define LIBDIVIDE_IS_i386 1 -#endif - #if __GNUC__ || __clang__ #define LIBDIVIDE_GCC_STYLE_ASM 1 #endif -#if LIBDIVIDE_IS_X86_64 || defined __SSE2__ || (defined _M_IX86_FP && _M_IX86_FP == 2) -#define LIBDIVIDE_USE_SSE2 1 -#endif - /* Explanation of "more" field: bit 6 is whether to use shift path. If we are using the shift path, bit 7 is whether the divisor is negative in the signed case; in the unsigned case it is 0. Bits 0-4 is shift value (for shift path or mult path). In 32 bit case, bit 5 is always 0. We use bit 7 as the "negative divisor indicator" so that we can use sign extension to efficiently go to a full-width -1.