Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHA256 implementations based on Intel SHA Extensions #13386

Merged
merged 3 commits into from Jul 9, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+0 −24
Diff settings

Always

Just for now

Use immintrin.h everywhere for intrinsics

  • Loading branch information...
sipa committed Jun 11, 2018
commit 66b2cf1ccfad545a8ec3f2a854e23f647322bf30
@@ -348,11 +348,7 @@ CXXFLAGS="$CXXFLAGS $SSE41_CXXFLAGS"
AC_MSG_CHECKING(for SSE4.1 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#if defined(_MSC_VER)
#include <immintrin.h>
#elif defined(__GNUC__)
#include <x86intrin.h>
#endif
]],[[
__m128i l = _mm_set1_epi32(0);
return _mm_extract_epi32(l, 3);
@@ -367,11 +363,7 @@ CXXFLAGS="$CXXFLAGS $AVX2_CXXFLAGS"
AC_MSG_CHECKING(for AVX2 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#if defined(_MSC_VER)
#include <immintrin.h>
#elif defined(__GNUC__) && defined(__AVX2__)
#include <x86intrin.h>
#endif
]],[[
__m256i l = _mm256_set1_epi32(0);
return _mm256_extract_epi32(l, 7);
@@ -386,11 +378,7 @@ CXXFLAGS="$CXXFLAGS $SHANI_CXXFLAGS"
AC_MSG_CHECKING(for SHA-NI intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#if defined(_MSC_VER)
#include <immintrin.h>
#elif defined(__GNUC__)
#include <x86intrin.h>
#endif
]],[[
__m128i i = _mm_set1_epi32(0);
__m128i j = _mm_set1_epi32(1);
@@ -1,11 +1,7 @@
#ifdef ENABLE_AVX2

#include <stdint.h>
#if defined(_MSC_VER)
#include <immintrin.h>
#elif defined(__GNUC__)
#include <x86intrin.h>
#endif

#include <crypto/sha256.h>
#include <crypto/common.h>
@@ -9,11 +9,7 @@
#ifdef ENABLE_SHANI

#include <stdint.h>
#if defined(_MSC_VER)
#include <immintrin.h>

This comment has been minimized.

Copy link
@DesWurstes

DesWurstes Jun 7, 2018

Contributor

I believe including immintrin.h is enough for both platforms. x86intrin includes immintrin.h, and immintrin.h includes everything that is needed: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/immintrin.h

EDIT: Tested on Linux GCC and Clang, including immintrin.h is enough for all platforms.

This comment has been minimized.

Copy link
@sipa

sipa Jun 11, 2018

Author Member

Thanks, fixed.

#elif defined(__GNUC__)
#include <x86intrin.h>
#endif

#include <crypto/common.h>

@@ -1,11 +1,7 @@
#ifdef ENABLE_SSE41

#include <stdint.h>
#if defined(_MSC_VER)
#include <immintrin.h>
#elif defined(__GNUC__)
#include <x86intrin.h>
#endif

#include <crypto/sha256.h>
#include <crypto/common.h>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.