Skip to content

Commit

Permalink
Make NO_AES_NI internal
Browse files Browse the repository at this point in the history
  • Loading branch information
hmage committed Apr 15, 2016
1 parent b57386d commit 94f5038
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
3 changes: 0 additions & 3 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ libcurl-devel and an development packages are required to be
installed to build this application and are available in most
Linux repositories.

To compile on older CPUs without AES_NI support use the following
CFLAGS options: "-O3 -march=native -DNO_AES_NI"

Bugs
----

Expand Down
1 change: 0 additions & 1 deletion algo/echo/aes_ni/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* - implements NIST hash api
* - assumes that message lenght is multiple of 8-bits
* - _ECHO_VPERM_ must be defined if compiling with ../main.c
* - define NO_AES_NI for aes_ni version
*
* Cagdas Calik
* [email protected]
Expand Down
1 change: 1 addition & 0 deletions algo/groestl/aes_ni/groestl-version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "miner.h"
// specify assembly or intrinsics implementation
//#define TASM
#define TINTR
Expand Down
2 changes: 2 additions & 0 deletions algo/hodl/aes.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <stdint.h>
#include <x86intrin.h>

#include "miner.h"

#ifndef NO_AES_NI

static inline void ExpandAESKey256_sub1(__m128i *tmp1, __m128i *tmp2)
Expand Down
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ rm -f config.status
# extracflags="-O3 -march=native -Wall -D_REENTRANT -funroll-loops -fvariable-expansion-in-unroller -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16"

# Debian 7.7 / Ubuntu 14.04 (gcc 4.7+)
#extracflags="$extracflags -Ofast -flto -fuse-linker-plugin -ftree-loop-if-convert-stores"
extracflags="$extracflags -O3 -march=native -ftree-loop-if-convert-stores -DUSE_ASM"

./configure --with-crypto --with-curl CFLAGS="-O3 -march=native -Wall"
CFLAGS="$extracflags" \
CXXFLAGS="$CFLAGS" \
./configure --with-crypto --with-curl

make -j 4

Expand Down
12 changes: 6 additions & 6 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
#undef USE_ASM
#endif

#ifndef NO_AES_NI
#ifndef __AES__
#define NO_AES_NI
#endif
#endif

/* missing arch defines for msvc */
#if defined(_M_X64)
#define __i386__ 1
Expand All @@ -28,6 +22,12 @@
#define __i386__ 1
#endif

#else /* _MSC_VER */

#ifndef __AES__
#define NO_AES_NI
#endif

#endif /* _MSC_VER */

#include <stdbool.h>
Expand Down

0 comments on commit 94f5038

Please sign in to comment.