Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Mar 7, 2022
1 parent b233397 commit e13b962
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 55 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Supported Algorithms
lyra2z330 Lyra2 330 rows, Zoin (ZOI)
m7m Magi (XMG)
minotaur Ringcoin (RNG)
myr-gr Myriad-Groestl
myr-gr Myriad-Groestl
neoscrypt NeoScrypt(128, 2, 1)
nist5 Nist5
pentablake Pentablake
Expand Down Expand Up @@ -157,7 +157,7 @@ Supported Algorithms
yespowerARWN Arowanacoin(ARWN)
yespowerr16 Yenten (YTN)
yespowerSUGAR Suagrchain (SUGAR)
yespowerURX UraniumX (URX)
yespowerURX UraniumX (URX)
yespower-b2b generic yespower + blake2b
zr5 Ziftr

Expand Down
74 changes: 33 additions & 41 deletions algo/x11/hash0x10-4way.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,48 +436,40 @@ void hash0x10_4way_hash( void *state, const void *input )
int scanhash_hash0x10_4way( struct work *work, uint32_t max_nonce,
uint64_t *hashes_done, struct thr_info *mythr )
{
uint32_t hash[4*8] __attribute__ ((aligned (64)));
uint32_t vdata[24*4] __attribute__ ((aligned (64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19];
const uint32_t first_nonce = pdata[19];
int thr_id = mythr->id; // thr_id arg is deprecated
__m256i *noncev = (__m256i*)vdata + 9; // aligned
const uint32_t Htarg = ptarget[7];
uint64_t htmax[] = { 0, 0xF, 0xFF,
0xFFF, 0xFFFF, hash0x10000000 };
uint32_t masks[] = { 0xFFFFFFFF, 0xFFFFFFF0, 0xFFFFFF00,
0xFFFFF000, 0xFFFF0000, 0 };

mm256_bswap32_intrlv80_4x64( vdata, pdata );

for (int m=0; m < 6; m++)
if (Htarg <= htmax[m])
{
uint32_t mask = masks[m];
do
{
*noncev = mm256_intrlv_blend_32( mm256_bswap_32(
_mm256_set_epi32( n+3, 0, n+2, 0, n+1, 0, n, 0 ) ), *noncev );

hash0x10_4way_hash( hash, vdata );
pdata[19] = n;

for ( int i = 0; i < 4; i++ )
if ( ( ( (hash+(i<<3))[7] & mask ) == 0 )
&& fulltest( hash+(i<<3), ptarget ) && !opt_benchmark )
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;
const uint32_t first_nonce = pdata[19];
int thr_id = mythr->id;
const uint32_t Htarg = ptarget[7];
uint64_t htmax[] = { 0, 0xF, 0xFF, 0xFFF,0xFFFF, 0x10000000 };
uint32_t masks[] = { 0xFFFFFFFF, 0xFFFFFFF0, 0xFFFFFF00, 0xFFFFF000, 0xFFFF0000, 0 };

// big endian encode 0..18 uint32_t, 64 bits at a time
swab32_array( endiandata, pdata, 20 );

for (int m=0; m < 6; m++)
if (Htarg <= htmax[m])
{
uint32_t mask = masks[m];
do
{
pdata[19] = n+i;
submit_solution( work, hash+(i<<3), mythr );
}
n += 4;
} while ( ( n < max_nonce ) && !work_restart[thr_id].restart );
break;
}

*hashes_done = n - first_nonce + 1;
return 0;
pdata[19] = ++n;
be32enc( &endiandata[19], n );
hash0x10_4way_hash( hash64, &endiandata );
if ( ( hash64[7] & mask ) == 0 )
{
if ( fulltest( hash64, ptarget ) )
submit_solution( work, hash64, mythr );
}
} while ( n < max_nonce && !work_restart[thr_id].restart );
}

*hashes_done = n - first_nonce + 1;
pdata[19] = n;
return 0;
}

#endif
16 changes: 5 additions & 11 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ double opt_diff_factor = 1.0;
double opt_target_factor = 1.0;
uint32_t zr5_pok = 0;
bool opt_stratum_stats = false;
bool opt_hash_meter = false;
uint32_t submitted_share_count= 0;
uint32_t accepted_share_count = 0;
uint32_t rejected_share_count = 0;
Expand Down Expand Up @@ -2429,14 +2428,12 @@ static void *miner_thread( void *userdata )
}

// display hashrate
if ( unlikely( opt_hash_meter ) )
if (!opt_quiet)
{
char hr[16];
char hr_units[2] = {0,0};
double hashrate;

hashrate = thr_hashrates[thr_id];
if ( hashrate != 0. )
double hashrate = thr_hashrates[thr_id];
if ( hashrate )
{
scale_hash_for_display( &hashrate, hr_units );
sprintf( hr, "%.2f", hashrate );
Expand All @@ -2447,8 +2444,8 @@ static void *miner_thread( void *userdata )

// Display benchmark total
// Update hashrate for API if no shares accepted yet.
if ( unlikely( ( opt_benchmark || !accepted_share_count )
&& thr_id == opt_n_threads - 1 ) )
if ( ( opt_benchmark || !accepted_share_count )
&& thr_id == opt_n_threads - 1 )
{
double hashrate = 0.;
pthread_mutex_lock( &stats_lock );
Expand Down Expand Up @@ -3442,9 +3439,6 @@ void parse_arg(int key, char *arg )
case 1012: // no-extranonce
opt_extranonce = false;
break;
case 1014: // hash-meter
opt_hash_meter = true;
break;
case 1016: /* --coinbase-addr */
if ( arg ) coinbase_address = strdup( arg );
break;
Expand Down
1 change: 0 additions & 1 deletion miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,6 @@ extern bool opt_stratum_stats;
extern int num_cpus;
extern int num_cpugroups;
extern int opt_priority;
extern bool opt_hash_meter;
extern uint32_t accepted_share_count;
extern uint32_t rejected_share_count;
extern uint32_t solved_block_count;
Expand Down

0 comments on commit e13b962

Please sign in to comment.