From ef1b391ce61f25ec3951e48844e09740eda4cba4 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 22 Jan 2019 04:58:54 -0500 Subject: [PATCH] Use #pragma omp simd for OpenMP 4.0 compilers (GH #787) Crap... It is OpenMP 4.0, not 3.0 --- cryptest.nmake | 2 +- salsa.cpp | 4 ++-- scrypt.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cryptest.nmake b/cryptest.nmake index 1c547ed3..f759b650 100644 --- a/cryptest.nmake +++ b/cryptest.nmake @@ -154,7 +154,7 @@ LDLIBS = # Debug build. # CXXFLAGS = $(CXXFLAGS) /DDEBUG /D_DEBUG /Oi /Oy- /Od /MTd # Release build. Add /OPT:REF to linker -CXXFLAGS = $(CXXFLAGS) /DNDEBUG /D_NDEBUG /Oi /Oy /O2 /MT +CXXFLAGS = $(CXXFLAGS) /DNDEBUG /D_NDEBUG /Oi /Oy /O2 /MT /openmp # Linker flags. LDFLAGS = $(LDFLAGS) /OPT:REF diff --git a/salsa.cpp b/salsa.cpp index eacdabe7..c5330a9a 100644 --- a/salsa.cpp +++ b/salsa.cpp @@ -90,8 +90,8 @@ void Salsa20_Core(word32* data, unsigned int rounds) x[15] ^= rotlConstant<18>(x[14]+x[13]); } -// OpenMP 3.0 released May 2008. -#if _OPENMP >= 200805 +// OpenMP 4.0 released July 2013. +#if _OPENMP >= 201307 #pragma omp simd for (size_t i = 0; i < 16; ++i) data[i] += x[i]; diff --git a/scrypt.cpp b/scrypt.cpp index 7c1b9e84..e976f674 100644 --- a/scrypt.cpp +++ b/scrypt.cpp @@ -64,8 +64,8 @@ static inline void BlockCopy(byte* dest, byte* src, size_t len) static inline void BlockXOR(byte* dest, byte* src, size_t len) { -// OpenMP 3.0 released May 2008. -#if _OPENMP >= 200805 +// OpenMP 4.0 released July 2013. +#if _OPENMP >= 201307 #pragma omp simd for (size_t i = 0; i < len; ++i) dest[i] ^= src[i];