@@ -251,20 +251,20 @@ bool minethd::self_test()
251
251
cn_hash_fun hashf;
252
252
cn_hash_fun_dbl hashdf;
253
253
254
- hashf = func_selector (jconf::inst ()->HaveHardwareAes (), false , jconf::inst ()-> HaveMulx () );
254
+ hashf = func_selector (jconf::inst ()->HaveHardwareAes (), false );
255
255
hashf (" This is a test" , 14 , out, ctx0);
256
256
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 ;
257
257
258
- hashf = func_selector (jconf::inst ()->HaveHardwareAes (), true , jconf::inst ()-> HaveMulx () );
258
+ hashf = func_selector (jconf::inst ()->HaveHardwareAes (), true );
259
259
hashf (" This is a test" , 14 , out, ctx0);
260
260
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 ;
261
261
262
- hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), false , jconf::inst ()-> HaveMulx () );
262
+ hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), false );
263
263
hashdf (" The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy log" , 43 , out, ctx0, ctx1);
264
264
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 "
265
265
" \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 ;
266
266
267
- hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), true , jconf::inst ()-> HaveMulx () );
267
+ hashdf = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), true );
268
268
hashdf (" The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy log" , 43 , out, ctx0, ctx1);
269
269
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 "
270
270
" \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()
338
338
iConsumeCnt++;
339
339
}
340
340
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)
342
342
{
343
- // We have three independent flag bits in the functions
343
+ // We have two independent flag bits in the functions
344
344
// 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 >
357
353
};
358
354
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);
363
358
364
359
return func_table[digit.to_ulong ()];
365
360
}
@@ -373,7 +368,7 @@ void minethd::work_main()
373
368
uint32_t * piNonce;
374
369
job_result result;
375
370
376
- hash_fun = func_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch, jconf::inst ()-> HaveMulx () );
371
+ hash_fun = func_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch);
377
372
ctx = minethd_alloc_ctx ();
378
373
379
374
piHashVal = (uint64_t *)(result.bResult + 24 );
@@ -430,28 +425,23 @@ void minethd::work_main()
430
425
cryptonight_free_ctx (ctx);
431
426
}
432
427
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)
434
429
{
435
- // We have three independent flag bits in the functions
430
+ // We have two independent flag bits in the functions
436
431
// 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 >
449
440
};
450
441
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);
455
445
456
446
return func_table[digit.to_ulong ()];
457
447
}
@@ -469,7 +459,7 @@ void minethd::double_work_main()
469
459
uint32_t iNonce;
470
460
job_result res;
471
461
472
- hash_fun = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch, jconf::inst ()-> HaveMulx () );
462
+ hash_fun = func_dbl_selector (jconf::inst ()->HaveHardwareAes (), bNoPrefetch);
473
463
ctx0 = minethd_alloc_ctx ();
474
464
ctx1 = minethd_alloc_ctx ();
475
465
0 commit comments