@@ -251,20 +251,20 @@ bool minethd::self_test()
251251 cn_hash_fun hashf;
252252 cn_hash_fun_dbl hashdf;
253253
254- hashf = func_selector (jconf::inst ()->HaveHardwareAes (), false , jconf::inst ()-> HaveMulx () );
254+ hashf = func_selector (jconf::inst ()->HaveHardwareAes (), false );
255255 hashf (" This is a test" , 14 , out, ctx0);
256256 bResult = memcmp (out, " \xa0\x84\xf0\x1d\x14\x37\xa0\x9c\x69\x85\x40\x1b\x60\xd4\x35\x54\xae\x10\x58\x02\xc5\xf5\xd8\xa9\xb3\x25\x36\x49\xc0\xbe\x66\x05 " , 32 ) == 0 ;
257257
258- hashf = func_selector (jconf::inst ()->HaveHardwareAes (), true , jconf::inst ()-> HaveMulx () );
258+ hashf = func_selector (jconf::inst ()->HaveHardwareAes (), true );
259259 hashf (" This is a test" , 14 , out, ctx0);
260260 bResult &= memcmp (out, " \xa0\x84\xf0\x1d\x14\x37\xa0\x9c\x69\x85\x40\x1b\x60\xd4\x35\x54\xae\x10\x58\x02\xc5\xf5\xd8\xa9\xb3\x25\x36\x49\xc0\xbe\x66\x05 " , 32 ) == 0 ;
261261
262- hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), false , jconf::inst ()-> HaveMulx () );
262+ hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), false );
263263 hashdf (" The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy log" , 43 , out, ctx0, ctx1);
264264 bResult &= memcmp (out, " \x3e\xbb\x7f\x9f\x7d\x27\x3d\x7c\x31\x8d\x86\x94\x77\x55\x0c\xc8\x00\xcf\xb1\x1b\x0c\xad\xb7\xff\xbd\xf6\xf8\x9f\x3a\x47\x1c\x59 "
265265 " \xb4\x77\xd5\x02\xe4\xd8\x48\x7f\x42\xdf\xe3\x8e\xed\x73\x81\x7a\xda\x91\xb7\xe2\x63\xd2\x91\x71\xb6\x5c\x44\x3a\x01\x2a\x41\x22 " , 64 ) == 0 ;
266266
267- hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), true , jconf::inst ()-> HaveMulx () );
267+ hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), true );
268268 hashdf (" The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy log" , 43 , out, ctx0, ctx1);
269269 bResult &= memcmp (out, " \x3e\xbb\x7f\x9f\x7d\x27\x3d\x7c\x31\x8d\x86\x94\x77\x55\x0c\xc8\x00\xcf\xb1\x1b\x0c\xad\xb7\xff\xbd\xf6\xf8\x9f\x3a\x47\x1c\x59 "
270270 " \xb4\x77\xd5\x02\xe4\xd8\x48\x7f\x42\xdf\xe3\x8e\xed\x73\x81\x7a\xda\x91\xb7\xe2\x63\xd2\x91\x71\xb6\x5c\x44\x3a\x01\x2a\x41\x22 " , 64 ) == 0 ;
@@ -338,28 +338,23 @@ void minethd::consume_work()
338338 iConsumeCnt++;
339339}
340340
341- minethd::cn_hash_fun minethd::func_selector (bool bHaveAes, bool bNoPrefetch, bool bMulx )
341+ minethd::cn_hash_fun minethd::func_selector (bool bHaveAes, bool bNoPrefetch)
342342{
343- // We have three independent flag bits in the functions
343+ // We have two independent flag bits in the functions
344344 // therefore we will build a binary digit and select the
345- // function as a three digit binary
346- // Digit order SOFT_AES, NO_PREFETCH, MULX
347-
348- static const cn_hash_fun func_table[8 ] = {
349- cryptonight_hash<0x80000 , MEMORY, false , false , false >,
350- cryptonight_hash<0x80000 , MEMORY, false , false , true >,
351- cryptonight_hash<0x80000 , MEMORY, false , true , false >,
352- cryptonight_hash<0x80000 , MEMORY, false , true , true >,
353- cryptonight_hash<0x80000 , MEMORY, true , false , false >,
354- cryptonight_hash<0x80000 , MEMORY, true , false , true >,
355- cryptonight_hash<0x80000 , MEMORY, true , true , false >,
356- cryptonight_hash<0x80000 , MEMORY, true , true , true >
345+ // function as a two digit binary
346+ // Digit order SOFT_AES, NO_PREFETCH
347+
348+ static const cn_hash_fun func_table[4 ] = {
349+ cryptonight_hash<0x80000 , MEMORY, false , false >,
350+ cryptonight_hash<0x80000 , MEMORY, false , true >,
351+ cryptonight_hash<0x80000 , MEMORY, true , false >,
352+ cryptonight_hash<0x80000 , MEMORY, true , true >
357353 };
358354
359- std::bitset<3 > digit;
360- digit.set (0 , bMulx);
361- digit.set (1 , !bNoPrefetch);
362- digit.set (2 , !bHaveAes);
355+ std::bitset<2 > digit;
356+ digit.set (0 , !bNoPrefetch);
357+ digit.set (1 , !bHaveAes);
363358
364359 return func_table[digit.to_ulong ()];
365360}
@@ -373,7 +368,7 @@ void minethd::work_main()
373368 uint32_t * piNonce;
374369 job_result result;
375370
376- hash_fun = func_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch, jconf::inst ()-> HaveMulx () );
371+ hash_fun = func_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch);
377372 ctx = minethd_alloc_ctx ();
378373
379374 piHashVal = (uint64_t *)(result.bResult + 24 );
@@ -430,28 +425,23 @@ void minethd::work_main()
430425 cryptonight_free_ctx (ctx);
431426}
432427
433- minethd::cn_hash_fun_dbl minethd::func_dbl_selector (bool bHaveAes, bool bNoPrefetch, bool bMulx )
428+ minethd::cn_hash_fun_dbl minethd::func_dbl_selector (bool bHaveAes, bool bNoPrefetch)
434429{
435- // We have three independent flag bits in the functions
430+ // We have two independent flag bits in the functions
436431 // therefore we will build a binary digit and select the
437- // function as a three digit binary
438- // Digit order SOFT_AES, NO_PREFETCH, MULX
439-
440- static const cn_hash_fun_dbl func_table[8 ] = {
441- cryptonight_double_hash<0x80000 , MEMORY, false , false , false >,
442- cryptonight_double_hash<0x80000 , MEMORY, false , false , true >,
443- cryptonight_double_hash<0x80000 , MEMORY, false , true , false >,
444- cryptonight_double_hash<0x80000 , MEMORY, false , true , true >,
445- cryptonight_double_hash<0x80000 , MEMORY, true , false , false >,
446- cryptonight_double_hash<0x80000 , MEMORY, true , false , true >,
447- cryptonight_double_hash<0x80000 , MEMORY, true , true , false >,
448- cryptonight_double_hash<0x80000 , MEMORY, true , true , true >
432+ // function as a two digit binary
433+ // Digit order SOFT_AES, NO_PREFETCH
434+
435+ static const cn_hash_fun_dbl func_table[4 ] = {
436+ cryptonight_double_hash<0x80000 , MEMORY, false , false >,
437+ cryptonight_double_hash<0x80000 , MEMORY, false , true >,
438+ cryptonight_double_hash<0x80000 , MEMORY, true , false >,
439+ cryptonight_double_hash<0x80000 , MEMORY, true , true >
449440 };
450441
451- std::bitset<3 > digit;
452- digit.set (0 , bMulx);
453- digit.set (1 , !bNoPrefetch);
454- digit.set (2 , !bHaveAes);
442+ std::bitset<2 > digit;
443+ digit.set (0 , !bNoPrefetch);
444+ digit.set (1 , !bHaveAes);
455445
456446 return func_table[digit.to_ulong ()];
457447}
@@ -469,7 +459,7 @@ void minethd::double_work_main()
469459 uint32_t iNonce;
470460 job_result res;
471461
472- hash_fun = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch, jconf::inst ()-> HaveMulx () );
462+ hash_fun = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch);
473463 ctx0 = minethd_alloc_ctx ();
474464 ctx1 = minethd_alloc_ctx ();
475465
0 commit comments