From 94bf94771ec08a9fb8aad2cd20a8865e0646ade4 Mon Sep 17 00:00:00 2001 From: Christopher Taylor Date: Mon, 29 May 2017 02:40:08 -0700 Subject: [PATCH] Disable warning --- LeopardCommon.cpp | 4 ++++ LeopardCommon.h | 4 ++++ LeopardFF8.cpp | 4 ++++ leopard.cpp | 23 ++++++++++++++++------- tests/benchmark.cpp | 4 ++-- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/LeopardCommon.cpp b/LeopardCommon.cpp index 8bfb0ed..4b78854 100644 --- a/LeopardCommon.cpp +++ b/LeopardCommon.cpp @@ -192,6 +192,8 @@ void xor_mem( } while (bytes > 0); } +#ifdef LEO_M1_OPT + void xor_mem_2to1( void * LEO_RESTRICT x, const void * LEO_RESTRICT y, @@ -255,6 +257,8 @@ void xor_mem_2to1( } while (bytes > 0); } +#endif // LEO_M1_OPT + #ifdef LEO_USE_VECTOR4_OPT void xor_mem4( diff --git a/LeopardCommon.h b/LeopardCommon.h index 9d5ec05..75fb93f 100644 --- a/LeopardCommon.h +++ b/LeopardCommon.h @@ -322,6 +322,8 @@ void xor_mem( void * LEO_RESTRICT x, const void * LEO_RESTRICT y, uint64_t bytes); +#ifdef LEO_M1_OPT + // x[] ^= y[] ^ z[] void xor_mem_2to1( void * LEO_RESTRICT x, @@ -329,6 +331,8 @@ void xor_mem_2to1( const void * LEO_RESTRICT z, uint64_t bytes); +#endif // LEO_M1_OPT + #ifdef LEO_USE_VECTOR4_OPT // For i = {0, 1, 2, 3}: x_i[] ^= x_i[] diff --git a/LeopardFF8.cpp b/LeopardFF8.cpp index d6bf079..4d4da4a 100644 --- a/LeopardFF8.cpp +++ b/LeopardFF8.cpp @@ -32,6 +32,10 @@ #include +#ifdef _MSC_VER + #pragma warning(disable: 4752) // found Intel(R) Advanced Vector Extensions; consider using /arch:AVX +#endif + namespace leopard { namespace ff8 { diff --git a/leopard.cpp b/leopard.cpp index 543e9df..3a70269 100644 --- a/leopard.cpp +++ b/leopard.cpp @@ -150,7 +150,11 @@ LEO_EXPORT LeopardResult leo_encode( // Handle m = 1 case if (recovery_count == 1) { - EncodeM1(buffer_bytes, original_count, original_data, work_data[0]); + EncodeM1( + buffer_bytes, + original_count, + original_data, + work_data[0]); return Leopard_Success; } @@ -251,23 +255,23 @@ LEO_EXPORT LeopardResult leo_decode( // Check if not enough recovery data arrived unsigned original_loss_count = 0; - unsigned original_loss_index = 0; + unsigned original_loss_i = 0; for (unsigned i = 0; i < original_count; ++i) { if (!original_data[i]) { ++original_loss_count; - original_loss_index = i; + original_loss_i = i; } } unsigned recovery_got_count = 0; - unsigned recovery_last_i = 0; + unsigned recovery_got_i = 0; for (unsigned i = 0; i < recovery_count; ++i) { if (recovery_data[i]) { ++recovery_got_count; - recovery_last_i = i; + recovery_got_i = i; } } if (recovery_got_count < original_loss_count) @@ -276,14 +280,19 @@ LEO_EXPORT LeopardResult leo_decode( // Handle k = 1 case if (original_count == 1) { - memcpy(work_data[0], recovery_data[recovery_last_i], buffer_bytes); + memcpy(work_data[0], recovery_data[recovery_got_i], buffer_bytes); return Leopard_Success; } // Handle m = 1 case if (recovery_count == 1) { - DecodeM1(buffer_bytes, original_count, original_data, recovery_data[0], work_data[original_loss_index]); + DecodeM1( + buffer_bytes, + original_count, + original_data, + recovery_data[0], + work_data[original_loss_i]); return Leopard_Success; } diff --git a/tests/benchmark.cpp b/tests/benchmark.cpp index 6e64bed..ef1c59e 100644 --- a/tests/benchmark.cpp +++ b/tests/benchmark.cpp @@ -46,10 +46,10 @@ struct TestParameters unsigned recovery_count = 100; // under 65536 - original_count #else unsigned original_count = 3; // under 65536 - unsigned recovery_count = 1; // under 65536 - original_count + unsigned recovery_count = 2; // under 65536 - original_count #endif unsigned buffer_bytes = 64000; // multiple of 64 bytes - unsigned loss_count = 16; // some fraction of original_count + unsigned loss_count = 2; // some fraction of original_count unsigned seed = 0; bool multithreaded = true; };