Apply "no-static-without-amd" fixes
This commit is contained in:
parent
b44f38a362
commit
84c67c37cd
9 changed files with 2146 additions and 2207 deletions
|
@ -1,34 +1,12 @@
|
|||
#ifndef WOLF_SKEIN_CL
|
||||
#define WOLF_SKEIN_CL
|
||||
|
||||
#ifdef cl_amd_media_ops
|
||||
# pragma OPENCL EXTENSION cl_amd_media_ops : enable
|
||||
# define xmrig_amd_bitalign(src0, src1, src2) amd_bitalign(src0, src1, src2)
|
||||
#else
|
||||
/* taken from https://www.khronos.org/registry/OpenCL/extensions/amd/cl_amd_media_ops.txt
|
||||
* Build-in Function
|
||||
* uintn amd_bitalign (uintn src0, uintn src1, uintn src2)
|
||||
* Description
|
||||
* dst.s0 = (uint) (((((long)src0.s0) << 32) | (long)src1.s0) >> (src2.s0 & 31))
|
||||
* similar operation applied to other components of the vectors.
|
||||
*
|
||||
* The implemented function is modified because the last is in our case always a scalar.
|
||||
* We can ignore the bitwise AND operation.
|
||||
*/
|
||||
inline uint2 xmrig_amd_bitalign(const uint2 src0, const uint2 src1, const uint2 src2)
|
||||
{
|
||||
uint2 result;
|
||||
result.s0 = (uint) (((((long)src0.s0) << 32) | (long)src1.s0) >> (src2.s0 & 31));
|
||||
result.s1 = (uint) (((((long)src0.s1) << 32) | (long)src1.s1) >> (src2.s1 & 31));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Vectorized Skein implementation macros and functions by Wolf
|
||||
|
||||
#define SKEIN_KS_PARITY 0x1BD11BDAA9FC1A22
|
||||
|
||||
static const __constant ulong SKEIN256_IV[8] =
|
||||
STATIC const __constant ulong SKEIN256_IV[8] =
|
||||
{
|
||||
0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL,
|
||||
0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL,
|
||||
|
@ -36,7 +14,7 @@ static const __constant ulong SKEIN256_IV[8] =
|
|||
0xC36FBAF9393AD185UL, 0x3EEDBA1833EDFC13UL
|
||||
};
|
||||
|
||||
static const __constant ulong SKEIN512_256_IV[8] =
|
||||
STATIC const __constant ulong SKEIN512_256_IV[8] =
|
||||
{
|
||||
0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL,
|
||||
0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL,
|
||||
|
@ -53,12 +31,8 @@ static const __constant ulong SKEIN512_256_IV[8] =
|
|||
|
||||
ulong SKEIN_ROT(const uint2 x, const uint y)
|
||||
{
|
||||
if (y < 32) {
|
||||
return(as_ulong(xmrig_amd_bitalign(x, x.s10, 32 - y)));
|
||||
}
|
||||
else {
|
||||
return(as_ulong(xmrig_amd_bitalign(x.s10, x, 32 - (y - 32))));
|
||||
}
|
||||
if(y < 32) return(as_ulong(amd_bitalign(x, x.s10, 32 - y)));
|
||||
else return(as_ulong(amd_bitalign(x.s10, x, 32 - (y - 32))));
|
||||
}
|
||||
|
||||
void SkeinMix8(ulong4 *pv0, ulong4 *pv1, const uint rc0, const uint rc1, const uint rc2, const uint rc3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue