-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of CryptoNight v8 ReverseWaltz based on CryptoNight V8 #234
Conversation
@jagerman, the test which I'm added in the previous comment not satisfied me, so I added performance test here.
There is some difference between CNv8 and CNv8-origin, and between waltz's variants, but as for me it looks like more as measurement error, than performance reduction. |
@EDDragonWolf - there is another gain to be had here by getting the conditional outside of the hashing loop by making it a compile-time constant by "loop hoisting" it. This macro would work, I think: #define VARIANT2_SHUFFLE_ADD_SSE2_REVERSE(base_ptr, offset, REVERSE_STEP) \
do if (variant >= 2) \
{ \
__m128i chunk1 = _mm_load_si128((__m128i *)((base_ptr) + ((offset) ^ (REVERSE_STEP ? 0x30 : 0x10)))); \
__m128i chunk2 = _mm_load_si128((__m128i *)((base_ptr) + ((offset) ^ 0x20))); \
__m128i chunk3 = _mm_load_si128((__m128i *)((base_ptr) + ((offset) ^ (REVERSE_STEP ? 0x30 : 0x10)))); \
_mm_store_si128((__m128i *)((base_ptr) + ((offset) ^ 0x10)), _mm_add_epi64(chunk1, _b1)); \
_mm_store_si128((__m128i *)((base_ptr) + ((offset) ^ 0x20)), _mm_add_epi64(chunk3, _b)); \
_mm_store_si128((__m128i *)((base_ptr) + ((offset) ^ 0x30)), _mm_add_epi64(chunk2, _a)); \
} while (0) you'll need to add this REVERSE_STEP constant as a macro back through the if(useAes)
{
if(modifier & CN_MODIFIER_REVERSE) {
for(i = 0; i < iters; i++)
{
pre_aes();
_c = _mm_aesenc_si128(_c, _a);
post_aes(1);
}
}
else {
for(i = 0; i < iters; i++)
{
pre_aes();
_c = _mm_aesenc_si128(_c, _a);
post_aes(0);
}
}
} It's quite possible that the compiler is already doing this optimization, but given the size of the code in the loop it's quite possible that it isn't (or that it would only do so at |
Thanks, @jagerman. I have not thought about optimization in this way. I added changes based on your suggestion with minor fixes. |
I don't like |
Any test pool available? |
@SChernykh |
Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
rebased version of fireice-uk#2261 Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
rebased version of fireice-uk#2261 Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
rebased version of #2261 Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
rebased version of fireice-uk#2261 Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
Added support of following tweaks of CryptoNight hashing algorithms:
CryptoNight v8 Reverse Waltz is planned to use as our new PoW algorithm.
Note: Hard Fork 12 scheduled on block 299200 (~2019-03-07T05:00:00+00).
Closes #208
Closes #223
Closes #224