xmrig v6.3.2 merge
This commit is contained in:
commit
651306a57a
25 changed files with 473 additions and 57 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -414,7 +414,7 @@ FORCE_INLINE void rx_store_vec_f128(double* mem_addr, rx_vec_f128 val) {
|
|||
}
|
||||
|
||||
FORCE_INLINE rx_vec_f128 rx_swap_vec_f128(rx_vec_f128 a) {
|
||||
float64x2_t temp;
|
||||
float64x2_t temp{};
|
||||
temp = vcopyq_laneq_f64(temp, 1, a, 1);
|
||||
a = vcopyq_laneq_f64(a, 1, a, 0);
|
||||
return vcopyq_laneq_f64(a, 0, temp, 1);
|
||||
|
@ -505,7 +505,7 @@ FORCE_INLINE void rx_store_vec_i128(rx_vec_i128* mem_addr, rx_vec_i128 val) {
|
|||
FORCE_INLINE rx_vec_f128 rx_cvt_packed_int_vec_f128(const void* addr) {
|
||||
double lo = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 0));
|
||||
double hi = unsigned32ToSigned2sCompl(load32((uint8_t*)addr + 4));
|
||||
rx_vec_f128 x;
|
||||
rx_vec_f128 x{};
|
||||
x = vsetq_lane_f64(lo, x, 0);
|
||||
x = vsetq_lane_f64(hi, x, 1);
|
||||
return x;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -193,18 +193,18 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
|||
fillAes4Rx4_Key[6] = rx_set_int_vec_i128(0xf63befa7, 0x2ba9660a, 0xf765a38b, 0xf273c9e7);
|
||||
fillAes4Rx4_Key[7] = rx_set_int_vec_i128(0xc0b0762d, 0x0c06d1fd, 0x915839de, 0x7a7cd609);
|
||||
|
||||
# if defined(_M_X64) || defined(__x86_64__)
|
||||
// Workaround for Visual Studio placing trampoline in debug builds.
|
||||
auto addr = [](void (*func)()) {
|
||||
const uint8_t* p = reinterpret_cast<const uint8_t*>(func);
|
||||
# if defined(_MSC_VER)
|
||||
# if defined(_MSC_VER)
|
||||
if (p[0] == 0xE9) {
|
||||
p += *(const int32_t*)(p + 1) + 5;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
return p;
|
||||
};
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
{
|
||||
const uint8_t* a = addr(randomx_sshash_prefetch);
|
||||
const uint8_t* b = addr(randomx_sshash_end);
|
||||
|
@ -232,17 +232,21 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
|||
const uint8_t* b = addr(randomx_prefetch_scratchpad_end);
|
||||
memcpy(codePrefetchScratchpadTweaked, a, b - a);
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
static uint32_t Log2(size_t value) { return (value > 1) ? (Log2(value / 2) + 1) : 0; }
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -130,10 +130,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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue