mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-12-22 15:58:53 +00:00
Fixed an inconsistency in IADD_RS in SuperscalarHash
This commit is contained in:
parent
c87dcc8ae5
commit
01db567e9d
@ -72,7 +72,7 @@ namespace randomx {
|
|||||||
asmCode << "xor " << regR[instr.dst] << ", " << regR[instr.src] << std::endl;
|
asmCode << "xor " << regR[instr.dst] << ", " << regR[instr.src] << std::endl;
|
||||||
break;
|
break;
|
||||||
case SuperscalarInstructionType::IADD_RS:
|
case SuperscalarInstructionType::IADD_RS:
|
||||||
asmCode << "lea " << regR[instr.dst] << ", [" << regR[instr.dst] << "+" << regR[instr.src] << "*" << (1 << (instr.getModMem())) << "]" << std::endl;
|
asmCode << "lea " << regR[instr.dst] << ", [" << regR[instr.dst] << "+" << regR[instr.src] << "*" << (1 << (instr.getModShift())) << "]" << std::endl;
|
||||||
break;
|
break;
|
||||||
case SuperscalarInstructionType::IMUL_R:
|
case SuperscalarInstructionType::IMUL_R:
|
||||||
asmCode << "imul " << regR[instr.dst] << ", " << regR[instr.src] << std::endl;
|
asmCode << "imul " << regR[instr.dst] << ", " << regR[instr.src] << std::endl;
|
||||||
@ -181,7 +181,7 @@ namespace randomx {
|
|||||||
asmCode << regR[instr.dst] << " ^= " << regR[instr.src] << ";" << std::endl;
|
asmCode << regR[instr.dst] << " ^= " << regR[instr.src] << ";" << std::endl;
|
||||||
break;
|
break;
|
||||||
case SuperscalarInstructionType::IADD_RS:
|
case SuperscalarInstructionType::IADD_RS:
|
||||||
asmCode << regR[instr.dst] << " += " << regR[instr.src] << "*" << (1 << (instr.getModMem())) << ";" << std::endl;
|
asmCode << regR[instr.dst] << " += " << regR[instr.src] << "*" << (1 << (instr.getModShift())) << ";" << std::endl;
|
||||||
break;
|
break;
|
||||||
case SuperscalarInstructionType::IMUL_R:
|
case SuperscalarInstructionType::IMUL_R:
|
||||||
asmCode << regR[instr.dst] << " *= " << regR[instr.src] << ";" << std::endl;
|
asmCode << regR[instr.dst] << " *= " << regR[instr.src] << ";" << std::endl;
|
||||||
|
@ -352,7 +352,7 @@ namespace randomx {
|
|||||||
case randomx::SuperscalarInstructionType::IADD_RS:
|
case randomx::SuperscalarInstructionType::IADD_RS:
|
||||||
emit(REX_LEA);
|
emit(REX_LEA);
|
||||||
emitByte(0x04 + 8 * instr.dst);
|
emitByte(0x04 + 8 * instr.dst);
|
||||||
genSIB(instr.getModMem(), instr.src, instr.dst);
|
genSIB(instr.getModShift(), instr.src, instr.dst);
|
||||||
break;
|
break;
|
||||||
case randomx::SuperscalarInstructionType::IMUL_R:
|
case randomx::SuperscalarInstructionType::IMUL_R:
|
||||||
emit(REX_IMUL_RR);
|
emit(REX_IMUL_RR);
|
||||||
|
@ -849,7 +849,7 @@ namespace randomx {
|
|||||||
r[instr.dst] ^= r[instr.src];
|
r[instr.dst] ^= r[instr.src];
|
||||||
break;
|
break;
|
||||||
case randomx::SuperscalarInstructionType::IADD_RS:
|
case randomx::SuperscalarInstructionType::IADD_RS:
|
||||||
r[instr.dst] += r[instr.src] << instr.getModMem();
|
r[instr.dst] += r[instr.src] << instr.getModShift();
|
||||||
break;
|
break;
|
||||||
case randomx::SuperscalarInstructionType::IMUL_R:
|
case randomx::SuperscalarInstructionType::IMUL_R:
|
||||||
r[instr.dst] *= r[instr.src];
|
r[instr.dst] *= r[instr.src];
|
||||||
|
@ -229,7 +229,7 @@ int main(int argc, char** argv) {
|
|||||||
std::cout << "Calculated result: ";
|
std::cout << "Calculated result: ";
|
||||||
result.print(std::cout);
|
result.print(std::cout);
|
||||||
if (noncesCount == 1000 && seedValue == 0)
|
if (noncesCount == 1000 && seedValue == 0)
|
||||||
std::cout << "Reference result: 6d95d8d07fa3a80771f33d1b20452b61ab2d0bf21058b5e586fad38bf3e1e0ca" << std::endl;
|
std::cout << "Reference result: a15448785857f9a78703eb5da235dfe73d0d5fc4c8effaebe73869904f5af47d" << std::endl;
|
||||||
if (!miningMode) {
|
if (!miningMode) {
|
||||||
std::cout << "Performance: " << 1000 * elapsed / noncesCount << " ms per hash" << std::endl;
|
std::cout << "Performance: " << 1000 * elapsed / noncesCount << " ms per hash" << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user