1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Add one more instruction to avoid one branch point in the common path in the cl return code.

Although this adds more ALUs overall and more branch points, the common path code has the same number of ALUs and one less jmp, jmps being more expensive.
This commit is contained in:
Con Kolivas 2011-08-19 11:55:00 +10:00
parent a754cc3f0c
commit aaa2e19e0e

View File

@ -385,44 +385,36 @@ void search( const uint state0, const uint state1, const uint state2, const uint
sharoundW(64 + 57); sharoundW(64 + 57);
sharoundW(64 + 58); sharoundW(64 + 58);
u v = W[117] + W[108] + Vals[3] + Vals[7] + P2(124) + P1(124) + Ch((Vals[0] + Vals[4]) + (K[59] + W(59+64)) + s1(64+59)+ ch(59+64),Vals[1],Vals[2]); u v = W[117] + W[108] + Vals[3] + Vals[7] + P2(124) + P1(124) + Ch((Vals[0] + Vals[4]) + (K[59] + W(59+64)) + s1(64+59)+ ch(59+64),Vals[1],Vals[2]) ^
u g = -(K[60] + H[7]) - S1((Vals[0] + Vals[4]) + (K[59] + W(59+64)) + s1(64+59)+ ch(59+64)); -(K[60] + H[7]) - S1((Vals[0] + Vals[4]) + (K[59] + W(59+64)) + s1(64+59)+ ch(59+64));
#define FOUND (0x80) #define FOUND (0x80)
#define NFLAG (0x7F) #define NFLAG (0x7F)
#ifdef VECTORS4 #ifdef VECTORS4
if (v.x == g.x) bool result = v.x & v.y & v.z & v.w;
{ if (!result) {
output[FOUND] = output[NFLAG & W[3].x] = W[3].x; if (!v.x)
} output[FOUND] = output[NFLAG & W[3].x] = W[3].x;
if (v.y == g.y) if (!v.y)
{ output[FOUND] = output[NFLAG & W[3].y] = W[3].y;
output[FOUND] = output[NFLAG & W[3].y] = W[3].y; if (!v.z)
} output[FOUND] = output[NFLAG & W[3].z] = W[3].z;
if (v.z == g.z) if (!v.w)
{ output[FOUND] = output[NFLAG & W[3].w] = W[3].w;
output[FOUND] = output[NFLAG & W[3].z] = W[3].z;
}
if (v.w == g.w)
{
output[FOUND] = output[NFLAG & W[3].w] = W[3].w;
} }
#else #else
#ifdef VECTORS2 #ifdef VECTORS2
if (v.x == g.x) bool result = v.x & v.y;
{ if (!result) {
output[FOUND] = output[NFLAG & W[3].x] = W[3].x; if (!v.x)
} output[FOUND] = output[NFLAG & W[3].x] = W[3].x;
if (v.y == g.y) if (!v.y)
{ output[FOUND] = output[NFLAG & W[3].y] = W[3].y;
output[FOUND] = output[NFLAG & W[3].y] = W[3].y;
} }
#else #else
if (v == g) if (!v)
{
output[FOUND] = output[NFLAG & W[3]] = W[3]; output[FOUND] = output[NFLAG & W[3]] = W[3];
}
#endif #endif
#endif #endif
} }