This issue is opened to document architectural changes that require changes to the scanhash
function of each algo. These changes may not have been propagated to all algl algos for various
reasons.
The reason for most of the changes is to streamline the code by reducing instructions.
Sale share reduction is the goal of one change, and the generic scanhash will reduce the
work of propagating other changes
- defining a series of generic scanhash functions that can be used by multiple algos to replace their
individual custom scanhash functions for specific cases:
- one way linear hashing
- N way hashing for each N (4, 8, 16) and the format of the hash to be tested: 64 bit interleaved,
32 bit interleaved, or de-interleaved.
The remaining scanhash changes are automatically implemented for algos that can use a
generic scanhash function.
-
vectored byte swap and interleaving of input data, for various N ways, for 32 and 64 bit data.
-
byte-swap the nonce only when necessary, when a valid share is found, instead of
byte-swapping every nonce tested.
-
implement new hash for test including pre-test before de-interleaving N way hash.
-
submit shares in scanhash loop then continue hashing instead of returning to the main thread
loop to submit shares.
-
thread id argument added to hash call to enable restart flag checking.
There are also changes to the hash functions of each algo:
-
use union overlay instead of struct for the context holder for algos that use a lot of contexts,
-
implement midstate prehash when first function use a block size of 64 bytes or less,
-
use full versions of chained hash functions instead of the 3 step init, update & close,
-
write final hash directly to output buffer instead of using an intermediate buffer and memcpy,
-
implement intermediate stale work detection for low hash rate algos to reduce stale shares.
-
use rintrlv instead of 2 step dintrlv, intrlv when interleaved data needs to be interleaved in a
different format.
-
ensure hash function returns a default 1 if thread restart checking is not used.
This issue is opened to document architectural changes that require changes to the scanhash
function of each algo. These changes may not have been propagated to all algl algos for various
reasons.
The reason for most of the changes is to streamline the code by reducing instructions.
Sale share reduction is the goal of one change, and the generic scanhash will reduce the
work of propagating other changes
individual custom scanhash functions for specific cases:
32 bit interleaved, or de-interleaved.
The remaining scanhash changes are automatically implemented for algos that can use a
generic scanhash function.
vectored byte swap and interleaving of input data, for various N ways, for 32 and 64 bit data.
byte-swap the nonce only when necessary, when a valid share is found, instead of
byte-swapping every nonce tested.
implement new hash for test including pre-test before de-interleaving N way hash.
submit shares in scanhash loop then continue hashing instead of returning to the main thread
loop to submit shares.
thread id argument added to hash call to enable restart flag checking.
There are also changes to the hash functions of each algo:
use union overlay instead of struct for the context holder for algos that use a lot of contexts,
implement midstate prehash when first function use a block size of 64 bytes or less,
use full versions of chained hash functions instead of the 3 step init, update & close,
write final hash directly to output buffer instead of using an intermediate buffer and memcpy,
implement intermediate stale work detection for low hash rate algos to reduce stale shares.
use rintrlv instead of 2 step dintrlv, intrlv when interleaved data needs to be interleaved in a
different format.
ensure hash function returns a default 1 if thread restart checking is not used.