Merge branch 'dev' of github.com:xmrig/xmrig into dev

This commit is contained in:
XMRig 2020-08-16 15:47:57 +07:00
commit 8d5ea745bb
No known key found for this signature in database
GPG key ID: 446A53638BE94409
5 changed files with 22 additions and 24 deletions

View file

@ -108,7 +108,7 @@ namespace randomx {
ibc.imm = signExtend2sCompl(instr.getImm32());
if (src != dst) {
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
}
else {
ibc.isrc = &zero;
@ -142,7 +142,7 @@ namespace randomx {
ibc.imm = signExtend2sCompl(instr.getImm32());
if (src != dst) {
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
}
else {
ibc.isrc = &zero;
@ -176,7 +176,7 @@ namespace randomx {
ibc.imm = signExtend2sCompl(instr.getImm32());
if (src != dst) {
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
}
else {
ibc.isrc = &zero;
@ -204,7 +204,7 @@ namespace randomx {
ibc.imm = signExtend2sCompl(instr.getImm32());
if (src != dst) {
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
}
else {
ibc.isrc = &zero;
@ -232,7 +232,7 @@ namespace randomx {
ibc.imm = signExtend2sCompl(instr.getImm32());
if (src != dst) {
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
}
else {
ibc.isrc = &zero;
@ -290,7 +290,7 @@ namespace randomx {
ibc.imm = signExtend2sCompl(instr.getImm32());
if (src != dst) {
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
}
else {
ibc.isrc = &zero;
@ -373,7 +373,7 @@ namespace randomx {
ibc.type = InstructionType::FADD_M;
ibc.fdst = &nreg->f[dst];
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
ibc.imm = signExtend2sCompl(instr.getImm32());
return;
}
@ -393,7 +393,7 @@ namespace randomx {
ibc.type = InstructionType::FSUB_M;
ibc.fdst = &nreg->f[dst];
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
ibc.imm = signExtend2sCompl(instr.getImm32());
return;
}
@ -420,7 +420,7 @@ namespace randomx {
ibc.type = InstructionType::FDIV_M;
ibc.fdst = &nreg->e[dst];
ibc.isrc = &nreg->r[src];
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
ibc.imm = signExtend2sCompl(instr.getImm32());
return;
}
@ -466,7 +466,7 @@ namespace randomx {
ibc.isrc = &nreg->r[src];
ibc.imm = signExtend2sCompl(instr.getImm32());
if (instr.getModCond() < StoreL3Condition)
ibc.memMask = (instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask);
ibc.memMask = AddressMask[instr.getModMem()];
else
ibc.memMask = ScratchpadL3Mask;
return;

View file

@ -126,10 +126,7 @@ namespace randomx {
double hi;
};
#define ScratchpadL1Mask RandomX_CurrentConfig.ScratchpadL1Mask_Calculated
#define ScratchpadL1Mask16 RandomX_CurrentConfig.ScratchpadL1Mask16_Calculated
#define ScratchpadL2Mask RandomX_CurrentConfig.ScratchpadL2Mask_Calculated
#define ScratchpadL2Mask16 RandomX_CurrentConfig.ScratchpadL2Mask16_Calculated
#define AddressMask RandomX_CurrentConfig.AddressMask_Calculated
#define ScratchpadL3Mask RandomX_CurrentConfig.ScratchpadL3Mask_Calculated
#define ScratchpadL3Mask64 RandomX_CurrentConfig.ScratchpadL3Mask64_Calculated
constexpr int RegistersCount = 8;

View file

@ -508,7 +508,7 @@ namespace randomx {
*(uint32_t*)(code + codePos) = 0xe181;
codePos += 2;
}
emit32(instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask, code, codePos);
emit32(AddressMask[instr.getModMem()], code, codePos);
}
template void JitCompilerX86::genAddressReg<false>(const Instruction& instr, const uint32_t src, uint8_t* code, uint32_t& codePos);
@ -522,7 +522,7 @@ namespace randomx {
emit32(instr.getImm32(), code, codePos);
emitByte(0x25, code, codePos);
if (instr.getModCond() < StoreL3Condition) {
emit32(instr.getModMem() ? ScratchpadL1Mask : ScratchpadL2Mask, code, codePos);
emit32(AddressMask[instr.getModMem()], code, codePos);
}
else {
emit32(ScratchpadL3Mask, code, codePos);

View file

@ -211,10 +211,14 @@ static uint32_t Log2(size_t value) { return (value > 1) ? (Log2(value / 2) + 1)
void RandomX_ConfigurationBase::Apply()
{
ScratchpadL1Mask_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) - 1) * 8;
ScratchpadL1Mask16_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) / 2 - 1) * 16;
ScratchpadL2Mask_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) - 1) * 8;
ScratchpadL2Mask16_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) / 2 - 1) * 16;
const uint32_t ScratchpadL1Mask_Calculated = (ScratchpadL1_Size / sizeof(uint64_t) - 1) * 8;
const uint32_t ScratchpadL2Mask_Calculated = (ScratchpadL2_Size / sizeof(uint64_t) - 1) * 8;
AddressMask_Calculated[0] = ScratchpadL2Mask_Calculated;
AddressMask_Calculated[1] = ScratchpadL1Mask_Calculated;
AddressMask_Calculated[2] = ScratchpadL1Mask_Calculated;
AddressMask_Calculated[3] = ScratchpadL1Mask_Calculated;
ScratchpadL3Mask_Calculated = (((ScratchpadL3_Size / sizeof(uint64_t)) - 1) * 8);
ScratchpadL3Mask64_Calculated = ((ScratchpadL3_Size / sizeof(uint64_t)) / 8 - 1) * 64;

View file

@ -129,10 +129,7 @@ struct RandomX_ConfigurationBase
uint32_t CacheLineAlignMask_Calculated;
uint32_t DatasetExtraItems_Calculated;
uint32_t ScratchpadL1Mask_Calculated;
uint32_t ScratchpadL1Mask16_Calculated;
uint32_t ScratchpadL2Mask_Calculated;
uint32_t ScratchpadL2Mask16_Calculated;
uint32_t AddressMask_Calculated[4];
uint32_t ScratchpadL3Mask_Calculated;
uint32_t ScratchpadL3Mask64_Calculated;