diff --git a/OpenCL/inc_common.cl b/OpenCL/inc_common.cl index 0de9924ef..8f1eab60a 100644 --- a/OpenCL/inc_common.cl +++ b/OpenCL/inc_common.cl @@ -1317,6 +1317,16 @@ DECLSPEC u64x hc_swap64 (const u64x v) asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.sf) : "r"(tr.sf), "r"(tl.sf)); #endif + #elif defined IS_METAL + + const u32x a0 = h32_from_64 (v); + const u32x a1 = l32_from_64 (v); + + u32x t0 = hc_swap32 (a0); + u32x t1 = hc_swap32 (a1); + + r = hl32_to_64 (t1, t0); + #else #if defined USE_BITSELECT && defined USE_ROTATE @@ -1380,7 +1390,19 @@ DECLSPEC u64 hc_swap64_S (const u64 v) asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr) : "r"(ir)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r) : "r"(tr), "r"(tl)); + + #elif defined IS_METAL + + const u32 v0 = h32_from_64_S (v); + const u32 v1 = l32_from_64_S (v); + + u32 t0 = hc_swap32_S (v0); + u32 t1 = hc_swap32_S (v1); + + r = hl32_to_64_S (t1, t0); + #else + #ifdef USE_SWIZZLE r = as_ulong (as_uchar8 (v).s76543210); #else diff --git a/docs/changes.txt b/docs/changes.txt index 8ea8b39d3..f6be03171 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -77,6 +77,7 @@ - Fixed build failed for 31700 with Apple Metal - Fixed build failed for 31300 with vector width > 1 - Fixed build failed for 31000/Blake2s with vector width > 1 +- Fixed build failure for almost all hash modes that make use of hc_swap64 and/or hc_swap64_S with Apple Metal - Fixed display problem of the "Optimizers applied" list for algorithms using OPTI_TYPE_SLOW_HASH_SIMD_INIT2 and/or OPTI_TYPE_SLOW_HASH_SIMD_LOOP2 - Fixed incompatible pointer types (salt1 and salt2 buf) in 31700 a3 kernel - Fixed incompatible pointer types (salt1 and salt2 buf) in 3730 a3 kernel