Skip to content

Commit

Permalink
Fix SIMON build when SSSE3 not available
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Dec 29, 2018
1 parent a9bd504 commit 58772f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions simon128_simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

#include "simon.h"
#include "misc.h"
#include "adv_simd.h"

// Uncomment for benchmarking C++ against SSE or NEON.
// Do so in both simon.cpp and simon-simd.cpp.
// #undef CRYPTOPP_SSSE3_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE

#if (CRYPTOPP_SSSE3_AVAILABLE)
# include "adv_simd.h"
# include <pmmintrin.h>
# include <tmmintrin.h>
#endif
Expand All @@ -26,12 +26,13 @@
# include <ammintrin.h>
#endif

#if defined(__AVX512F__) && defined(__AVX512VL__)
#if defined(__AVX512F__)
# define CRYPTOPP_AVX512_ROTATE 1
# include <immintrin.h>
#endif

#if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include "adv_simd.h"
# include <arm_neon.h>
#endif

Expand All @@ -43,6 +44,7 @@
#endif

#if defined(CRYPTOPP_POWER7_AVAILABLE)
# include "adv_simd.h"
# include "ppc_simd.h"
#endif

Expand Down
6 changes: 4 additions & 2 deletions simon64_simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

#include "simon.h"
#include "misc.h"
#include "adv_simd.h"

// Uncomment for benchmarking C++ against SSE or NEON.
// Do so in both simon.cpp and simon-simd.cpp.
// #undef CRYPTOPP_SSE41_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE

#if (CRYPTOPP_SSSE3_AVAILABLE)
# include "adv_simd.h"
# include <pmmintrin.h>
# include <tmmintrin.h>
#endif
Expand All @@ -30,12 +30,13 @@
# include <ammintrin.h>
#endif

#if defined(__AVX512F__) && defined(__AVX512VL__)
#if defined(__AVX512F__)
# define CRYPTOPP_AVX512_ROTATE 1
# include <immintrin.h>
#endif

#if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include "adv_simd.h"
# include <arm_neon.h>
#endif

Expand All @@ -47,6 +48,7 @@
#endif

#if defined(CRYPTOPP_ALTIVEC_AVAILABLE)
# include "adv_simd.h"
# include "ppc_simd.h"
#endif

Expand Down

0 comments on commit 58772f3

Please sign in to comment.