mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.9.5.4
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
void skeinhash_4way( void *state, const void *input )
|
||||
{
|
||||
uint64_t vhash64[8*4] __attribute__ ((aligned (64)));
|
||||
uint64_t vhash64[16*4] __attribute__ ((aligned (64)));
|
||||
skein512_4way_context ctx_skein;
|
||||
#if defined(__SHA__)
|
||||
uint32_t hash0[16] __attribute__ ((aligned (64)));
|
||||
@@ -30,7 +30,7 @@ void skeinhash_4way( void *state, const void *input )
|
||||
skein512_4way_close( &ctx_skein, vhash64 );
|
||||
|
||||
#if defined(__SHA__)
|
||||
mm256_dintrlv_4x64( hash0, hash1, hash2, hash3, vhash64, 512 );
|
||||
dintrlv_4x64( hash0, hash1, hash2, hash3, vhash64, 512 );
|
||||
|
||||
SHA256_Init( &ctx_sha256 );
|
||||
SHA256_Update( &ctx_sha256, (unsigned char*)hash0, 64 );
|
||||
@@ -50,7 +50,7 @@ void skeinhash_4way( void *state, const void *input )
|
||||
|
||||
intrlv_4x32( state, hash0, hash1, hash2, hash3, 256 );
|
||||
#else
|
||||
mm256_rintrlv_4x64_4x32( vhash32, vhash64, 512 );
|
||||
rintrlv_4x64_4x32( vhash32, vhash64, 512 );
|
||||
|
||||
sha256_4way_init( &ctx_sha256 );
|
||||
sha256_4way( &ctx_sha256, vhash32, 64 );
|
||||
@@ -62,8 +62,7 @@ int scanhash_skein_4way( struct work *work, uint32_t max_nonce,
|
||||
uint64_t *hashes_done, struct thr_info *mythr )
|
||||
{
|
||||
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
|
||||
uint32_t hash[8*4] __attribute__ ((aligned (64)));
|
||||
uint32_t edata[20] __attribute__ ((aligned (64)));
|
||||
uint32_t hash[16*4] __attribute__ ((aligned (64)));
|
||||
uint32_t lane_hash[8] __attribute__ ((aligned (32)));
|
||||
uint32_t *hash7 = &(hash[7<<2]);
|
||||
uint32_t *pdata = work->data;
|
||||
@@ -74,9 +73,7 @@ int scanhash_skein_4way( struct work *work, uint32_t max_nonce,
|
||||
__m256i *noncev = (__m256i*)vdata + 9; // aligned
|
||||
int thr_id = mythr->id; // thr_id arg is deprecated
|
||||
|
||||
swab32_array( edata, pdata, 20 );
|
||||
mm256_intrlv_4x64( vdata, edata, edata, edata, edata, 640 );
|
||||
// mm256_bswap_intrlv80_4x64( vdata, pdata );
|
||||
mm256_bswap32_intrlv80_4x64( vdata, pdata );
|
||||
do
|
||||
{
|
||||
*noncev = mm256_intrlv_blend_32( mm256_bswap_32(
|
||||
|
||||
@@ -279,10 +279,7 @@ do { \
|
||||
_mm256_xor_si256( k2, k3 ) ), \
|
||||
_mm256_xor_si256( _mm256_xor_si256( k4, k5 ), \
|
||||
_mm256_xor_si256( k6, k7 ) ) ), \
|
||||
_mm256_set_epi64x( SPH_C64(0x1BD11BDAA9FC1A22), \
|
||||
SPH_C64(0x1BD11BDAA9FC1A22), \
|
||||
SPH_C64(0x1BD11BDAA9FC1A22), \
|
||||
SPH_C64(0x1BD11BDAA9FC1A22) ) ); \
|
||||
m256_const1_64( 0x1BD11BDAA9FC1A22) ); \
|
||||
t2 = t0 ^ t1; \
|
||||
} while (0)
|
||||
|
||||
@@ -294,13 +291,11 @@ do { \
|
||||
w3 = _mm256_add_epi64( w3, SKBI(k,s,3) ); \
|
||||
w4 = _mm256_add_epi64( w4, SKBI(k,s,4) ); \
|
||||
w5 = _mm256_add_epi64( w5, _mm256_add_epi64( SKBI(k,s,5), \
|
||||
_mm256_set_epi64x( SKBT(t,s,0), SKBT(t,s,0), \
|
||||
SKBT(t,s,0), SKBT(t,s,0) ) ) ); \
|
||||
m256_const1_64( SKBT(t,s,0) ) ) ); \
|
||||
w6 = _mm256_add_epi64( w6, _mm256_add_epi64( SKBI(k,s,6), \
|
||||
_mm256_set_epi64x( SKBT(t,s,1), SKBT(t,s,1), \
|
||||
SKBT(t,s,1), SKBT(t,s,1) ) ) ); \
|
||||
m256_const1_64( SKBT(t,s,1) ) ) ); \
|
||||
w7 = _mm256_add_epi64( w7, _mm256_add_epi64( SKBI(k,s,7), \
|
||||
_mm256_set_epi64x( s, s, s, s ) ) ); \
|
||||
m256_const1_64( s ) ) ); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
void skein2hash_4way( void *output, const void *input )
|
||||
{
|
||||
skein512_4way_context ctx;
|
||||
uint64_t hash[8*4] __attribute__ ((aligned (64)));
|
||||
uint64_t hash[16*4] __attribute__ ((aligned (64)));
|
||||
|
||||
skein512_4way_init( &ctx );
|
||||
skein512_4way( &ctx, input, 80 );
|
||||
@@ -22,8 +22,7 @@ void skein2hash_4way( void *output, const void *input )
|
||||
int scanhash_skein2_4way( struct work *work, uint32_t max_nonce,
|
||||
uint64_t *hashes_done, struct thr_info *mythr )
|
||||
{
|
||||
uint32_t hash[8*4] __attribute__ ((aligned (64)));
|
||||
uint32_t edata[20] __attribute__ ((aligned (64)));
|
||||
uint32_t hash[16*4] __attribute__ ((aligned (64)));
|
||||
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
|
||||
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
||||
uint32_t *hash7 = &(hash[25]);
|
||||
@@ -34,20 +33,10 @@ int scanhash_skein2_4way( struct work *work, uint32_t max_nonce,
|
||||
uint32_t n = first_nonce;
|
||||
__m256i *noncev = (__m256i*)vdata + 9; // aligned
|
||||
int thr_id = mythr->id; // thr_id arg is deprecated
|
||||
// uint32_t *noncep = vdata + 73; // 9*8 + 1
|
||||
|
||||
|
||||
swab32_array( edata, pdata, 20 );
|
||||
mm256_intrlv_4x64( vdata, edata, edata, edata, edata, 640 );
|
||||
|
||||
// mm256_bswap_intrlv80_4x64( vdata, pdata );
|
||||
mm256_bswap32_intrlv80_4x64( vdata, pdata );
|
||||
do
|
||||
{
|
||||
// be32enc( noncep, n );
|
||||
// be32enc( noncep+2, n+1 );
|
||||
// be32enc( noncep+4, n+2 );
|
||||
// be32enc( noncep+6, n+3 );
|
||||
|
||||
*noncev = mm256_intrlv_blend_32( mm256_bswap_32(
|
||||
_mm256_set_epi32( n+3, 0, n+2, 0, n+1, 0, n, 0 ) ), *noncev );
|
||||
|
||||
@@ -56,7 +45,7 @@ int scanhash_skein2_4way( struct work *work, uint32_t max_nonce,
|
||||
for ( int lane = 0; lane < 4; lane++ )
|
||||
if ( hash7[ lane<<1 ] <= Htarg )
|
||||
{
|
||||
mm256_extr_lane_4x64( lane_hash, hash, lane, 256 );
|
||||
extr_lane_4x64( lane_hash, hash, lane, 256 );
|
||||
if ( fulltest( lane_hash, ptarget ) && !opt_benchmark )
|
||||
{
|
||||
pdata[19] = n + lane;
|
||||
|
||||
Reference in New Issue
Block a user