aboutsummaryrefslogtreecommitdiff
path: root/sha256_sse2_amd64.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2011-06-08 18:58:01 -0700
committerJeff Garzik <jgarzik@exmulti.com>2011-06-08 18:58:01 -0700
commit48a888dbfbc60ef0644dc43e19ae4764a2d380b6 (patch)
tree75b8e08a61d4e488824b1c0fa2de4bc05459cc03 /sha256_sse2_amd64.c
parentf2e4ff0e509f69404aa11f5232d8f63110383f03 (diff)
parent8a832eeab524bbad160adb7c27acb370d6adedff (diff)
Merge pull request #23 from ckolivas/master
Here's my x86_64 and linux optimisations. Hopefully shouldn't break other OSs now.
Diffstat (limited to 'sha256_sse2_amd64.c')
-rw-r--r--sha256_sse2_amd64.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sha256_sse2_amd64.c b/sha256_sse2_amd64.c
index 4784342..3aa154c 100644
--- a/sha256_sse2_amd64.c
+++ b/sha256_sse2_amd64.c
@@ -100,13 +100,13 @@ int scanhash_sse2_64(int thr_id, const unsigned char *pmidstate,
for (j = 0; j < 4; j++) {
mi.m = m_4hash[7];
- if (mi.i[j] == 0)
+ if (unlikely(mi.i[j] == 0))
break;
}
/* If j = true, we found a hit...so check it */
/* Use the C version for a check... */
- if (j != 4) {
+ if (unlikely(j != 4)) {
for (i = 0; i < 8; i++) {
mi.m = m_4hash[i];
*(uint32_t *)&(phash)[i*4] = mi.i[j];
@@ -121,12 +121,12 @@ int scanhash_sse2_64(int thr_id, const unsigned char *pmidstate,
nonce += 4;
- if ((nonce >= max_nonce) || work_restart[thr_id].restart)
+ if (unlikely((nonce >= max_nonce) || work_restart[thr_id].restart))
{
*nHashesDone = nonce;
return -1;
- }
- }
+ }
+ }
}
#endif /* WANT_X8664_SSE2 */