diff --git a/bfgminer/sha256_altivec_4way.c b/bfgminer/sha256_altivec_4way.c index 0a52feb..f3ca11a 100644 --- a/bfgminer/sha256_altivec_4way.c +++ b/bfgminer/sha256_altivec_4way.c @@ -20,7 +20,7 @@ #include #include -//#include +#include #include #include @@ -58,17 +58,17 @@ static inline vector unsigned int Maj(const vector unsigned int b, const vector /* RotateRight(x, n) := RotateLeft(x, 32-n) */ /* SHA256 Functions */ -#define BIGSIGMA0_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int)(32-2)),vec_rl((x), (vector unsigned int)(32-13))),vec_rl((x), (vector unsigned int)(32-22)))) -#define BIGSIGMA1_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int)(32-6)),vec_rl((x), (vector unsigned int)(32-11))),vec_rl((x), (vector unsigned int)(32-25)))) +#define BIGSIGMA0_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int){32-2}),vec_rl((x), (vector unsigned int){32-13})),vec_rl((x), (vector unsigned int){32-22}))) +#define BIGSIGMA1_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int){32-6}),vec_rl((x), (vector unsigned int){32-11})),vec_rl((x), (vector unsigned int){32-25}))) -#define SIGMA0_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int)(32- 7)),vec_rl((x), (vector unsigned int)(32-18))), vec_sr((x), (vector unsigned int)(3 )))) -#define SIGMA1_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int)(32-17)),vec_rl((x), (vector unsigned int)(32-19))), vec_sr((x), (vector unsigned int)(10)))) +#define SIGMA0_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int){32- 7}),vec_rl((x), (vector unsigned int){32-18})), vec_sr((x), (vector unsigned int){3 }))) +#define SIGMA1_256(x) (vec_xor(vec_xor(vec_rl((x), (vector unsigned int){32-17}),vec_rl((x), (vector unsigned int){32-19})), vec_sr((x), (vector unsigned int){10}))) #define add4(x0, x1, x2, x3) vec_add(vec_add(x0, x1),vec_add( x2,x3)) #define add5(x0, x1, x2, x3, x4) vec_add(add4(x0, x1, x2, x3), x4) #define SHA256ROUND(a, b, c, d, e, f, g, h, i, w) \ - T1 = add5(h, BIGSIGMA1_256(e), Ch(e, f, g), (vector unsigned int)(sha256_consts[i],sha256_consts[i],sha256_consts[i],sha256_consts[i]), w); \ + T1 = add5(h, BIGSIGMA1_256(e), Ch(e, f, g), ((vector unsigned int){sha256_consts[i],sha256_consts[i],sha256_consts[i],sha256_consts[i]}), w); \ d = vec_add(d, T1); \ h = vec_add(T1, vec_add(BIGSIGMA0_256(a), Maj(a, b, c))); @@ -99,7 +99,7 @@ bool ScanHash_altivec_4way(struct thr_info * const thr, struct work * const work *nNonce_p = nonce; - DoubleBlockSHA256(pdata, phash1, pmidstate, thash, pSHA256InitState); + DoubleBlockSHA256(pdata, hash1, pmidstate, thash, pSHA256InitState); for (j = 0; j < NPAR; j++) { @@ -146,43 +146,43 @@ static void DoubleBlockSHA256(const void* pin, void* pad, const void *pre, unsig vector unsigned int nonce, preNonce; /* nonce offset for vector */ - vector unsigned int offset = (vector unsigned int)(0, 1, 2, 3); + vector unsigned int offset = (vector unsigned int){0, 1, 2, 3}; - preNonce = vec_add((vector unsigned int)(In[3],In[3],In[3],In[3]), offset); + preNonce = vec_add((vector unsigned int){In[3],In[3],In[3],In[3]}, offset); for(k = 0; k