From 2b3a03a9dceff0c292250fd97df938cda04a4d42 Mon Sep 17 00:00:00 2001 From: tevador Date: Wed, 15 May 2019 22:07:26 +0200 Subject: [PATCH] Fixed FSCAL instruction causing group F registers to exceed their intended maximum value --- src/asm/program_xmm_constants.inc | 2 +- src/tests/benchmark.cpp | 2 +- src/vm_interpreted.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/asm/program_xmm_constants.inc b/src/asm/program_xmm_constants.inc index e5219ac..296237a 100644 --- a/src/asm/program_xmm_constants.inc +++ b/src/asm/program_xmm_constants.inc @@ -3,4 +3,4 @@ mantissaMask: exp240: db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 scaleMask: - db 0, 0, 0, 0, 0, 0, 240, 129, 0, 0, 0, 0, 0, 0, 240, 129 \ No newline at end of file + db 0, 0, 0, 0, 0, 0, 240, 128, 0, 0, 0, 0, 0, 0, 240, 128 \ No newline at end of file diff --git a/src/tests/benchmark.cpp b/src/tests/benchmark.cpp index a2873e2..4746baa 100644 --- a/src/tests/benchmark.cpp +++ b/src/tests/benchmark.cpp @@ -229,7 +229,7 @@ int main(int argc, char** argv) { std::cout << "Calculated result: "; result.print(std::cout); if (noncesCount == 1000 && seedValue == 0) - std::cout << "Reference result: 57eb2044a20f8d6d6ef75eba6d879af5b9850556cb5a7cb459d7b091bd8d63aa" << std::endl; + std::cout << "Reference result: d908c4ce0329e2e104c08c3a76b427dd9dad3622a04b06af965cd00cd62b2d2e" << std::endl; if (!miningMode) { std::cout << "Performance: " << 1000 * elapsed / noncesCount << " ms per hash" << std::endl; } diff --git a/src/vm_interpreted.cpp b/src/vm_interpreted.cpp index fd7876f..dc0103e 100644 --- a/src/vm_interpreted.cpp +++ b/src/vm_interpreted.cpp @@ -161,7 +161,7 @@ namespace randomx { } break; case InstructionType::FSCAL_R: { - const rx_vec_f128 mask = rx_set1_vec_f128(0x81F0000000000000); + const rx_vec_f128 mask = rx_set1_vec_f128(0x80F0000000000000); *ibc.fdst = rx_xor_vec_f128(*ibc.fdst, mask); } break;