Browse Source

blake: +8MH/s on linux, weird optimisation

Like doom/luffa, using a int pos make the proc faster
2upstream
Tanguy Pruvot 10 years ago
parent
commit
347d4e4928
  1. 9
      blake32.cu
  2. 2
      cpu-miner.c

9
blake32.cu

@ -241,13 +241,18 @@ void blake256_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *resN
blake256_compress(h, ending, 640, blakerounds); blake256_compress(h, ending, 640, blakerounds);
int pos = -1;
#pragma unroll 8
for (int i = 7; i >= 0; i--) { for (int i = 7; i >= 0; i--) {
uint32_t hash = cuda_swab32(h[i]); uint32_t hash = cuda_swab32(h[i]);
if (hash > c_Target[i]) { if (hash > c_Target[i]) {
return; return;
} }
if (hash < c_Target[i]) { if (hash < c_Target[i]) {
break; /* dont ask me why, we lose 8MH/s in perfs
without the int variable */
if (pos < i) pos = i;
//break;
} }
} }
@ -382,7 +387,7 @@ extern "C" int scanhash_blake256(int thr_id, uint32_t *pdata, const uint32_t *pt
} }
if ((uint64_t) pdata[19] + throughput > (uint64_t) max_nonce) { if ((uint64_t) pdata[19] + throughput > (uint64_t) max_nonce) {
pdata[19] = max_nonce - first_nonce + 1; pdata[19] = max_nonce;
break; break;
} }

2
cpu-miner.c

@ -1453,7 +1453,7 @@ out:
return NULL; return NULL;
} }
#define PROGRAM_VERSION "1.4.3" #define PROGRAM_VERSION "1.4.4"
static void show_version_and_exit(void) static void show_version_and_exit(void)
{ {
printf("%s v%s\n" printf("%s v%s\n"

Loading…
Cancel
Save