Skip to content

Commit

Permalink
Add optimized PowerPC code
Browse files Browse the repository at this point in the history
  • Loading branch information
pooler committed Feb 25, 2015
1 parent 4611186 commit 9373a5c
Show file tree
Hide file tree
Showing 9 changed files with 3,081 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ endif
if ARCH_ARM
minerd_SOURCES += sha2-arm.S scrypt-arm.S
endif
if ARCH_PPC
minerd_SOURCES += sha2-ppc.S scrypt-ppc.S
endif
endif
minerd_LDFLAGS = $(PTHREAD_FLAGS)
minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@
Expand Down
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Architecture-specific notes:
but the decision whether to use them is made at compile time,
based on compiler-defined macros.
To use NEON instructions, add "-mfpu=neon" to CFLAGS.
PowerPC: No runtime CPU detection.
To use AltiVec instructions, add "-maltivec" to CFLAGS.
x86: The miner checks for SSE2 instructions support at runtime,
and uses them if they are available.
x86-64: The miner can take advantage of AVX, AVX2 and XOP instructions,
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ case $target in
arm*-*-*)
have_arm=true
;;
powerpc*-*-*)
have_ppc=true
;;
esac

PTHREAD_FLAGS="-pthread"
Expand Down Expand Up @@ -108,6 +111,7 @@ AM_CONDITIONAL([USE_ASM], [test x$enable_assembly != xno])
AM_CONDITIONAL([ARCH_x86], [test x$have_x86 = xtrue])
AM_CONDITIONAL([ARCH_x86_64], [test x$have_x86_64 = xtrue])
AM_CONDITIONAL([ARCH_ARM], [test x$have_arm = xtrue])
AM_CONDITIONAL([ARCH_PPC], [test x$have_ppc = xtrue])

if test x$request_jansson = xtrue
then
Expand Down
6 changes: 6 additions & 0 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,12 @@ static void show_version_and_exit(void)
#if defined(__ARM_NEON__)
" NEON"
#endif
#endif
#if defined(USE_ASM) && (defined(__powerpc__) || defined(__ppc__) || defined(__PPC__))
" PowerPC"
#if defined(__ALTIVEC__)
" AltiVec"
#endif
#endif
"\n");

Expand Down
2 changes: 1 addition & 1 deletion miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void sha256_transform(uint32_t *state, const uint32_t *block, int swap);
void sha256d(unsigned char *hash, const unsigned char *data, int len);

#ifdef USE_ASM
#if defined(__ARM_NEON__) || defined(__i386__) || defined(__x86_64__)
#if defined(__ARM_NEON__) || defined(__ALTIVEC__) || defined(__i386__) || defined(__x86_64__)
#define HAVE_SHA256_4WAY 1
int sha256_use_4way();
void sha256_init_4way(uint32_t *state);
Expand Down
Loading

0 comments on commit 9373a5c

Please sign in to comment.