Browse Source

Move poclbm to new branch optimisation as well.

Con Kolivas 14 years ago
parent
commit
bd79a61c43
2 changed files with 21 additions and 21 deletions
  1. 1 1
      findnonce.h
  2. 20 20
      poclbm110816.cl

+ 1 - 1
findnonce.h

@@ -5,7 +5,7 @@
 
 
 #define MAXTHREADS (0xFFFFFFFEULL)
 #define MAXTHREADS (0xFFFFFFFEULL)
 /* Maximum worksize 4k to match page size */
 /* Maximum worksize 4k to match page size */
-#define MAXBUFFERS (0xFF)
+#define MAXBUFFERS (0xFFFF)
 #define BUFFERSIZE (sizeof(uint32_t) * MAXBUFFERS)
 #define BUFFERSIZE (sizeof(uint32_t) * MAXBUFFERS)
 #define FOUND (0x80)
 #define FOUND (0x80)
 /* #define NFLAG (0x7F) Just for reference */
 /* #define NFLAG (0x7F) Just for reference */

+ 20 - 20
poclbm110816.cl

@@ -624,33 +624,33 @@ __kernel void search(	const uint state0, const uint state1, const uint state2, c
 	W[12] = W[12] + (rotr(W[13], 7) ^ rotr(W[13], 18) ^ (W[13] >> 3U)) + W[5] + (rotr(W[10], 17) ^ rotr(W[10], 19) ^ (W[10] >> 10U));
 	W[12] = W[12] + (rotr(W[13], 7) ^ rotr(W[13], 18) ^ (W[13] >> 3U)) + W[5] + (rotr(W[10], 17) ^ rotr(W[10], 19) ^ (W[10] >> 10U));
 	
 	
 	Vals[7] = Vals[7] + Vals[3] + (rotr(Vals[0], 6) ^ rotr(Vals[0], 11) ^ rotr(Vals[0], 25)) + ch(Vals[0], Vals[1], Vals[2]) + K[60] + W[12];
 	Vals[7] = Vals[7] + Vals[3] + (rotr(Vals[0], 6) ^ rotr(Vals[0], 11) ^ rotr(Vals[0], 25)) + ch(Vals[0], Vals[1], Vals[2]) + K[60] + W[12];
+	Vals[7] ^= -0x5be0cd19U;
 
 
 #define FOUND (0x80)
 #define FOUND (0x80)
 #define NFLAG (0x7F)
 #define NFLAG (0x7F)
 
 
-#if defined(VECTORS4) || defined(VECTORS2)
-	if (Vals[7].x == -0x5be0cd19U)
-	{
-		output[FOUND] = output[NFLAG & nonce.x] =  nonce.x;
+#if defined(VECTORS4)
+	bool result = Vals[7].x & Vals[7].y & Vals[7].z & Vals[7].w;
+	if (!result) {
+		if (!Vals[7].x)
+			output[FOUND] = output[NFLAG & nonce.x] =  nonce.x;
+		if (!Vals[7].y)
+			output[FOUND] = output[NFLAG & nonce.y] =  nonce.y;
+		if (!Vals[7].z)
+			output[FOUND] = output[NFLAG & nonce.z] =  nonce.z;
+		if (!Vals[7].w)
+			output[FOUND] = output[NFLAG & nonce.w] =  nonce.w;
 	}
 	}
-	if (Vals[7].y == -0x5be0cd19U)
-	{
-		output[FOUND] = output[NFLAG & nonce.y] =  nonce.y;
+#elif defined(VECTORS2)
+	bool result = Vals[7].x & Vals[7].y;
+	if (!result) {
+		if (!Vals[7].x)
+			output[FOUND] = output[NFLAG & nonce.x] =  nonce.x;
+		if (!Vals[7].y)
+			output[FOUND] = output[NFLAG & nonce.y] =  nonce.y;
 	}
 	}
-#ifdef VECTORS4
-	if (Vals[7].z == -0x5be0cd19U)
-	{
-		output[FOUND] = output[NFLAG & nonce.z] =  nonce.z;
-	}
-	if (Vals[7].w == -0x5be0cd19U)
-	{
-		output[FOUND] = output[NFLAG & nonce.w] =  nonce.w;
-	}
-#endif
 #else
 #else
-	if (Vals[7] == -0x5be0cd19U)
-	{
+	if (!Vals[7])
 		output[FOUND] = output[NFLAG & nonce] =  nonce;
 		output[FOUND] = output[NFLAG & nonce] =  nonce;
-	}
 #endif
 #endif
 }
 }