Fixup RandomX naming consistency
This commit is contained in:
parent
9e5f5b35a6
commit
582d17bb84
3 changed files with 35 additions and 35 deletions
|
@ -114,42 +114,42 @@ namespace randomx {
|
||||||
#define codeLoopBegin ADDR(randomx_program_loop_begin)
|
#define codeLoopBegin ADDR(randomx_program_loop_begin)
|
||||||
#define codeLoopLoad ADDR(randomx_program_loop_load)
|
#define codeLoopLoad ADDR(randomx_program_loop_load)
|
||||||
#define codeLoopLoadXOP ADDR(randomx_program_loop_load_xop)
|
#define codeLoopLoadXOP ADDR(randomx_program_loop_load_xop)
|
||||||
#define codeProgamStart ADDR(randomx_program_start)
|
#define codeProgramStart ADDR(randomx_program_start)
|
||||||
#define codeReadDataset ADDR(randomx_program_read_dataset)
|
#define codeReadDataset ADDR(randomx_program_read_dataset)
|
||||||
#define codeReadDatasetLightSshInit ADDR(randomx_program_read_dataset_sshash_init)
|
#define codeReadDatasetLightSshInit ADDR(randomx_program_read_dataset_sshash_init)
|
||||||
#define codeReadDatasetLightSshFin ADDR(randomx_program_read_dataset_sshash_fin)
|
#define codeReadDatasetLightSshFin ADDR(randomx_program_read_dataset_sshash_fin)
|
||||||
#define codeDatasetInit ADDR(randomx_dataset_init)
|
#define codeDatasetInit ADDR(randomx_dataset_init)
|
||||||
#define codeDatasetInitAVX2_prologue ADDR(randomx_dataset_init_avx2_prologue)
|
#define codeDatasetInitAVX2Prologue ADDR(randomx_dataset_init_avx2_prologue)
|
||||||
#define codeDatasetInitAVX2_loop_end ADDR(randomx_dataset_init_avx2_loop_end)
|
#define codeDatasetInitAVX2LoopEnd ADDR(randomx_dataset_init_avx2_loop_end)
|
||||||
#define codeDatasetInitAVX2_loop_epilogue ADDR(randomx_dataset_init_avx2_epilogue)
|
#define codeDatasetInitAVX2Epilogue ADDR(randomx_dataset_init_avx2_epilogue)
|
||||||
#define codeDatasetInitAVX2_ssh_load ADDR(randomx_dataset_init_avx2_ssh_load)
|
#define codeDatasetInitAVX2SshLoad ADDR(randomx_dataset_init_avx2_ssh_load)
|
||||||
#define codeDatasetInitAVX2_ssh_prefetch ADDR(randomx_dataset_init_avx2_ssh_prefetch)
|
#define codeDatasetInitAVX2SshPrefetch ADDR(randomx_dataset_init_avx2_ssh_prefetch)
|
||||||
#define codeLoopStore ADDR(randomx_program_loop_store)
|
#define codeLoopStore ADDR(randomx_program_loop_store)
|
||||||
#define codeLoopEnd ADDR(randomx_program_loop_end)
|
#define codeLoopEnd ADDR(randomx_program_loop_end)
|
||||||
#define codeEpilogue ADDR(randomx_program_epilogue)
|
#define codeEpilogue ADDR(randomx_program_epilogue)
|
||||||
#define codeProgramEnd ADDR(randomx_program_end)
|
#define codeProgramEnd ADDR(randomx_program_end)
|
||||||
#define codeShhLoad ADDR(randomx_sshash_load)
|
#define codeSshLoad ADDR(randomx_sshash_load)
|
||||||
#define codeShhPrefetch ADDR(randomx_sshash_prefetch)
|
#define codeSshPrefetch ADDR(randomx_sshash_prefetch)
|
||||||
#define codeShhEnd ADDR(randomx_sshash_end)
|
#define codeSshEnd ADDR(randomx_sshash_end)
|
||||||
#define codeShhInit ADDR(randomx_sshash_init)
|
#define codeSshInit ADDR(randomx_sshash_init)
|
||||||
|
|
||||||
#define prologueSize (codeLoopBegin - codePrologue)
|
#define prologueSize (codeLoopBegin - codePrologue)
|
||||||
#define loopLoadSize (codeLoopLoadXOP - codeLoopLoad)
|
#define loopLoadSize (codeLoopLoadXOP - codeLoopLoad)
|
||||||
#define loopLoadXOPSize (codeProgamStart - codeLoopLoadXOP)
|
#define loopLoadXOPSize (codeProgramStart - codeLoopLoadXOP)
|
||||||
#define readDatasetSize (codeReadDatasetLightSshInit - codeReadDataset)
|
#define readDatasetSize (codeReadDatasetLightSshInit - codeReadDataset)
|
||||||
#define readDatasetLightInitSize (codeReadDatasetLightSshFin - codeReadDatasetLightSshInit)
|
#define readDatasetLightInitSize (codeReadDatasetLightSshFin - codeReadDatasetLightSshInit)
|
||||||
#define readDatasetLightFinSize (codeLoopStore - codeReadDatasetLightSshFin)
|
#define readDatasetLightFinSize (codeLoopStore - codeReadDatasetLightSshFin)
|
||||||
#define loopStoreSize (codeLoopEnd - codeLoopStore)
|
#define loopStoreSize (codeLoopEnd - codeLoopStore)
|
||||||
#define datasetInitSize (codeDatasetInitAVX2_prologue - codeDatasetInit)
|
#define datasetInitSize (codeDatasetInitAVX2Prologue - codeDatasetInit)
|
||||||
#define datasetInitAVX2_prologue_size (codeDatasetInitAVX2_loop_end - codeDatasetInitAVX2_prologue)
|
#define datasetInitAVX2PrologueSize (codeDatasetInitAVX2LoopEnd - codeDatasetInitAVX2Prologue)
|
||||||
#define datasetInitAVX2_loop_end_size (codeDatasetInitAVX2_loop_epilogue - codeDatasetInitAVX2_loop_end)
|
#define datasetInitAVX2LoopEndSize (codeDatasetInitAVX2Epilogue - codeDatasetInitAVX2LoopEnd)
|
||||||
#define datasetInitAVX2_epilogue_size (codeDatasetInitAVX2_ssh_load - codeDatasetInitAVX2_loop_epilogue)
|
#define datasetInitAVX2EpilogueSize (codeDatasetInitAVX2SshLoad - codeDatasetInitAVX2Epilogue)
|
||||||
#define datasetInitAVX2_ssh_load_size (codeDatasetInitAVX2_ssh_prefetch - codeDatasetInitAVX2_ssh_load)
|
#define datasetInitAVX2SshLoadSize (codeDatasetInitAVX2SshPrefetch - codeDatasetInitAVX2SshLoad)
|
||||||
#define datasetInitAVX2_ssh_prefetch_size (codeEpilogue - codeDatasetInitAVX2_ssh_prefetch)
|
#define datasetInitAVX2SshPrefetchSize (codeEpilogue - codeDatasetInitAVX2SshPrefetch)
|
||||||
#define epilogueSize (codeShhLoad - codeEpilogue)
|
#define epilogueSize (codeSshLoad - codeEpilogue)
|
||||||
#define codeSshLoadSize (codeShhPrefetch - codeShhLoad)
|
#define codeSshLoadSize (codeSshPrefetch - codeSshLoad)
|
||||||
#define codeSshPrefetchSize (codeShhEnd - codeShhPrefetch)
|
#define codeSshPrefetchSize (codeSshEnd - codeSshPrefetch)
|
||||||
#define codeSshInitSize (codeProgramEnd - codeShhInit)
|
#define codeSshInitSize (codeProgramEnd - codeSshInit)
|
||||||
|
|
||||||
#define epilogueOffset ((CodeSize - epilogueSize) & ~63)
|
#define epilogueOffset ((CodeSize - epilogueSize) & ~63)
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ namespace randomx {
|
||||||
uint8_t* p = code;
|
uint8_t* p = code;
|
||||||
if (initDatasetAVX2) {
|
if (initDatasetAVX2) {
|
||||||
codePos = 0;
|
codePos = 0;
|
||||||
emit(codeDatasetInitAVX2_prologue, datasetInitAVX2_prologue_size, code, codePos);
|
emit(codeDatasetInitAVX2Prologue, datasetInitAVX2PrologueSize, code, codePos);
|
||||||
|
|
||||||
for (unsigned j = 0; j < RandomX_CurrentConfig.CacheAccesses; ++j) {
|
for (unsigned j = 0; j < RandomX_CurrentConfig.CacheAccesses; ++j) {
|
||||||
SuperscalarProgram& prog = programs[j];
|
SuperscalarProgram& prog = programs[j];
|
||||||
|
@ -350,29 +350,29 @@ namespace randomx {
|
||||||
generateSuperscalarCode<true>(prog(i), p, pos);
|
generateSuperscalarCode<true>(prog(i), p, pos);
|
||||||
}
|
}
|
||||||
codePos = pos;
|
codePos = pos;
|
||||||
emit(codeShhLoad, codeSshLoadSize, code, codePos);
|
emit(codeSshLoad, codeSshLoadSize, code, codePos);
|
||||||
emit(codeDatasetInitAVX2_ssh_load, datasetInitAVX2_ssh_load_size, code, codePos);
|
emit(codeDatasetInitAVX2SshLoad, datasetInitAVX2SshLoadSize, code, codePos);
|
||||||
if (j < RandomX_CurrentConfig.CacheAccesses - 1) {
|
if (j < RandomX_CurrentConfig.CacheAccesses - 1) {
|
||||||
*(uint32_t*)(code + codePos) = 0xd88b49 + (static_cast<uint32_t>(prog.getAddressRegister()) << 16);
|
*(uint32_t*)(code + codePos) = 0xd88b49 + (static_cast<uint32_t>(prog.getAddressRegister()) << 16);
|
||||||
codePos += 3;
|
codePos += 3;
|
||||||
emit(RandomX_CurrentConfig.codeShhPrefetchTweaked, codeSshPrefetchSize, code, codePos);
|
emit(RandomX_CurrentConfig.codeSshPrefetchTweaked, codeSshPrefetchSize, code, codePos);
|
||||||
uint8_t* p = code + codePos;
|
uint8_t* p = code + codePos;
|
||||||
emit(codeDatasetInitAVX2_ssh_prefetch, datasetInitAVX2_ssh_prefetch_size, code, codePos);
|
emit(codeDatasetInitAVX2SshPrefetch, datasetInitAVX2SshPrefetchSize, code, codePos);
|
||||||
p[3] += prog.getAddressRegister() << 3;
|
p[3] += prog.getAddressRegister() << 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit(codeDatasetInitAVX2_loop_end, datasetInitAVX2_loop_end_size, code, codePos);
|
emit(codeDatasetInitAVX2LoopEnd, datasetInitAVX2LoopEndSize, code, codePos);
|
||||||
|
|
||||||
// Number of bytes from the start of randomx_dataset_init_avx2_prologue to loop_begin label
|
// Number of bytes from the start of randomx_dataset_init_avx2_prologue to loop_begin label
|
||||||
constexpr int32_t prologue_size = 320;
|
constexpr int32_t prologue_size = 320;
|
||||||
*(int32_t*)(code + codePos - 4) = prologue_size - codePos;
|
*(int32_t*)(code + codePos - 4) = prologue_size - codePos;
|
||||||
|
|
||||||
emit(codeDatasetInitAVX2_loop_epilogue, datasetInitAVX2_epilogue_size, code, codePos);
|
emit(codeDatasetInitAVX2Epilogue, datasetInitAVX2EpilogueSize, code, codePos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(code + superScalarHashOffset, codeShhInit, codeSshInitSize);
|
memcpy(code + superScalarHashOffset, codeSshInit, codeSshInitSize);
|
||||||
codePos = superScalarHashOffset + codeSshInitSize;
|
codePos = superScalarHashOffset + codeSshInitSize;
|
||||||
for (unsigned j = 0; j < RandomX_CurrentConfig.CacheAccesses; ++j) {
|
for (unsigned j = 0; j < RandomX_CurrentConfig.CacheAccesses; ++j) {
|
||||||
SuperscalarProgram& prog = programs[j];
|
SuperscalarProgram& prog = programs[j];
|
||||||
|
@ -381,11 +381,11 @@ namespace randomx {
|
||||||
generateSuperscalarCode<false>(prog(i), p, pos);
|
generateSuperscalarCode<false>(prog(i), p, pos);
|
||||||
}
|
}
|
||||||
codePos = pos;
|
codePos = pos;
|
||||||
emit(codeShhLoad, codeSshLoadSize, code, codePos);
|
emit(codeSshLoad, codeSshLoadSize, code, codePos);
|
||||||
if (j < RandomX_CurrentConfig.CacheAccesses - 1) {
|
if (j < RandomX_CurrentConfig.CacheAccesses - 1) {
|
||||||
*(uint32_t*)(code + codePos) = 0xd88b49 + (static_cast<uint32_t>(prog.getAddressRegister()) << 16);
|
*(uint32_t*)(code + codePos) = 0xd88b49 + (static_cast<uint32_t>(prog.getAddressRegister()) << 16);
|
||||||
codePos += 3;
|
codePos += 3;
|
||||||
emit(RandomX_CurrentConfig.codeShhPrefetchTweaked, codeSshPrefetchSize, code, codePos);
|
emit(RandomX_CurrentConfig.codeSshPrefetchTweaked, codeSshPrefetchSize, code, codePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emitByte(0xc3, code, codePos);
|
emitByte(0xc3, code, codePos);
|
||||||
|
@ -411,7 +411,7 @@ namespace randomx {
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef XMRIG_FIX_RYZEN
|
# ifdef XMRIG_FIX_RYZEN
|
||||||
xmrig::RxFix::setMainLoopBounds(mainLoopBounds);
|
xmrig::RxFix::setMainLoopBounds(mainLoopBounds);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
imul_rcp_storage = code + (ADDR(randomx_program_imul_rcp_store) - codePrologue) + 2;
|
imul_rcp_storage = code + (ADDR(randomx_program_imul_rcp_store) - codePrologue) + 2;
|
||||||
|
|
|
@ -172,7 +172,7 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
||||||
{
|
{
|
||||||
const uint8_t* a = addr(randomx_sshash_prefetch);
|
const uint8_t* a = addr(randomx_sshash_prefetch);
|
||||||
const uint8_t* b = addr(randomx_sshash_end);
|
const uint8_t* b = addr(randomx_sshash_end);
|
||||||
memcpy(codeShhPrefetchTweaked, a, b - a);
|
memcpy(codeSshPrefetchTweaked, a, b - a);
|
||||||
}
|
}
|
||||||
if (xmrig::Cpu::info()->hasBMI2()) {
|
if (xmrig::Cpu::info()->hasBMI2()) {
|
||||||
const uint8_t* a = addr(randomx_prefetch_scratchpad_bmi2);
|
const uint8_t* a = addr(randomx_prefetch_scratchpad_bmi2);
|
||||||
|
@ -214,7 +214,7 @@ void RandomX_ConfigurationBase::Apply()
|
||||||
ScratchpadL3Mask64_Calculated = ((ScratchpadL3_Size / sizeof(uint64_t)) / 8 - 1) * 64;
|
ScratchpadL3Mask64_Calculated = ((ScratchpadL3_Size / sizeof(uint64_t)) / 8 - 1) * 64;
|
||||||
|
|
||||||
#if defined(XMRIG_FEATURE_ASM) && (defined(_M_X64) || defined(__x86_64__))
|
#if defined(XMRIG_FEATURE_ASM) && (defined(_M_X64) || defined(__x86_64__))
|
||||||
*(uint32_t*)(codeShhPrefetchTweaked + 3) = ArgonMemory * 16 - 1;
|
*(uint32_t*)(codeSshPrefetchTweaked + 3) = ArgonMemory * 16 - 1;
|
||||||
// Not needed right now because all variants use default dataset base size
|
// Not needed right now because all variants use default dataset base size
|
||||||
//const uint32_t DatasetBaseMask = DatasetBaseSize - RANDOMX_DATASET_ITEM_SIZE;
|
//const uint32_t DatasetBaseMask = DatasetBaseSize - RANDOMX_DATASET_ITEM_SIZE;
|
||||||
//*(uint32_t*)(codeReadDatasetTweaked + 9) = DatasetBaseMask;
|
//*(uint32_t*)(codeReadDatasetTweaked + 9) = DatasetBaseMask;
|
||||||
|
|
|
@ -124,7 +124,7 @@ struct RandomX_ConfigurationBase
|
||||||
|
|
||||||
rx_vec_i128 fillAes4Rx4_Key[8];
|
rx_vec_i128 fillAes4Rx4_Key[8];
|
||||||
|
|
||||||
uint8_t codeShhPrefetchTweaked[20];
|
uint8_t codeSshPrefetchTweaked[20];
|
||||||
uint8_t codePrefetchScratchpadTweaked[28];
|
uint8_t codePrefetchScratchpadTweaked[28];
|
||||||
uint32_t codePrefetchScratchpadTweakedSize;
|
uint32_t codePrefetchScratchpadTweakedSize;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue