From: Yann Collet Date: Sun, 1 Feb 2015 09:13:22 +0000 (+0100) Subject: avx2 mode solely detected using __AVX2__ macro X-Git-Tag: v0.1.0~6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0802817c09dd3689aa1fdb12359f224304e1f94;p=thirdparty%2Fzstd.git avx2 mode solely detected using __AVX2__ macro --- diff --git a/lib/zstd.c b/lib/zstd.c index ecc9d949a..658aa7013 100644 --- a/lib/zstd.c +++ b/lib/zstd.c @@ -68,7 +68,8 @@ #include /* debug : printf */ #include "zstd_static.h" #if defined(__clang__) || defined(__GNUC__) -# include "fse.c" /* due to GCC/Clang inlining limitations, including *.c runs noticeably faster */ +# pragma clang diagnostic ignored "-Wtypedef-redefinition" +# include "fse.c" /* due to GCC/Clang inlining limitations, including *.c runs noticeably faster */ #else # include "fse_static.h" #endif @@ -77,7 +78,8 @@ /******************************************************** * Compiler specifics *********************************************************/ -#if (!(defined(_MSC_VER) && (_MSC_VER<=1500))) /* exclude Visual 2008 and below */ +//#if (!(defined(_MSC_VER) && (_MSC_VER<=1500))) /* exclude Visual 2008 and below */ +#ifdef __AVX2__ # include /* AVX2 intrinsics */ #endif @@ -975,7 +977,7 @@ static void ZSTD_scaleDownCtx(void* ctx, const U32 limit) U32* h = srt->hashTable; int i; -#if defined(_INCLUDED_IMM) || defined(__AVX2__) /* */ +#if defined(__AVX2__) /* */ /* AVX2 version */ const __m256i limit8 = _mm256_set1_epi32(limit); for (i=0; i */ +#if defined(__AVX2__) /* */ /* AVX2 version */ { const __m256i limit8 = _mm256_set1_epi32(limit); + //printf("test avx2!\n"); for (i=0; i