From 5f1305cf5ad8dd5f8d21ba5f9b84edbb82675ef6 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Thu, 21 Nov 2019 19:59:40 +0600 Subject: [PATCH 1/3] Fix x86 build (compilation error) --- trlec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trlec.c b/trlec.c index 8957251..93903b8 100644 --- a/trlec.c +++ b/trlec.c @@ -239,7 +239,6 @@ unsigned trlec(const unsigned char *__restrict in, unsigned inlen, unsigned char continue; a: ip += ctz64(z)>>3; #else - uint32_t z; uint32_t z; SZ32; SZ32; SZ32; SZ32; __builtin_prefetch(ip +256, 0); continue; a: ip += ctz32(z)>>3; From 13b45938cf72731d22be32e1be975c3f19c54d11 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Thu, 21 Nov 2019 20:00:22 +0600 Subject: [PATCH 2/3] Fix x86 build (added _mm256_extract_epi64) --- bitutil.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitutil.h b/bitutil.h index ca5c07e..cbc1f4b 100644 --- a/bitutil.h +++ b/bitutil.h @@ -139,7 +139,11 @@ static ALWAYS_INLINE __m128i mm_xord_epi32(__m128i v, __m128i sv) { MM_HDEC_EPI3 static ALWAYS_INLINE __m128i mm_scani_epi16(__m128i v, __m128i sv, __m128i vi) { return _mm_add_epi16(mm_scan_epi16(v, sv), vi); } static ALWAYS_INLINE __m128i mm_scani_epi32(__m128i v, __m128i sv, __m128i vi) { return _mm_add_epi32(mm_scan_epi32(v, sv), vi); } #endif - + +#if !defined(_M_X64) && !defined(__x86_64__) && defined(__AVX__) +#define _mm256_extract_epi64(v, index) ((__int64)((uint64_t)(uint32_t)_mm256_extract_epi32((v), (index) * 2) | (((uint64_t)(uint32_t)_mm256_extract_epi32((v), (index) * 2 + 1)) << 32))) +#endif + //------------------ Horizontal OR ----------------------------------------------- #ifdef __AVX2__ static ALWAYS_INLINE unsigned mm256_hor_epi32(__m256i v) { From 8b687a3f5c5548cbfe84af10d9af2f67ab109af3 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Thu, 21 Nov 2019 20:01:36 +0600 Subject: [PATCH 3/3] Corrected vs2017 project files (removed optimizations from debug builds) --- vs/vs2017/TurboPFor.vcxproj | 14 +++++--------- vs/vs2017/icapp.vcxproj | 13 +++++-------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/vs/vs2017/TurboPFor.vcxproj b/vs/vs2017/TurboPFor.vcxproj index 11307a3..24ee3d6 100644 --- a/vs/vs2017/TurboPFor.vcxproj +++ b/vs/vs2017/TurboPFor.vcxproj @@ -87,19 +87,15 @@ - MaxSpeed + Disabled true - __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) true AdvancedVectorExtensions2 MultiThreadedDebug true /w24003 /w24005 /w24028 /w24047 /w24090 /w24133 /w24146 /w24333 /w24789 %(AdditionalOptions) ..\.. - Speed - false - Fast - Default Console @@ -110,7 +106,7 @@ Disabled true - __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) true AdvancedVectorExtensions2 MultiThreadedDebug @@ -129,7 +125,7 @@ true true true - __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) true AdvancedVectorExtensions2 Speed @@ -151,7 +147,7 @@ true true true - __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + __SSE__;__SSE2__;__SSE3__;__SSSE3__;__SSE4_1__;__SSE4_2__;USE_SSE;USE_AVX2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) true AdvancedVectorExtensions2 Speed diff --git a/vs/vs2017/icapp.vcxproj b/vs/vs2017/icapp.vcxproj index d73628f..cc9d577 100644 --- a/vs/vs2017/icapp.vcxproj +++ b/vs/vs2017/icapp.vcxproj @@ -19,9 +19,7 @@ - - _CRT_SECURE_NO_WARNINGS;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) - + @@ -99,13 +97,12 @@ Disabled true - _CRT_SECURE_NO_WARNINGS;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) + CODEC2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) true /w24146 /w24133 /w24996 MultiThreadedDebug AdvancedVectorExtensions2 ..\..\ext - false Console @@ -116,7 +113,7 @@ Disabled true - CODEC2;_CRT_SECURE_NO_WARNINGS;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) + CODEC2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) true /w24146 /w24133 /w24996 MultiThreadedDebug @@ -134,7 +131,7 @@ true true true - _CRT_SECURE_NO_WARNINGS;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) + CODEC2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) true /w24146 /w24133 /w24996 MultiThreaded @@ -154,7 +151,7 @@ true true true - CODEC2;_CRT_SECURE_NO_WARNINGS;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) + CODEC2;_CRT_SECURE_NO_WARNINGS=;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) true /w24146 /w24133 /w24996 MultiThreaded