Skip to content
Snippets Groups Projects
Commit dd8d85e7 authored by psychocrypt's avatar psychocrypt
Browse files

fix cn_gpu rounding mode selection

If cryptonight_gpu is used in the dev pool and a cryptonight_v8 derived
algorithm than cryptonight_gpu will create wrong results if v8 was
running as non ASM version.
parent 78bd2481
No related branches found
No related tags found
No related merge requests found
...@@ -744,7 +744,7 @@ inline void cryptonight_conceal_tweak(__m128i& cx, __m128& conc_var) ...@@ -744,7 +744,7 @@ inline void cryptonight_conceal_tweak(__m128i& cx, __m128& conc_var)
__m128i bx1; \ __m128i bx1; \
__m128i division_result_xmm; \ __m128i division_result_xmm; \
__m128 conc_var; \ __m128 conc_var; \
if(ALGO == cryptonight_conceal || ALGO == cryptonight_gpu) \ if(ALGO == cryptonight_conceal) \
{\ {\
set_float_rounding_mode_nearest(); \ set_float_rounding_mode_nearest(); \
conc_var = _mm_setzero_ps(); \ conc_var = _mm_setzero_ps(); \
...@@ -1306,6 +1306,7 @@ struct Cryptonight_hash_gpu ...@@ -1306,6 +1306,7 @@ struct Cryptonight_hash_gpu
template<xmrstak_algo_id ALGO, bool SOFT_AES, bool PREFETCH> template<xmrstak_algo_id ALGO, bool SOFT_AES, bool PREFETCH>
static void hash(const void* input, size_t len, void* output, cryptonight_ctx** ctx, const xmrstak_algo& algo) static void hash(const void* input, size_t len, void* output, cryptonight_ctx** ctx, const xmrstak_algo& algo)
{ {
set_float_rounding_mode_nearest();
keccak((const uint8_t *)input, len, ctx[0]->hash_state, 200); keccak((const uint8_t *)input, len, ctx[0]->hash_state, 200);
cn_explode_scratchpad_gpu<PREFETCH, ALGO>(ctx[0]->hash_state, ctx[0]->long_state, algo); cn_explode_scratchpad_gpu<PREFETCH, ALGO>(ctx[0]->hash_state, ctx[0]->long_state, algo);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment