This commit is contained in:
Jay D Dee
2023-03-11 14:54:49 -05:00
parent fb93160641
commit b339450898
49 changed files with 1120 additions and 1119 deletions

View File

@@ -5,9 +5,17 @@
#if defined(SKEIN_8WAY)
static __thread skein512_8way_context skein512_8way_ctx
__attribute__ ((aligned (64)));
static skein512_8way_context skein512_8way_ctx __attribute__ ((aligned (64)));
static uint32_t skein2_8way_vdata[20*8] __attribute__ ((aligned (64)));
int skein2_8way_prehash( struct work *work )
{
mm512_bswap32_intrlv80_8x64( skein2_8way_vdata, work->data );
skein512_8way_prehash64( &skein512_8way_ctx, skein2_8way_vdata );
return 1;
}
/* not used
void skein2hash_8way( void *output, const void *input )
{
uint64_t hash[16*8] __attribute__ ((aligned (128)));
@@ -17,6 +25,7 @@ void skein2hash_8way( void *output, const void *input )
skein512_8way_final16( &ctx, hash, input + (64*8) );
skein512_8way_full( &ctx, output, hash, 64 );
}
*/
int scanhash_skein2_8way( struct work *work, uint32_t max_nonce,
uint64_t *hashes_done, struct thr_info *mythr )
@@ -36,11 +45,14 @@ int scanhash_skein2_8way( struct work *work, uint32_t max_nonce,
const bool bench = opt_benchmark;
skein512_8way_context ctx;
mm512_bswap32_intrlv80_8x64( vdata, pdata );
pthread_rwlock_rdlock( &g_work_lock );
memcpy( vdata, skein2_8way_vdata, sizeof vdata );
memcpy( &ctx, &skein512_8way_ctx, sizeof ctx );
pthread_rwlock_unlock( &g_work_lock );
*noncev = mm512_intrlv_blend_32(
_mm512_set_epi32( n+7, 0, n+6, 0, n+5, 0, n+4, 0,
n+3, 0, n+2, 0, n+1, 0, n , 0 ), *noncev );
skein512_8way_prehash64( &ctx, vdata );
do
{
skein512_8way_final16( &ctx, hash, vdata + (16*8) );
@@ -67,10 +79,18 @@ int scanhash_skein2_8way( struct work *work, uint32_t max_nonce,
}
#elif defined(SKEIN_4WAY)
static skein512_4way_context skein512_4way_ctx __attribute__ ((aligned (64)));
static uint32_t skein2_4way_vdata[20*4] __attribute__ ((aligned (64)));
int skein2_4way_prehash( struct work *work )
{
mm256_bswap32_intrlv80_4x64( skein2_4way_vdata, work->data );
skein512_4way_prehash64( &skein512_4way_ctx, skein2_4way_vdata );
return 1;
}
static __thread skein512_4way_context skein512_4way_ctx
__attribute__ ((aligned (64)));
/* not used
void skein2hash_4way( void *output, const void *input )
{
skein512_4way_context ctx;
@@ -80,6 +100,7 @@ void skein2hash_4way( void *output, const void *input )
skein512_4way_final16( &ctx, hash, input + (64*4) );
skein512_4way_full( &ctx, output, hash, 64 );
}
*/
int scanhash_skein2_4way( struct work *work, uint32_t max_nonce,
uint64_t *hashes_done, struct thr_info *mythr )
@@ -99,8 +120,11 @@ int scanhash_skein2_4way( struct work *work, uint32_t max_nonce,
const bool bench = opt_benchmark;
skein512_4way_context ctx;
mm256_bswap32_intrlv80_4x64( vdata, pdata );
skein512_4way_prehash64( &ctx, vdata );
pthread_rwlock_rdlock( &g_work_lock );
memcpy( vdata, skein2_4way_vdata, sizeof vdata );
memcpy( &ctx, &skein512_4way_ctx, sizeof ctx );
pthread_rwlock_unlock( &g_work_lock );
*noncev = mm256_intrlv_blend_32(
_mm256_set_epi32( n+3, 0, n+2, 0, n+1, 0, n, 0 ), *noncev );
do