From 96d2287c722e4566fd30271c76869f83831e86c2 Mon Sep 17 00:00:00 2001 From: Mark Crichton Date: Sat, 5 Mar 2011 22:22:57 -0500 Subject: X86_64 SSE2 support for Linux --- cpu-miner.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'cpu-miner.c') diff --git a/cpu-miner.c b/cpu-miner.c index dffc7ed..fd64a0c 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -38,6 +38,7 @@ enum sha256_algos { ALGO_VIA, /* VIA padlock */ ALGO_CRYPTOPP, /* Crypto++ (C) */ ALGO_CRYPTOPP_ASM32, /* Crypto++ 32-bit assembly */ + ALGO_SSE2_64, /* SSE2 for x86_64 */ }; static const char *algo_names[] = { @@ -52,6 +53,9 @@ static const char *algo_names[] = { #ifdef WANT_CRYPTOPP_ASM32 [ALGO_CRYPTOPP_ASM32] = "cryptopp_asm32", #endif +#ifdef WANT_X8664_SSE2 + [ALGO_SSE2_64] = "sse2_64", +#endif }; bool opt_debug = false; @@ -93,6 +97,9 @@ static struct option_help options_help[] = { "\n\tcryptopp\tCrypto++ C/C++ implementation" #ifdef WANT_CRYPTOPP_ASM32 "\n\tcryptopp_asm32\tCrypto++ 32-bit assembler implementation" +#endif +#ifdef WANT_X8664_SSE2 + "\n\tsse2_64\t\tSSE2 implementation for x86_64 machines" #endif }, @@ -331,6 +338,18 @@ static void *miner_thread(void *thr_id_int) max_nonce, &hashes_done); break; +#ifdef WANT_X8664_SSE2 + case ALGO_SSE2_64: { + unsigned int rc5 = + scanhash_sse2_64(work.midstate, work.data + 64, + work.hash1, work.hash, + work.target, + max_nonce, &hashes_done); + rc = (rc5 == -1) ? false : true; + } + break; +#endif + #ifdef WANT_SSE2_4WAY case ALGO_4WAY: { unsigned int rc4 = -- cgit v1.2.3-18-g5258