diff --git a/OpenCL/m18700_a0-optimized.cl b/OpenCL/m18700_a0-optimized.cl index 7cacbb6c7..cbfc9a152 100644 --- a/OpenCL/m18700_a0-optimized.cl +++ b/OpenCL/m18700_a0-optimized.cl @@ -28,10 +28,24 @@ DECLSPEC u32 hashCode (const u32 init, const u32 *w, const u32 pw_len) switch (c) { - case 4: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 3: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 2: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 1: hash *= 31; hash += tmp & 0xff; + case 1: + hash *= 31; hash += (tmp >> 0) & 0xff; + break; + case 2: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + break; + case 3: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + break; + case 4: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + hash *= 31; hash += (tmp >> 24) & 0xff; + break; } } diff --git a/OpenCL/m18700_a0-pure.cl b/OpenCL/m18700_a0-pure.cl index ad7b6e647..4feda941d 100644 --- a/OpenCL/m18700_a0-pure.cl +++ b/OpenCL/m18700_a0-pure.cl @@ -29,10 +29,24 @@ DECLSPEC u32 hashCode (const u32 init, const u32 *w, const u32 pw_len) switch (c) { - case 4: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 3: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 2: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 1: hash *= 31; hash += tmp & 0xff; + case 1: + hash *= 31; hash += (tmp >> 0) & 0xff; + break; + case 2: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + break; + case 3: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + break; + case 4: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + hash *= 31; hash += (tmp >> 24) & 0xff; + break; } } diff --git a/OpenCL/m18700_a1-optimized.cl b/OpenCL/m18700_a1-optimized.cl index 60242880e..4e7928d3b 100644 --- a/OpenCL/m18700_a1-optimized.cl +++ b/OpenCL/m18700_a1-optimized.cl @@ -28,10 +28,24 @@ DECLSPEC u32 hashCode_g (const u32 init, __global u32 * restrict w, const u32 pw switch (c) { - case 4: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 3: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 2: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 1: hash *= 31; hash += tmp & 0xff; + case 1: + hash *= 31; hash += (tmp >> 0) & 0xff; + break; + case 2: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + break; + case 3: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + break; + case 4: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + hash *= 31; hash += (tmp >> 24) & 0xff; + break; } } diff --git a/OpenCL/m18700_a1-pure.cl b/OpenCL/m18700_a1-pure.cl index ef998501b..ffc403ba5 100644 --- a/OpenCL/m18700_a1-pure.cl +++ b/OpenCL/m18700_a1-pure.cl @@ -27,10 +27,24 @@ DECLSPEC u32 hashCode_g (const u32 init, __global u32 * restrict w, const u32 pw switch (c) { - case 4: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 3: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 2: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 1: hash *= 31; hash += tmp & 0xff; + case 1: + hash *= 31; hash += (tmp >> 0) & 0xff; + break; + case 2: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + break; + case 3: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + break; + case 4: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + hash *= 31; hash += (tmp >> 24) & 0xff; + break; } } diff --git a/OpenCL/m18700_a3-optimized.cl b/OpenCL/m18700_a3-optimized.cl index 54561f6d2..6a1e25035 100644 --- a/OpenCL/m18700_a3-optimized.cl +++ b/OpenCL/m18700_a3-optimized.cl @@ -45,10 +45,24 @@ DECLSPEC u32x hashCode_w0 (const u32x init, const u32x w0, const u32 *w, const u switch (c) { - case 4: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 3: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 2: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 1: hash *= 31; hash += tmp & 0xff; + case 1: + hash *= 31; hash += (tmp >> 0) & 0xff; + break; + case 2: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + break; + case 3: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + break; + case 4: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + hash *= 31; hash += (tmp >> 24) & 0xff; + break; } } diff --git a/OpenCL/m18700_a3-pure.cl b/OpenCL/m18700_a3-pure.cl index 1d599dc69..3d28282e7 100644 --- a/OpenCL/m18700_a3-pure.cl +++ b/OpenCL/m18700_a3-pure.cl @@ -45,10 +45,24 @@ DECLSPEC u32x hashCode_w0 (const u32x init, const u32x w0, const u32 *w, const u switch (c) { - case 4: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 3: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 2: hash *= 31; hash += tmp & 0xff; tmp >>= 8; - case 1: hash *= 31; hash += tmp & 0xff; + case 1: + hash *= 31; hash += (tmp >> 0) & 0xff; + break; + case 2: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + break; + case 3: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + break; + case 4: + hash *= 31; hash += (tmp >> 0) & 0xff; + hash *= 31; hash += (tmp >> 8) & 0xff; + hash *= 31; hash += (tmp >> 16) & 0xff; + hash *= 31; hash += (tmp >> 24) & 0xff; + break; } }