mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.12.1
This commit is contained in:
@@ -65,6 +65,13 @@ If not what makes it happen or not happen?
|
|||||||
Change Log
|
Change Log
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
v3.12.1
|
||||||
|
|
||||||
|
Fixed anime AVX2 low difficulty shares, git issue #236.
|
||||||
|
|
||||||
|
Periodic summary now reports lost hash rate due to rejected and stale shares,
|
||||||
|
displayed only when non-zero.
|
||||||
|
|
||||||
v3.12.0.1
|
v3.12.0.1
|
||||||
|
|
||||||
Fixed hodl rejects, git issue #237.
|
Fixed hodl rejects, git issue #237.
|
||||||
|
|||||||
@@ -76,37 +76,34 @@ int scanhash_allium( struct work *work, uint32_t max_nonce,
|
|||||||
uint64_t *hashes_done, struct thr_info *mythr )
|
uint64_t *hashes_done, struct thr_info *mythr )
|
||||||
{
|
{
|
||||||
uint32_t _ALIGN(128) hash[8];
|
uint32_t _ALIGN(128) hash[8];
|
||||||
uint32_t _ALIGN(128) endiandata[20];
|
uint32_t _ALIGN(128) edata[20];
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
uint32_t *ptarget = work->target;
|
uint32_t *ptarget = work->target;
|
||||||
|
|
||||||
const uint32_t Htarg = ptarget[7];
|
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
uint32_t nonce = first_nonce;
|
uint32_t nonce = first_nonce;
|
||||||
int thr_id = mythr->id; // thr_id arg is deprecated
|
const int thr_id = mythr->id;
|
||||||
|
|
||||||
if ( opt_benchmark )
|
if ( opt_benchmark )
|
||||||
ptarget[7] = 0x3ffff;
|
ptarget[7] = 0x3ffff;
|
||||||
|
|
||||||
for ( int i = 0; i < 19; i++ )
|
for ( int i = 0; i < 19; i++ )
|
||||||
be32enc( &endiandata[i], pdata[i] );
|
edata[i] = bswap_32( pdata[i] );
|
||||||
|
|
||||||
sph_blake256_init( &allium_ctx.blake );
|
sph_blake256_init( &allium_ctx.blake );
|
||||||
sph_blake256( &allium_ctx.blake, endiandata, 64 );
|
sph_blake256( &allium_ctx.blake, edata, 64 );
|
||||||
|
|
||||||
do {
|
do {
|
||||||
be32enc( &endiandata[19], nonce );
|
edata[19] = nonce;
|
||||||
allium_hash( hash, endiandata );
|
allium_hash( hash, edata );
|
||||||
if ( hash[7] <= Htarg )
|
if ( valid_hash( hash, ptarget ) && !opt_benchmark )
|
||||||
if ( fulltest( hash, ptarget ) && !opt_benchmark )
|
|
||||||
{
|
{
|
||||||
pdata[19] = nonce;
|
pdata[19] = bswap_32( nonce );
|
||||||
submit_solution( work, hash, mythr );
|
submit_solution( work, hash, mythr );
|
||||||
}
|
}
|
||||||
nonce++;
|
nonce++;
|
||||||
} while ( nonce < max_nonce && !work_restart[thr_id].restart );
|
} while ( nonce < max_nonce && !work_restart[thr_id].restart );
|
||||||
pdata[19] = nonce;
|
pdata[19] = nonce;
|
||||||
*hashes_done = pdata[19] - first_nonce + 1;
|
*hashes_done = pdata[19] - first_nonce;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,15 +130,15 @@ int scanhash_lyra2rev3_16way( struct work *work, const uint32_t max_nonce,
|
|||||||
{
|
{
|
||||||
uint32_t hash[8*16] __attribute__ ((aligned (128)));
|
uint32_t hash[8*16] __attribute__ ((aligned (128)));
|
||||||
uint32_t vdata[20*16] __attribute__ ((aligned (64)));
|
uint32_t vdata[20*16] __attribute__ ((aligned (64)));
|
||||||
uint32_t *hash7 = &hash[7<<4];
|
uint32_t *hash32 = &hash[7*16];
|
||||||
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
const uint32_t *ptarget = work->target;
|
const uint32_t *ptarget = work->target;
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
uint32_t n = first_nonce;
|
uint32_t n = first_nonce;
|
||||||
const uint32_t last_nonce = max_nonce - 16;
|
const uint32_t last_nonce = max_nonce - 16;
|
||||||
const uint32_t Htarg = ptarget[7];
|
const uint32_t targ32 = ptarget[7];
|
||||||
__m512i *noncev = (__m512i*)vdata + 19; // aligned
|
__m512i *noncev = (__m512i*)vdata + 19;
|
||||||
const int thr_id = mythr->id;
|
const int thr_id = mythr->id;
|
||||||
|
|
||||||
if ( opt_benchmark ) ( (uint32_t*)ptarget )[7] = 0x0000ff;
|
if ( opt_benchmark ) ( (uint32_t*)ptarget )[7] = 0x0000ff;
|
||||||
@@ -159,7 +159,7 @@ int scanhash_lyra2rev3_16way( struct work *work, const uint32_t max_nonce,
|
|||||||
pdata[19] = n;
|
pdata[19] = n;
|
||||||
|
|
||||||
for ( int lane = 0; lane < 16; lane++ )
|
for ( int lane = 0; lane < 16; lane++ )
|
||||||
if ( unlikely( hash7[lane] <= Htarg ) )
|
if ( unlikely( hash32[lane] <= targ32 ) )
|
||||||
{
|
{
|
||||||
extr_lane_16x32( lane_hash, hash, lane, 256 );
|
extr_lane_16x32( lane_hash, hash, lane, 256 );
|
||||||
if ( likely( fulltest( lane_hash, ptarget ) && !opt_benchmark ) )
|
if ( likely( fulltest( lane_hash, ptarget ) && !opt_benchmark ) )
|
||||||
@@ -252,15 +252,15 @@ int scanhash_lyra2rev3_8way( struct work *work, const uint32_t max_nonce,
|
|||||||
{
|
{
|
||||||
uint32_t hash[8*8] __attribute__ ((aligned (64)));
|
uint32_t hash[8*8] __attribute__ ((aligned (64)));
|
||||||
uint32_t vdata[20*8] __attribute__ ((aligned (64)));
|
uint32_t vdata[20*8] __attribute__ ((aligned (64)));
|
||||||
uint32_t *hash7 = &hash[7<<3];
|
uint32_t *hash32 = &hash[7*8];
|
||||||
uint32_t lane_hash[8] __attribute__ ((aligned (32)));
|
uint32_t lane_hash[8] __attribute__ ((aligned (32)));
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
uint32_t *ptarget = work->target;
|
uint32_t *ptarget = work->target;
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
const uint32_t last_nonce = max_nonce - 8;
|
const uint32_t last_nonce = max_nonce - 8;
|
||||||
uint32_t n = first_nonce;
|
uint32_t n = first_nonce;
|
||||||
const uint32_t Htarg = ptarget[7];
|
const uint32_t targ32 = ptarget[7];
|
||||||
__m256i *noncev = (__m256i*)vdata + 19; // aligned
|
__m256i *noncev = (__m256i*)vdata + 19;
|
||||||
const int thr_id = mythr->id;
|
const int thr_id = mythr->id;
|
||||||
const bool bench = opt_benchmark;
|
const bool bench = opt_benchmark;
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ int scanhash_lyra2rev3_8way( struct work *work, const uint32_t max_nonce,
|
|||||||
pdata[19] = n;
|
pdata[19] = n;
|
||||||
|
|
||||||
for ( int lane = 0; lane < 8; lane++ )
|
for ( int lane = 0; lane < 8; lane++ )
|
||||||
if ( unlikely( hash7[lane] <= Htarg ) )
|
if ( unlikely( hash32[lane] <= targ32 ) )
|
||||||
{
|
{
|
||||||
extr_lane_8x32( lane_hash, hash, lane, 256 );
|
extr_lane_8x32( lane_hash, hash, lane, 256 );
|
||||||
if ( likely( valid_hash( lane_hash, ptarget ) && !bench ) )
|
if ( likely( valid_hash( lane_hash, ptarget ) && !bench ) )
|
||||||
@@ -357,40 +357,38 @@ int scanhash_lyra2rev3_4way( struct work *work, const uint32_t max_nonce,
|
|||||||
{
|
{
|
||||||
uint32_t hash[8*4] __attribute__ ((aligned (64)));
|
uint32_t hash[8*4] __attribute__ ((aligned (64)));
|
||||||
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
|
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
|
||||||
uint32_t *hash7 = &(hash[7<<2]);
|
uint32_t *hash32 = &(hash[7*4]);
|
||||||
uint32_t lane_hash[8] __attribute__ ((aligned (32)));
|
uint32_t lane_hash[8] __attribute__ ((aligned (32)));
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
const uint32_t *ptarget = work->target;
|
const uint32_t *ptarget = work->target;
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
uint32_t n = first_nonce;
|
uint32_t n = first_nonce;
|
||||||
const uint32_t Htarg = ptarget[7];
|
const uint32_t targ32 = ptarget[7];
|
||||||
__m128i *noncev = (__m128i*)vdata + 19; // aligned
|
__m128i *noncev = (__m128i*)vdata + 19;
|
||||||
const int thr_id = mythr->id; // thr_id arg is deprecated
|
const int thr_id = mythr->id;
|
||||||
|
|
||||||
if ( opt_benchmark )
|
if ( opt_benchmark )
|
||||||
( (uint32_t*)ptarget )[7] = 0x0000ff;
|
( (uint32_t*)ptarget )[7] = 0x0000ff;
|
||||||
|
|
||||||
mm128_bswap32_intrlv80_4x32( vdata, pdata );
|
mm128_bswap32_intrlv80_4x32( vdata, pdata );
|
||||||
|
*noncev = _mm_set_epi32( n+3, n+2, n+1, n );
|
||||||
|
|
||||||
blake256_4way_init( &l2v3_4way_ctx.blake );
|
blake256_4way_init( &l2v3_4way_ctx.blake );
|
||||||
blake256_4way_update( &l2v3_4way_ctx.blake, vdata, 64 );
|
blake256_4way_update( &l2v3_4way_ctx.blake, vdata, 64 );
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
*noncev = mm128_bswap_32( _mm_set_epi32( n+3, n+2, n+1, n ) );
|
|
||||||
|
|
||||||
lyra2rev3_4way_hash( hash, vdata );
|
lyra2rev3_4way_hash( hash, vdata );
|
||||||
pdata[19] = n;
|
for ( int lane = 0; lane < 4; lane++ ) if ( hash32[lane] <= targ32 )
|
||||||
|
|
||||||
for ( int lane = 0; lane < 4; lane++ ) if ( hash7[lane] <= Htarg )
|
|
||||||
{
|
{
|
||||||
extr_lane_4x32( lane_hash, hash, lane, 256 );
|
extr_lane_4x32( lane_hash, hash, lane, 256 );
|
||||||
if ( fulltest( lane_hash, ptarget ) && !opt_benchmark )
|
if ( valid_hash( lane_hash, ptarget ) && !opt_benchmark )
|
||||||
{
|
{
|
||||||
pdata[19] = n + lane;
|
pdata[19] = bswap_32( n + lane );
|
||||||
submit_lane_solution( work, lane_hash, mythr, lane );
|
submit_lane_solution( work, lane_hash, mythr, lane );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*noncev = _mm_add_epi32( *noncev, m128_const1_32( 4 ) );
|
||||||
n += 4;
|
n += 4;
|
||||||
} while ( (n < max_nonce-4) && !work_restart[thr_id].restart);
|
} while ( (n < max_nonce-4) && !work_restart[thr_id].restart);
|
||||||
*hashes_done = n - first_nonce + 1;
|
*hashes_done = n - first_nonce + 1;
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ void anime_4way_hash( void *state, const void *input )
|
|||||||
|
|
||||||
intrlv_4x64( vhashA, hash0, hash1, hash2, hash3, 512 );
|
intrlv_4x64( vhashA, hash0, hash1, hash2, hash3, 512 );
|
||||||
|
|
||||||
if ( mm256_anybits0( vh_mask ) )
|
if ( mm256_anybits1( vh_mask ) )
|
||||||
{
|
{
|
||||||
skein512_4way_update( &ctx.skein, vhash, 64 );
|
skein512_4way_update( &ctx.skein, vhash, 64 );
|
||||||
skein512_4way_close( &ctx.skein, vhashB );
|
skein512_4way_close( &ctx.skein, vhashB );
|
||||||
@@ -116,13 +116,13 @@ void anime_4way_hash( void *state, const void *input )
|
|||||||
|
|
||||||
vh_mask = _mm256_cmpeq_epi64( _mm256_and_si256( vh[0], bit3_mask ), zero );
|
vh_mask = _mm256_cmpeq_epi64( _mm256_and_si256( vh[0], bit3_mask ), zero );
|
||||||
|
|
||||||
if ( mm256_anybits1( vh_mask ) )
|
if ( mm256_anybits0( vh_mask ) )
|
||||||
{
|
{
|
||||||
blake512_4way_init( &ctx.blake );
|
blake512_4way_init( &ctx.blake );
|
||||||
blake512_4way_update( &ctx.blake, vhash, 64 );
|
blake512_4way_update( &ctx.blake, vhash, 64 );
|
||||||
blake512_4way_close( &ctx.blake, vhashA );
|
blake512_4way_close( &ctx.blake, vhashA );
|
||||||
}
|
}
|
||||||
if ( mm256_anybits0( vh_mask ) )
|
if ( mm256_anybits1( vh_mask ) )
|
||||||
{
|
{
|
||||||
bmw512_4way_init( &ctx.bmw );
|
bmw512_4way_init( &ctx.bmw );
|
||||||
bmw512_4way_update( &ctx.bmw, vhash, 64 );
|
bmw512_4way_update( &ctx.bmw, vhash, 64 );
|
||||||
@@ -140,13 +140,13 @@ void anime_4way_hash( void *state, const void *input )
|
|||||||
|
|
||||||
vh_mask = _mm256_cmpeq_epi64( _mm256_and_si256( vh[0], bit3_mask ), zero );
|
vh_mask = _mm256_cmpeq_epi64( _mm256_and_si256( vh[0], bit3_mask ), zero );
|
||||||
|
|
||||||
if ( mm256_anybits1( vh_mask ) )
|
if ( mm256_anybits0( vh_mask ) )
|
||||||
{
|
{
|
||||||
keccak512_4way_init( &ctx.keccak );
|
keccak512_4way_init( &ctx.keccak );
|
||||||
keccak512_4way_update( &ctx.keccak, vhash, 64 );
|
keccak512_4way_update( &ctx.keccak, vhash, 64 );
|
||||||
keccak512_4way_close( &ctx.keccak, vhashA );
|
keccak512_4way_close( &ctx.keccak, vhashA );
|
||||||
}
|
}
|
||||||
if ( mm256_anybits0( vh_mask ) )
|
if ( mm256_anybits1( vh_mask ) )
|
||||||
{
|
{
|
||||||
jh512_4way_init( &ctx.jh );
|
jh512_4way_init( &ctx.jh );
|
||||||
jh512_4way_update( &ctx.jh, vhash, 64 );
|
jh512_4way_update( &ctx.jh, vhash, 64 );
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static __thread uint32_t s_ntime = UINT32_MAX;
|
static __thread uint32_t s_ntime = UINT32_MAX;
|
||||||
static __thread char hashOrder[X16R_HASH_FUNC_COUNT + 1] = { 0 };
|
|
||||||
|
|
||||||
union _x16rv2_context_overlay
|
union _x16rv2_context_overlay
|
||||||
{
|
{
|
||||||
@@ -74,16 +73,10 @@ void x16rv2_hash( void* output, const void* input )
|
|||||||
x16rv2_context_overlay ctx;
|
x16rv2_context_overlay ctx;
|
||||||
void *in = (void*) input;
|
void *in = (void*) input;
|
||||||
int size = 80;
|
int size = 80;
|
||||||
/*
|
|
||||||
if ( s_ntime == UINT32_MAX )
|
|
||||||
{
|
|
||||||
const uint8_t* in8 = (uint8_t*) input;
|
|
||||||
x16_r_s_getAlgoString( &in8[4], hashOrder );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
for ( int i = 0; i < 16; i++ )
|
for ( int i = 0; i < 16; i++ )
|
||||||
{
|
{
|
||||||
const char elem = hashOrder[i];
|
const char elem = x16r_hash_order[i];
|
||||||
const uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0';
|
const uint8_t algo = elem >= 'A' ? elem - 'A' + 10 : elem - '0';
|
||||||
|
|
||||||
switch ( algo )
|
switch ( algo )
|
||||||
@@ -203,42 +196,42 @@ int scanhash_x16rv2( struct work *work, uint32_t max_nonce,
|
|||||||
uint64_t *hashes_done, struct thr_info *mythr )
|
uint64_t *hashes_done, struct thr_info *mythr )
|
||||||
{
|
{
|
||||||
uint32_t _ALIGN(128) hash32[8];
|
uint32_t _ALIGN(128) hash32[8];
|
||||||
uint32_t _ALIGN(128) endiandata[20];
|
uint32_t _ALIGN(128) edata[20];
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
uint32_t *ptarget = work->target;
|
uint32_t *ptarget = work->target;
|
||||||
const uint32_t Htarg = ptarget[7];
|
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
int thr_id = mythr->id; // thr_id arg is deprecated
|
const int thr_id = mythr->id;
|
||||||
uint32_t nonce = first_nonce;
|
uint32_t nonce = first_nonce;
|
||||||
volatile uint8_t *restart = &(work_restart[thr_id].restart);
|
volatile uint8_t *restart = &(work_restart[thr_id].restart);
|
||||||
|
const bool bench = opt_benchmark;
|
||||||
|
|
||||||
casti_m128i( endiandata, 0 ) = mm128_bswap_32( casti_m128i( pdata, 0 ) );
|
casti_m128i( edata, 0 ) = mm128_bswap_32( casti_m128i( pdata, 0 ) );
|
||||||
casti_m128i( endiandata, 1 ) = mm128_bswap_32( casti_m128i( pdata, 1 ) );
|
casti_m128i( edata, 1 ) = mm128_bswap_32( casti_m128i( pdata, 1 ) );
|
||||||
casti_m128i( endiandata, 2 ) = mm128_bswap_32( casti_m128i( pdata, 2 ) );
|
casti_m128i( edata, 2 ) = mm128_bswap_32( casti_m128i( pdata, 2 ) );
|
||||||
casti_m128i( endiandata, 3 ) = mm128_bswap_32( casti_m128i( pdata, 3 ) );
|
casti_m128i( edata, 3 ) = mm128_bswap_32( casti_m128i( pdata, 3 ) );
|
||||||
casti_m128i( endiandata, 4 ) = mm128_bswap_32( casti_m128i( pdata, 4 ) );
|
casti_m128i( edata, 4 ) = mm128_bswap_32( casti_m128i( pdata, 4 ) );
|
||||||
|
|
||||||
|
static __thread uint32_t s_ntime = UINT32_MAX;
|
||||||
if ( s_ntime != pdata[17] )
|
if ( s_ntime != pdata[17] )
|
||||||
{
|
{
|
||||||
uint32_t ntime = swab32(pdata[17]);
|
uint32_t ntime = swab32(pdata[17]);
|
||||||
x16_r_s_getAlgoString( (const uint8_t*) (&endiandata[1]), hashOrder );
|
x16_r_s_getAlgoString( (const uint8_t*) (&edata[1]), x16r_hash_order );
|
||||||
s_ntime = ntime;
|
s_ntime = ntime;
|
||||||
if ( opt_debug && !thr_id )
|
if ( opt_debug && !thr_id )
|
||||||
applog( LOG_DEBUG, "hash order %s (%08x)", hashOrder, ntime );
|
applog( LOG_DEBUG, "hash order %s (%08x)",
|
||||||
|
x16r_hash_order, ntime );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( opt_benchmark )
|
if ( bench ) ptarget[7] = 0x0cff;
|
||||||
ptarget[7] = 0x0cff;
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
be32enc( &endiandata[19], nonce );
|
edata[19] = nonce;
|
||||||
x16rv2_hash( hash32, endiandata );
|
x16rv2_hash( hash32, edata );
|
||||||
|
|
||||||
if ( hash32[7] <= Htarg )
|
if ( unlikely( valid_hash( hash32, ptarget ) && !bench ) )
|
||||||
if (fulltest( hash32, ptarget ) && !opt_benchmark )
|
|
||||||
{
|
{
|
||||||
pdata[19] = nonce;
|
pdata[19] = bswap_32( nonce );
|
||||||
submit_solution( work, hash32, mythr );
|
submit_solution( work, hash32, mythr );
|
||||||
}
|
}
|
||||||
nonce++;
|
nonce++;
|
||||||
|
|||||||
@@ -287,10 +287,10 @@ void x17_8way_hash( void *state, const void *input )
|
|||||||
int scanhash_x17_8way( struct work *work, uint32_t max_nonce,
|
int scanhash_x17_8way( struct work *work, uint32_t max_nonce,
|
||||||
uint64_t *hashes_done, struct thr_info *mythr )
|
uint64_t *hashes_done, struct thr_info *mythr )
|
||||||
{
|
{
|
||||||
uint32_t hash[8*16] __attribute__ ((aligned (128)));
|
uint32_t hash[8*8] __attribute__ ((aligned (128)));
|
||||||
uint32_t vdata[24*8] __attribute__ ((aligned (64)));
|
uint32_t vdata[20*8] __attribute__ ((aligned (64)));
|
||||||
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
||||||
uint32_t *hash7 = &(hash[7<<3]);
|
uint32_t *hash32 = &(hash[7*8]);
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
const uint32_t *ptarget = work->target;
|
const uint32_t *ptarget = work->target;
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
@@ -298,7 +298,7 @@ int scanhash_x17_8way( struct work *work, uint32_t max_nonce,
|
|||||||
__m512i *noncev = (__m512i*)vdata + 9; // aligned
|
__m512i *noncev = (__m512i*)vdata + 9; // aligned
|
||||||
uint32_t n = first_nonce;
|
uint32_t n = first_nonce;
|
||||||
const int thr_id = mythr->id;
|
const int thr_id = mythr->id;
|
||||||
const uint32_t Htarg = ptarget[7];
|
const uint32_t targ32 = ptarget[7];
|
||||||
const bool bench = opt_benchmark;
|
const bool bench = opt_benchmark;
|
||||||
|
|
||||||
mm512_bswap32_intrlv80_8x64( vdata, pdata );
|
mm512_bswap32_intrlv80_8x64( vdata, pdata );
|
||||||
@@ -310,7 +310,7 @@ int scanhash_x17_8way( struct work *work, uint32_t max_nonce,
|
|||||||
x17_8way_hash( hash, vdata );
|
x17_8way_hash( hash, vdata );
|
||||||
|
|
||||||
for ( int lane = 0; lane < 8; lane++ )
|
for ( int lane = 0; lane < 8; lane++ )
|
||||||
if ( unlikely( ( hash7[ lane ] <= Htarg ) && !bench ) )
|
if ( unlikely( ( hash32[ lane ] <= targ32 ) && !bench ) )
|
||||||
{
|
{
|
||||||
extr_lane_8x32( lane_hash, hash, lane, 256 );
|
extr_lane_8x32( lane_hash, hash, lane, 256 );
|
||||||
if ( likely( valid_hash( lane_hash, ptarget ) ) )
|
if ( likely( valid_hash( lane_hash, ptarget ) ) )
|
||||||
@@ -474,18 +474,18 @@ void x17_4way_hash( void *state, const void *input )
|
|||||||
int scanhash_x17_4way( struct work *work, uint32_t max_nonce,
|
int scanhash_x17_4way( struct work *work, uint32_t max_nonce,
|
||||||
uint64_t *hashes_done, struct thr_info *mythr )
|
uint64_t *hashes_done, struct thr_info *mythr )
|
||||||
{
|
{
|
||||||
uint32_t hash[16*4] __attribute__ ((aligned (64)));
|
uint32_t hash[8*4] __attribute__ ((aligned (64)));
|
||||||
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
|
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
|
||||||
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
||||||
uint32_t *hash7 = &(hash[7<<2]);
|
uint32_t *hash32 = &(hash[ 7*4 ]);
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
const uint32_t *ptarget = work->target;
|
const uint32_t *ptarget = work->target;
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
const uint32_t last_nonce = max_nonce -4;
|
const uint32_t last_nonce = max_nonce - 4;
|
||||||
__m256i *noncev = (__m256i*)vdata + 9; // aligned
|
__m256i *noncev = (__m256i*)vdata + 9;
|
||||||
uint32_t n = first_nonce;
|
uint32_t n = first_nonce;
|
||||||
const int thr_id = mythr->id;
|
const int thr_id = mythr->id;
|
||||||
const uint32_t Htarg = ptarget[7];
|
const uint32_t targ32 = ptarget[7];
|
||||||
const bool bench = opt_benchmark;
|
const bool bench = opt_benchmark;
|
||||||
|
|
||||||
mm256_bswap32_intrlv80_4x64( vdata, pdata );
|
mm256_bswap32_intrlv80_4x64( vdata, pdata );
|
||||||
@@ -496,7 +496,7 @@ int scanhash_x17_4way( struct work *work, uint32_t max_nonce,
|
|||||||
x17_4way_hash( hash, vdata );
|
x17_4way_hash( hash, vdata );
|
||||||
|
|
||||||
for ( int lane = 0; lane < 4; lane++ )
|
for ( int lane = 0; lane < 4; lane++ )
|
||||||
if ( unlikely( hash7[ lane ] <= Htarg && !bench ) )
|
if ( unlikely( hash32[ lane ] <= targ32 && !bench ) )
|
||||||
{
|
{
|
||||||
extr_lane_4x32( lane_hash, hash, lane, 256 );
|
extr_lane_4x32( lane_hash, hash, lane, 256 );
|
||||||
if ( valid_hash( lane_hash, ptarget ) )
|
if ( valid_hash( lane_hash, ptarget ) )
|
||||||
|
|||||||
20
configure
vendored
20
configure
vendored
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.0.1.
|
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.1.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||||
@@ -577,8 +577,8 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='cpuminer-opt'
|
PACKAGE_NAME='cpuminer-opt'
|
||||||
PACKAGE_TARNAME='cpuminer-opt'
|
PACKAGE_TARNAME='cpuminer-opt'
|
||||||
PACKAGE_VERSION='3.12.0.1'
|
PACKAGE_VERSION='3.12.1'
|
||||||
PACKAGE_STRING='cpuminer-opt 3.12.0.1'
|
PACKAGE_STRING='cpuminer-opt 3.12.1'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
@@ -1332,7 +1332,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures cpuminer-opt 3.12.0.1 to adapt to many kinds of systems.
|
\`configure' configures cpuminer-opt 3.12.1 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1404,7 +1404,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of cpuminer-opt 3.12.0.1:";;
|
short | recursive ) echo "Configuration of cpuminer-opt 3.12.1:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@@ -1509,7 +1509,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
cpuminer-opt configure 3.12.0.1
|
cpuminer-opt configure 3.12.1
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
@@ -2012,7 +2012,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by cpuminer-opt $as_me 3.12.0.1, which was
|
It was created by cpuminer-opt $as_me 3.12.1, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@@ -2993,7 +2993,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='cpuminer-opt'
|
PACKAGE='cpuminer-opt'
|
||||||
VERSION='3.12.0.1'
|
VERSION='3.12.1'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@@ -6690,7 +6690,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by cpuminer-opt $as_me 3.12.0.1, which was
|
This file was extended by cpuminer-opt $as_me 3.12.1, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -6756,7 +6756,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
cpuminer-opt config.status 3.12.0.1
|
cpuminer-opt config.status 3.12.1
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT([cpuminer-opt], [3.12.0.1])
|
AC_INIT([cpuminer-opt], [3.12.1])
|
||||||
|
|
||||||
AC_PREREQ([2.59c])
|
AC_PREREQ([2.59c])
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
|
|||||||
51
cpu-miner.c
51
cpu-miner.c
@@ -883,8 +883,6 @@ static double norm_diff_sum = 0.;
|
|||||||
static uint32_t last_block_height = 0;
|
static uint32_t last_block_height = 0;
|
||||||
//static bool new_job = false;
|
//static bool new_job = false;
|
||||||
static double last_targetdiff = 0.;
|
static double last_targetdiff = 0.;
|
||||||
static double ref_rate_hi = 0.;
|
|
||||||
static double ref_rate_lo = 1e100;
|
|
||||||
#if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32))
|
#if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32))
|
||||||
static uint32_t hi_temp = 0;
|
static uint32_t hi_temp = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -932,7 +930,6 @@ void report_summary_log( bool force )
|
|||||||
uint64_t accepts = accept_sum; accept_sum = 0;
|
uint64_t accepts = accept_sum; accept_sum = 0;
|
||||||
uint64_t rejects = reject_sum; reject_sum = 0;
|
uint64_t rejects = reject_sum; reject_sum = 0;
|
||||||
uint64_t stales = stale_sum; stale_sum = 0;
|
uint64_t stales = stale_sum; stale_sum = 0;
|
||||||
// int latency = latency_sum; latency_sum = 0;
|
|
||||||
memcpy( &start_time, &five_min_start, sizeof start_time );
|
memcpy( &start_time, &five_min_start, sizeof start_time );
|
||||||
memcpy( &five_min_start, &now, sizeof now );
|
memcpy( &five_min_start, &now, sizeof now );
|
||||||
|
|
||||||
@@ -943,34 +940,21 @@ void report_summary_log( bool force )
|
|||||||
|
|
||||||
double share_time = (double)et.tv_sec + (double)et.tv_usec / 1e6;
|
double share_time = (double)et.tv_sec + (double)et.tv_usec / 1e6;
|
||||||
double ghrate = global_hashrate;
|
double ghrate = global_hashrate;
|
||||||
double scaled_ghrate = ghrate;
|
|
||||||
double shrate = share_time == 0. ? 0. : diff_to_hash * last_targetdiff
|
double shrate = share_time == 0. ? 0. : diff_to_hash * last_targetdiff
|
||||||
* (double)(accepts) / share_time;
|
* (double)(accepts) / share_time;
|
||||||
double sess_hrate = uptime.tv_sec == 0. ? 0. : diff_to_hash * norm_diff_sum
|
double sess_hrate = uptime.tv_sec == 0. ? 0. : diff_to_hash * norm_diff_sum
|
||||||
/ (double)uptime.tv_sec;
|
/ (double)uptime.tv_sec;
|
||||||
double scaled_shrate = shrate;
|
|
||||||
// int avg_latency = 0;
|
double submit_rate = share_time == 0. ? 0. : (double)submits*60. / share_time;
|
||||||
// double latency_pc = 0.;
|
|
||||||
double submit_rate = 0.;
|
|
||||||
char shr_units[4] = {0};
|
char shr_units[4] = {0};
|
||||||
char ghr_units[4] = {0};
|
char ghr_units[4] = {0};
|
||||||
char sess_hr_units[4] = {0};
|
char sess_hr_units[4] = {0};
|
||||||
char et_str[24];
|
char et_str[24];
|
||||||
char upt_str[24];
|
char upt_str[24];
|
||||||
|
|
||||||
// if ( submits ) avg_latency = latency / submits;
|
scale_hash_for_display( &shrate, shr_units );
|
||||||
|
scale_hash_for_display( &ghrate, ghr_units );
|
||||||
if ( share_time != 0. )
|
|
||||||
{
|
|
||||||
submit_rate = (double)submits*60. / share_time;
|
|
||||||
// latency_pc = (double)latency / (share_time * 10.);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ghrate > ref_rate_hi ) ref_rate_hi = ghrate;
|
|
||||||
if ( ghrate < ref_rate_lo ) ref_rate_lo = ghrate;
|
|
||||||
|
|
||||||
scale_hash_for_display( &scaled_shrate, shr_units );
|
|
||||||
scale_hash_for_display( &scaled_ghrate, ghr_units );
|
|
||||||
scale_hash_for_display( &sess_hrate, sess_hr_units );
|
scale_hash_for_display( &sess_hrate, sess_hr_units );
|
||||||
|
|
||||||
sprintf_et( et_str, et.tv_sec );
|
sprintf_et( et_str, et.tv_sec );
|
||||||
@@ -981,8 +965,29 @@ void report_summary_log( bool force )
|
|||||||
submit_rate, (double)submitted_share_count*60. /
|
submit_rate, (double)submitted_share_count*60. /
|
||||||
( (double)uptime.tv_sec + (double)uptime.tv_usec / 1e6 ) );
|
( (double)uptime.tv_sec + (double)uptime.tv_usec / 1e6 ) );
|
||||||
applog2( LOG_INFO, "Hash rate %7.2f%sh/s %7.2f%sh/s (%.2f%sh/s)",
|
applog2( LOG_INFO, "Hash rate %7.2f%sh/s %7.2f%sh/s (%.2f%sh/s)",
|
||||||
scaled_shrate, shr_units, sess_hrate, sess_hr_units,
|
shrate, shr_units, sess_hrate, sess_hr_units,
|
||||||
scaled_ghrate, ghr_units );
|
ghrate, ghr_units );
|
||||||
|
|
||||||
|
if ( accepted_share_count < submitted_share_count )
|
||||||
|
{
|
||||||
|
double lost_ghrate = uptime.tv_sec == 0. ? 0.
|
||||||
|
: diff_to_hash * last_targetdiff
|
||||||
|
* (double)(submitted_share_count - accepted_share_count )
|
||||||
|
/ (double)uptime.tv_sec;
|
||||||
|
|
||||||
|
double shrate = share_time == 0. ? 0. : diff_to_hash * last_targetdiff
|
||||||
|
* (double)(accepts) / share_time;
|
||||||
|
double lost_shrate = share_time == 0. ? 0.
|
||||||
|
: diff_to_hash * last_targetdiff * (double)(submits - accepts )
|
||||||
|
/ share_time;
|
||||||
|
char lshr_units[4] = {0};
|
||||||
|
char lghr_units[4] = {0};
|
||||||
|
scale_hash_for_display( &lost_shrate, lshr_units );
|
||||||
|
scale_hash_for_display( &lost_ghrate, lghr_units );
|
||||||
|
applog2( LOG_INFO, "Lost hash rate %7.2f%sh/s %7.2f%sh/s",
|
||||||
|
lost_shrate, lshr_units, lost_ghrate, lghr_units );
|
||||||
|
}
|
||||||
|
|
||||||
applog2( LOG_INFO,"Submitted %6d %6d",
|
applog2( LOG_INFO,"Submitted %6d %6d",
|
||||||
submits, submitted_share_count );
|
submits, submitted_share_count );
|
||||||
applog2( LOG_INFO,"Accepted %6d %6d",
|
applog2( LOG_INFO,"Accepted %6d %6d",
|
||||||
|
|||||||
@@ -121,12 +121,13 @@ do { \
|
|||||||
|
|
||||||
|
|
||||||
// Horizontal vector testing
|
// Horizontal vector testing
|
||||||
|
// needs a proper test, seems to be working in the code but polarity appears
|
||||||
|
// reversed.
|
||||||
#define mm256_allbits0( a ) _mm256_testz_si256( a, a )
|
#define mm256_allbits0( a ) _mm256_testz_si256( a, a )
|
||||||
#define mm256_allbits1( a ) _mm256_testc_si256( a, m256_neg1 )
|
#define mm256_allbits1( a ) _mm256_testc_si256( a, m256_neg1 )
|
||||||
//broken
|
//broken
|
||||||
//#define mm256_allbitsne( a ) _mm256_testnzc_si256( a, m256_neg1 )
|
//#define mm256_allbitsne( a ) _mm256_testnzc_si256( a, m256_neg1 )
|
||||||
#define mm256_anybits0( a ) !mm256_allbits1( a )
|
#define mm256_anybits0( a ) !mm256_allbits1( a )
|
||||||
#define mm256_anybits1( a ) !mm256_allbits0( a )
|
#define mm256_anybits1( a ) !mm256_allbits0( a )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user