aboutsummaryrefslogtreecommitdiff
path: root/cpu-miner.c
diff options
context:
space:
mode:
authorMark Crichton <crichton@gmail.com>2011-03-05 22:22:57 -0500
committerMark Crichton <crichton@gmail.com>2011-03-06 23:49:00 -0500
commit96d2287c722e4566fd30271c76869f83831e86c2 (patch)
tree5588fa3e06b3bd12423a30639d1e1e2e09204622 /cpu-miner.c
parent1d8b6e13a389c39f672d2bc8a68dfcfce5c04b65 (diff)
X86_64 SSE2 support for Linux
Diffstat (limited to 'cpu-miner.c')
-rw-r--r--cpu-miner.c19
1 files changed, 19 insertions, 0 deletions
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;
@@ -94,6 +98,9 @@ static struct option_help options_help[] = {
#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
},
{ "quiet",
@@ -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 =