Skip to content

Commit

Permalink
Fixed FSCAL instruction causing group F registers to exceed their int…
Browse files Browse the repository at this point in the history
…ended maximum value
  • Loading branch information
tevador committed May 15, 2019
1 parent 2a04dfd commit 2b3a03a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/asm/program_xmm_constants.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
db 0, 0, 0, 0, 0, 0, 240, 128, 0, 0, 0, 0, 0, 0, 240, 128
2 changes: 1 addition & 1 deletion src/tests/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vm_interpreted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2b3a03a

Please sign in to comment.