From 4bd1b36d947298bf295c97679debb0844f15e344 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Wed, 26 Apr 2017 12:10:27 +0300 Subject: [PATCH] AVX2 fixes --- .../WhiteRabbit.UnmanagedBridge.cpp | 2 +- dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dotnet/WhiteRabbit.UnmanagedBridge/WhiteRabbit.UnmanagedBridge.cpp b/dotnet/WhiteRabbit.UnmanagedBridge/WhiteRabbit.UnmanagedBridge.cpp index 76d3d8f..21d049b 100644 --- a/dotnet/WhiteRabbit.UnmanagedBridge/WhiteRabbit.UnmanagedBridge.cpp +++ b/dotnet/WhiteRabbit.UnmanagedBridge/WhiteRabbit.UnmanagedBridge.cpp @@ -9,7 +9,7 @@ void WhiteRabbitUnmanagedBridge::MD5Unmanaged::ComputeMD5(unsigned __int32 * inp { #if AVX2 md5(input + 0 * 8 * 8, output + 0 * 8); - md5(input + 1 * 8 * 8, output + 0 * 8); + md5(input + 1 * 8 * 8, output + 1 * 8); #elif SIMD md5(input + 0 * 8 * 4, output + 0 * 4); md5(input + 1 * 8 * 4, output + 1 * 4); diff --git a/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp b/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp index c33b6bd..02b87a3 100644 --- a/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp +++ b/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp @@ -19,14 +19,14 @@ typedef __m256i MD5Vector; #define CREATE_VECTOR(a) _mm256_set1_epi32(a) #define CREATE_VECTOR_FROM_INPUT(input, offset) _mm256_set_epi32( \ - input[offset + 0 * 8], \ - input[offset + 1 * 8], \ - input[offset + 2 * 8], \ - input[offset + 3 * 8], \ - input[offset + 4 * 8], \ - input[offset + 5 * 8], \ + input[offset + 7 * 8], \ input[offset + 6 * 8], \ - input[offset + 7 * 8]) + input[offset + 5 * 8], \ + input[offset + 4 * 8], \ + input[offset + 3 * 8], \ + input[offset + 2 * 8], \ + input[offset + 1 * 8], \ + input[offset + 0 * 8]) #define WRITE_TO_OUTPUT(a, output) \ ((unsigned __int64*)output)[0] = a.m256i_u64[0]; \