16 -> 8 chained programs

constant address loads are always from L3
This commit is contained in:
tevador 2019-02-05 23:06:44 +01:00
parent 1ee94bef2a
commit b417fd08ea
7 changed files with 749 additions and 361 deletions

View file

@ -81,7 +81,7 @@ namespace RandomX {
}
int32_t AssemblyGeneratorX86::genAddressImm(Instruction& instr) {
return instr.imm32 & ((instr.mod % 4) ? ScratchpadL1Mask : ScratchpadL2Mask);
return instr.imm32 & ScratchpadL3Mask;
}
//1 uOP

View file

@ -37,7 +37,7 @@ namespace RandomX {
}
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 {

View file

@ -262,7 +262,7 @@ namespace RandomX {
}
void JitCompilerX86::genAddressImm(Instruction& instr) {
emit32(instr.imm32 & ((instr.mod % 4) ? ScratchpadL1Mask : ScratchpadL2Mask));
emit32(instr.imm32 & ScratchpadL3Mask);
}
void JitCompilerX86::h_IADD_R(Instruction& instr) {

View file

@ -68,7 +68,7 @@ namespace RandomX {
};
constexpr int ProgramLength = 256;
constexpr uint32_t InstructionCount = 1024;
constexpr uint32_t InstructionCount = 2048;
constexpr uint32_t ScratchpadSize = 2 * 1024 * 1024;
constexpr uint32_t ScratchpadLength = ScratchpadSize / 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 ScratchpadL1Mask16 = (ScratchpadL1 / 2 - 1) * 16;
constexpr int ScratchpadL2Mask16 = (ScratchpadL2 / 2 - 1) * 16;
constexpr int ScratchpadL3Mask = (ScratchpadLength - 1) * 8;
constexpr uint32_t TransformationCount = 90;
constexpr int RegistersCount = 8;

View file

@ -25,7 +25,7 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
#define WT_IADD_RC 12
#define WT_ISUB_R 12
#define WT_ISUB_M 3
#define WT_IMUL_9C 10
#define WT_IMUL_9C 9
#define WT_IMUL_R 16
#define WT_IMUL_M 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_INEG_R 2
#define WT_IXOR_R 12
#define WT_IXOR_M 3
#define WT_IXOR_M 4
#define WT_IROR_R 10
#define WT_IROL_R 10
#define WT_ISWAP_R 4

View file

@ -172,7 +172,7 @@ void mine(RandomX::VirtualMachine* vm, std::atomic<int>& atomicNonce, AtomicHash
//vm->initializeScratchpad(scratchpad, spIndex);
vm->setScratchpad(scratchpad);
//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->execute();
vm->getResult(nullptr, 0, hash);

File diff suppressed because it is too large Load diff