mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-12-22 15:58:53 +00:00
16 -> 8 chained programs
constant address loads are always from L3
This commit is contained in:
parent
1ee94bef2a
commit
b417fd08ea
@ -81,7 +81,7 @@ namespace RandomX {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t AssemblyGeneratorX86::genAddressImm(Instruction& instr) {
|
int32_t AssemblyGeneratorX86::genAddressImm(Instruction& instr) {
|
||||||
return instr.imm32 & ((instr.mod % 4) ? ScratchpadL1Mask : ScratchpadL2Mask);
|
return instr.imm32 & ScratchpadL3Mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
//1 uOP
|
//1 uOP
|
||||||
|
@ -37,7 +37,7 @@ namespace RandomX {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Instruction::genAddressImm(std::ostream& os) const {
|
void Instruction::genAddressImm(std::ostream& os) const {
|
||||||
os << ((mod % 4) ? "L1" : "L2") << "[" << (imm32 & ((mod % 4) ? ScratchpadL1Mask : ScratchpadL2Mask)) << "]";
|
os << "L3" << "[" << (imm32 & ScratchpadL3Mask) << "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instruction::h_IADD_R(std::ostream& os) const {
|
void Instruction::h_IADD_R(std::ostream& os) const {
|
||||||
|
@ -262,7 +262,7 @@ namespace RandomX {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JitCompilerX86::genAddressImm(Instruction& instr) {
|
void JitCompilerX86::genAddressImm(Instruction& instr) {
|
||||||
emit32(instr.imm32 & ((instr.mod % 4) ? ScratchpadL1Mask : ScratchpadL2Mask));
|
emit32(instr.imm32 & ScratchpadL3Mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompilerX86::h_IADD_R(Instruction& instr) {
|
void JitCompilerX86::h_IADD_R(Instruction& instr) {
|
||||||
|
@ -68,7 +68,7 @@ namespace RandomX {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constexpr int ProgramLength = 256;
|
constexpr int ProgramLength = 256;
|
||||||
constexpr uint32_t InstructionCount = 1024;
|
constexpr uint32_t InstructionCount = 2048;
|
||||||
constexpr uint32_t ScratchpadSize = 2 * 1024 * 1024;
|
constexpr uint32_t ScratchpadSize = 2 * 1024 * 1024;
|
||||||
constexpr uint32_t ScratchpadLength = ScratchpadSize / sizeof(convertible_t);
|
constexpr uint32_t ScratchpadLength = ScratchpadSize / sizeof(convertible_t);
|
||||||
constexpr uint32_t ScratchpadL1 = ScratchpadSize / 128 / sizeof(convertible_t);
|
constexpr uint32_t ScratchpadL1 = ScratchpadSize / 128 / sizeof(convertible_t);
|
||||||
@ -78,6 +78,7 @@ namespace RandomX {
|
|||||||
constexpr int ScratchpadL2Mask = (ScratchpadL2 - 1) * 8;
|
constexpr int ScratchpadL2Mask = (ScratchpadL2 - 1) * 8;
|
||||||
constexpr int ScratchpadL1Mask16 = (ScratchpadL1 / 2 - 1) * 16;
|
constexpr int ScratchpadL1Mask16 = (ScratchpadL1 / 2 - 1) * 16;
|
||||||
constexpr int ScratchpadL2Mask16 = (ScratchpadL2 / 2 - 1) * 16;
|
constexpr int ScratchpadL2Mask16 = (ScratchpadL2 / 2 - 1) * 16;
|
||||||
|
constexpr int ScratchpadL3Mask = (ScratchpadLength - 1) * 8;
|
||||||
constexpr uint32_t TransformationCount = 90;
|
constexpr uint32_t TransformationCount = 90;
|
||||||
constexpr int RegistersCount = 8;
|
constexpr int RegistersCount = 8;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
|||||||
#define WT_IADD_RC 12
|
#define WT_IADD_RC 12
|
||||||
#define WT_ISUB_R 12
|
#define WT_ISUB_R 12
|
||||||
#define WT_ISUB_M 3
|
#define WT_ISUB_M 3
|
||||||
#define WT_IMUL_9C 10
|
#define WT_IMUL_9C 9
|
||||||
#define WT_IMUL_R 16
|
#define WT_IMUL_R 16
|
||||||
#define WT_IMUL_M 4
|
#define WT_IMUL_M 4
|
||||||
#define WT_IMULH_R 4
|
#define WT_IMULH_R 4
|
||||||
@ -36,7 +36,7 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
|||||||
#define WT_ISDIV_C 4
|
#define WT_ISDIV_C 4
|
||||||
#define WT_INEG_R 2
|
#define WT_INEG_R 2
|
||||||
#define WT_IXOR_R 12
|
#define WT_IXOR_R 12
|
||||||
#define WT_IXOR_M 3
|
#define WT_IXOR_M 4
|
||||||
#define WT_IROR_R 10
|
#define WT_IROR_R 10
|
||||||
#define WT_IROL_R 10
|
#define WT_IROL_R 10
|
||||||
#define WT_ISWAP_R 4
|
#define WT_ISWAP_R 4
|
||||||
|
@ -172,7 +172,7 @@ void mine(RandomX::VirtualMachine* vm, std::atomic<int>& atomicNonce, AtomicHash
|
|||||||
//vm->initializeScratchpad(scratchpad, spIndex);
|
//vm->initializeScratchpad(scratchpad, spIndex);
|
||||||
vm->setScratchpad(scratchpad);
|
vm->setScratchpad(scratchpad);
|
||||||
//dump((char*)((RandomX::CompiledVirtualMachine*)vm)->getProgram(), RandomX::CodeSize, "code-1337-jmp.txt");
|
//dump((char*)((RandomX::CompiledVirtualMachine*)vm)->getProgram(), RandomX::CodeSize, "code-1337-jmp.txt");
|
||||||
for (int chain = 0; chain < 16; ++chain) {
|
for (int chain = 0; chain < 8; ++chain) {
|
||||||
vm->initializeProgram(hash);
|
vm->initializeProgram(hash);
|
||||||
vm->execute();
|
vm->execute();
|
||||||
vm->getResult(nullptr, 0, hash);
|
vm->getResult(nullptr, 0, hash);
|
||||||
|
1095
src/program.inc
1095
src/program.inc
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user