From e54450c4b6cbc2203b8f666a29767e1c8f83ad2d Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Wed, 17 May 2017 10:46:41 +0300 Subject: [PATCH] Code cleanup --- README.md | 2 +- dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp | 20 ++------------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 2527bcb..a8644b2 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Number of words|Time to check all anagrams no longer than that|Time to solve "ea ---------------|----------------------------------------------|-------------------------|-----------------------------------|-------------------------|--------------------------------------------- 3|0.04s||||4560 4|0.45s|||0.08s|7,431,984 -5|9.6s|0.15s|0.06s|0.29s|1,347,437,484 +5|9.6s|0.15s|0.06s|0.27s|1,347,437,484 6|4.5 minutes|0.85s|0.17s|2.05s|58,405,904,844 7|83 minutes|4.7s|0.6s|13.3s|1,070,307,744,114 8|14 hours|17.6s|1.8s|55s|10,893,594,396,594 diff --git a/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp b/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp index 844dcf4..36540db 100644 --- a/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp +++ b/dotnet/WhiteRabbit.UnmanagedBridge/md5.cpp @@ -78,24 +78,8 @@ __forceinline const MD5Vector CREATE_VECTOR(const int a) { return MD5Vector(_mm2 __forceinline const MD5Vector CREATE_VECTOR_FROM_INPUT(const unsigned __int32* input, const size_t offset) { return MD5Vector( - _mm256_set_epi32( - input[offset + 7 * 8], - input[offset + 6 * 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]), - _mm256_set_epi32( - input[offset + 15 * 8], - input[offset + 14 * 8], - input[offset + 13 * 8], - input[offset + 12 * 8], - input[offset + 11 * 8], - input[offset + 10 * 8], - input[offset + 9 * 8], - input[offset + 8 * 8])); + _mm256_i32gather_epi32((int*)(input + offset), _mm256_set_epi32(7 * 8, 6 * 8, 5 * 8, 4 * 8, 3 * 8, 2 * 8, 1 * 8, 0 * 8), 4), + _mm256_i32gather_epi32((int*)(input + offset), _mm256_set_epi32(15 * 8, 14 * 8, 13 * 8, 12 * 8, 11 * 8, 10 * 8, 9 * 8, 8 * 8), 4)); } #define WRITE_TO_OUTPUT(a, output, expected) \