Monero
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
randomx Namespace Reference

Namespaces

namespace  ExecutionPort
 

Classes

struct  AlignedAllocator
 
class  AssemblyGeneratorX86
 
class  Blake2Generator
 
class  BytecodeMachine
 
class  CompiledLightVm
 
class  CompiledVm
 
class  Cpu
 
class  DecoderBuffer
 
struct  fpu_reg_t
 
class  Instruction
 
struct  InstructionByteCode
 
class  InterpretedLightVm
 
class  InterpretedVm
 
class  JitCompilerA64
 
class  JitCompilerFallback
 
class  JitCompilerX86
 
struct  LargePageAllocator
 
class  MacroOp
 
struct  MemoryRegisters
 
struct  NativeRegisterFile
 
class  Program
 
struct  ProgramConfiguration
 
struct  RegisterFile
 
class  RegisterInfo
 
class  SuperscalarInstruction
 
class  SuperscalarInstructionInfo
 
class  SuperscalarProgram
 
class  VmBase
 

Typedefs

typedef void(AssemblyGeneratorX86::* InstructionGenerator) (Instruction &, int)
 
typedef void(BytecodeMachine::* InstructionGenBytecode) (RANDOMX_GEN_ARGS)
 
using JitCompiler = JitCompilerFallback
 
using addr_t = uint32_t
 
using int_reg_t = uint64_t
 
typedef void() ProgramFunc(RegisterFile &, MemoryRegisters &, uint8_t *, uint64_t)
 
typedef void() DatasetInitFunc(randomx_cache *cache, uint8_t *dataset, uint32_t startBlock, uint32_t endBlock)
 
typedef void() DatasetDeallocFunc(randomx_dataset *)
 
typedef void() CacheDeallocFunc(randomx_cache *)
 
typedef void() CacheInitializeFunc(randomx_cache *, const void *, size_t)
 
using DefaultAllocator = AlignedAllocator< CacheLineSize >
 
typedef void(Instruction::* InstructionFormatter) (std::ostream &) const
 
typedef void(JitCompilerA64::* InstructionGeneratorA64) (Instruction &, uint32_t &)
 
typedef void(JitCompilerX86::* InstructionGeneratorX86) (Instruction &, int)
 
using CompiledVmDefault = CompiledVm< AlignedAllocator< CacheLineSize >, true, false >
 
using CompiledVmHardAes = CompiledVm< AlignedAllocator< CacheLineSize >, false, false >
 
using CompiledVmLargePage = CompiledVm< LargePageAllocator, true, false >
 
using CompiledVmLargePageHardAes = CompiledVm< LargePageAllocator, false, false >
 
using CompiledVmDefaultSecure = CompiledVm< AlignedAllocator< CacheLineSize >, true, true >
 
using CompiledVmHardAesSecure = CompiledVm< AlignedAllocator< CacheLineSize >, false, true >
 
using CompiledVmLargePageSecure = CompiledVm< LargePageAllocator, true, true >
 
using CompiledVmLargePageHardAesSecure = CompiledVm< LargePageAllocator, false, true >
 
using CompiledLightVmDefault = CompiledLightVm< AlignedAllocator< CacheLineSize >, true, false >
 
using CompiledLightVmHardAes = CompiledLightVm< AlignedAllocator< CacheLineSize >, false, false >
 
using CompiledLightVmLargePage = CompiledLightVm< LargePageAllocator, true, false >
 
using CompiledLightVmLargePageHardAes = CompiledLightVm< LargePageAllocator, false, false >
 
using CompiledLightVmDefaultSecure = CompiledLightVm< AlignedAllocator< CacheLineSize >, true, true >
 
using CompiledLightVmHardAesSecure = CompiledLightVm< AlignedAllocator< CacheLineSize >, false, true >
 
using CompiledLightVmLargePageSecure = CompiledLightVm< LargePageAllocator, true, true >
 
using CompiledLightVmLargePageHardAesSecure = CompiledLightVm< LargePageAllocator, false, true >
 
using InterpretedVmDefault = InterpretedVm< AlignedAllocator< CacheLineSize >, true >
 
using InterpretedVmHardAes = InterpretedVm< AlignedAllocator< CacheLineSize >, false >
 
using InterpretedVmLargePage = InterpretedVm< LargePageAllocator, true >
 
using InterpretedVmLargePageHardAes = InterpretedVm< LargePageAllocator, false >
 
using InterpretedLightVmDefault = InterpretedLightVm< AlignedAllocator< CacheLineSize >, true >
 
using InterpretedLightVmHardAes = InterpretedLightVm< AlignedAllocator< CacheLineSize >, false >
 
using InterpretedLightVmLargePage = InterpretedLightVm< LargePageAllocator, true >
 
using InterpretedLightVmLargePageHardAes = InterpretedLightVm< LargePageAllocator, false >
 

Enumerations

enum class  InstructionType : uint16_t {
  IADD_RS = 0 , IADD_M = 1 , ISUB_R = 2 , ISUB_M = 3 ,
  IMUL_R = 4 , IMUL_M = 5 , IMULH_R = 6 , IMULH_M = 7 ,
  ISMULH_R = 8 , ISMULH_M = 9 , IMUL_RCP = 10 , INEG_R = 11 ,
  IXOR_R = 12 , IXOR_M = 13 , IROR_R = 14 , IROL_R = 15 ,
  ISWAP_R = 16 , FSWAP_R = 17 , FADD_R = 18 , FADD_M = 19 ,
  FSUB_R = 20 , FSUB_M = 21 , FSCAL_R = 22 , FMUL_R = 23 ,
  FDIV_M = 24 , FSQRT_R = 25 , CBRANCH = 26 , CFROUND = 27 ,
  ISTORE = 28 , NOP = 29
}
 
enum class  SuperscalarInstructionType {
  ISUB_R = 0 , IXOR_R = 1 , IADD_RS = 2 , IMUL_R = 3 ,
  IROR_C = 4 , IADD_C7 = 5 , IXOR_C7 = 6 , IADD_C8 = 7 ,
  IXOR_C8 = 8 , IADD_C9 = 9 , IXOR_C9 = 10 , IMULH_R = 11 ,
  ISMULH_R = 12 , IMUL_RCP = 13 , COUNT = 14 , INVALID = -1
}
 

Functions

 OPCODE_CEIL_DECLARE (IADD_RS, NULL)
 
 OPCODE_CEIL_DECLARE (IADD_M, IADD_RS)
 
 OPCODE_CEIL_DECLARE (ISUB_R, IADD_M)
 
 OPCODE_CEIL_DECLARE (ISUB_M, ISUB_R)
 
 OPCODE_CEIL_DECLARE (IMUL_R, ISUB_M)
 
 OPCODE_CEIL_DECLARE (IMUL_M, IMUL_R)
 
 OPCODE_CEIL_DECLARE (IMULH_R, IMUL_M)
 
 OPCODE_CEIL_DECLARE (IMULH_M, IMULH_R)
 
 OPCODE_CEIL_DECLARE (ISMULH_R, IMULH_M)
 
 OPCODE_CEIL_DECLARE (ISMULH_M, ISMULH_R)
 
 OPCODE_CEIL_DECLARE (IMUL_RCP, ISMULH_M)
 
 OPCODE_CEIL_DECLARE (INEG_R, IMUL_RCP)
 
 OPCODE_CEIL_DECLARE (IXOR_R, INEG_R)
 
 OPCODE_CEIL_DECLARE (IXOR_M, IXOR_R)
 
 OPCODE_CEIL_DECLARE (IROR_R, IXOR_M)
 
 OPCODE_CEIL_DECLARE (IROL_R, IROR_R)
 
 OPCODE_CEIL_DECLARE (ISWAP_R, IROL_R)
 
 OPCODE_CEIL_DECLARE (FSWAP_R, ISWAP_R)
 
 OPCODE_CEIL_DECLARE (FADD_R, FSWAP_R)
 
 OPCODE_CEIL_DECLARE (FADD_M, FADD_R)
 
 OPCODE_CEIL_DECLARE (FSUB_R, FADD_M)
 
 OPCODE_CEIL_DECLARE (FSUB_M, FSUB_R)
 
 OPCODE_CEIL_DECLARE (FSCAL_R, FSUB_M)
 
 OPCODE_CEIL_DECLARE (FMUL_R, FSCAL_R)
 
 OPCODE_CEIL_DECLARE (FDIV_M, FMUL_R)
 
 OPCODE_CEIL_DECLARE (FSQRT_R, FDIV_M)
 
 OPCODE_CEIL_DECLARE (CBRANCH, FSQRT_R)
 
 OPCODE_CEIL_DECLARE (CFROUND, CBRANCH)
 
 OPCODE_CEIL_DECLARE (ISTORE, CFROUND)
 
 OPCODE_CEIL_DECLARE (NOP, ISTORE)
 
bool isZeroOrPowerOf2 (uint64_t x)
 
template<class Allocator >
void deallocCache (randomx_cache *cache)
 
template void deallocCache< DefaultAllocator > (randomx_cache *cache)
 
template void deallocCache< LargePageAllocator > (randomx_cache *cache)
 
void initCache (randomx_cache *cache, const void *key, size_t keySize)
 
void initCacheCompile (randomx_cache *cache, const void *key, size_t keySize)
 
static uint8_tgetMixBlock (uint64_t registerValue, uint8_t *memory)
 
void initDatasetItem (randomx_cache *cache, uint8_t *out, uint64_t itemNumber)
 
void initDataset (randomx_cache *cache, uint8_t *dataset, uint32_t startItem, uint32_t endItem)
 
template<class Allocator >
void deallocDataset (randomx_dataset *dataset)
 
randomx_argon2_implselectArgonImpl (randomx_flags flags)
 
template<typename T >
static constexpr size_t Log2 (T value)
 
static bool isMultiplication (SuperscalarInstructionType type)
 
static bool selectRegister (std::vector< int > &availableRegisters, Blake2Generator &gen, int &reg)
 
template<bool commit>
static int scheduleUop (ExecutionPort::type uop, ExecutionPort::type(&portBusy)[CYCLE_MAP_SIZE][3], int cycle)
 
template<bool commit>
static int scheduleMop (const MacroOp &mop, ExecutionPort::type(&portBusy)[CYCLE_MAP_SIZE][3], int cycle, int depCycle)
 
void generateSuperscalar (SuperscalarProgram &prog, Blake2Generator &gen)
 
void executeSuperscalar (int_reg_t(&r)[8], SuperscalarProgram &prog, std::vector< uint64_t > *reciprocals)
 
static uint64_t getSmallPositiveFloatBits (uint64_t entropy)
 
static uint64_t getStaticExponent (uint64_t entropy)
 
static uint64_t getFloatMask (uint64_t entropy)
 

Variables

static const char * regR [] = { "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }
 
static const char * regR32 [] = { "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }
 
static const char * regFE [] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" }
 
static const char * regF [] = { "xmm0", "xmm1", "xmm2", "xmm3" }
 
static const char * regE [] = { "xmm4", "xmm5", "xmm6", "xmm7" }
 
static const char * regA [] = { "xmm8", "xmm9", "xmm10", "xmm11" }
 
static const char * tempRegx = "xmm12"
 
static const char * mantissaMaskReg = "xmm13"
 
static const char * exponentMaskReg = "xmm14"
 
static const char * scaleMaskReg = "xmm15"
 
static const char * regIc = "rbx"
 
static const char * regIc32 = "ebx"
 
static const char * regIc8 = "bl"
 
static const char * regScratchpadAddr = "rsi"
 
constexpr int maxSeedSize = 60
 
constexpr int ceil_NULL = 0
 
constexpr int wtSum
 
constexpr uint32_t ArgonBlockSize = 1024
 
constexpr int ArgonSaltSize = sizeof("" RANDOMX_ARGON_SALT) - 1
 
constexpr int SuperscalarMaxSize = 3 * RANDOMX_SUPERSCALAR_LATENCY + 2
 
constexpr size_t CacheLineSize = RANDOMX_DATASET_ITEM_SIZE
 
constexpr int ScratchpadSize = RANDOMX_SCRATCHPAD_L3
 
constexpr uint32_t CacheLineAlignMask = (RANDOMX_DATASET_BASE_SIZE - 1) & ~(CacheLineSize - 1)
 
constexpr uint32_t CacheSize = RANDOMX_ARGON_MEMORY * ArgonBlockSize
 
constexpr uint64_t DatasetSize = RANDOMX_DATASET_BASE_SIZE + RANDOMX_DATASET_EXTRA_SIZE
 
constexpr uint32_t DatasetExtraItems = RANDOMX_DATASET_EXTRA_SIZE / RANDOMX_DATASET_ITEM_SIZE
 
constexpr uint32_t ConditionMask = ((1 << RANDOMX_JUMP_BITS) - 1)
 
constexpr int ConditionOffset = RANDOMX_JUMP_OFFSET
 
constexpr int StoreL3Condition = 14
 
constexpr bool trace = false
 
constexpr uint32_t ScratchpadL1 = RANDOMX_SCRATCHPAD_L1 / sizeof(int_reg_t)
 
constexpr uint32_t ScratchpadL2 = RANDOMX_SCRATCHPAD_L2 / sizeof(int_reg_t)
 
constexpr uint32_t ScratchpadL3 = RANDOMX_SCRATCHPAD_L3 / sizeof(int_reg_t)
 
constexpr int ScratchpadL1Mask = (ScratchpadL1 - 1) * 8
 
constexpr int ScratchpadL2Mask = (ScratchpadL2 - 1) * 8
 
constexpr int ScratchpadL1Mask16 = (ScratchpadL1 / 2 - 1) * 16
 
constexpr int ScratchpadL2Mask16 = (ScratchpadL2 / 2 - 1) * 16
 
constexpr int ScratchpadL3Mask = (ScratchpadL3 - 1) * 8
 
constexpr int ScratchpadL3Mask64 = (ScratchpadL3 / 8 - 1) * 64
 
constexpr int RegistersCount = 8
 
constexpr int RegisterCountFlt = RegistersCount / 2
 
constexpr int RegisterNeedsDisplacement = 5
 
constexpr int RegisterNeedsSib = 4
 
constexpr int mantissaSize = 52
 
constexpr int exponentSize = 11
 
constexpr uint64_t mantissaMask = (1ULL << mantissaSize) - 1
 
constexpr uint64_t exponentMask = (1ULL << exponentSize) - 1
 
constexpr int exponentBias = 1023
 
constexpr int dynamicExponentBits = 4
 
constexpr int staticExponentBits = 4
 
constexpr uint64_t constExponentBits = 0x300
 
constexpr uint64_t dynamicMantissaMask = (1ULL << (mantissaSize + dynamicExponentBits)) - 1
 
constexpr uint64_t superscalarMul0 = 6364136223846793005ULL
 
constexpr uint64_t superscalarAdd1 = 9298411001130361340ULL
 
constexpr uint64_t superscalarAdd2 = 12065312585734608966ULL
 
constexpr uint64_t superscalarAdd3 = 9306329213124626780ULL
 
constexpr uint64_t superscalarAdd4 = 5281919268842080866ULL
 
constexpr uint64_t superscalarAdd5 = 10536153434571861004ULL
 
constexpr uint64_t superscalarAdd6 = 3398623926847679864ULL
 
constexpr uint64_t superscalarAdd7 = 9549104520008361294ULL
 
static const size_t CodeSize = ((uint8_t*)randomx_init_dataset_aarch64_end) - ((uint8_t*)randomx_program_aarch64)
 
static const size_t MainLoopBegin = ((uint8_t*)randomx_program_aarch64_main_loop) - ((uint8_t*)randomx_program_aarch64)
 
static const size_t PrologueSize = ((uint8_t*)randomx_program_aarch64_vm_instructions) - ((uint8_t*)randomx_program_aarch64)
 
static const size_t ImulRcpLiteralsEnd = ((uint8_t*)randomx_program_aarch64_imul_rcp_literals_end) - ((uint8_t*)randomx_program_aarch64)
 
static const size_t CalcDatasetItemSize
 
constexpr uint32_t IntRegMap [8] = { 4, 5, 6, 7, 12, 13, 14, 15 }
 
constexpr size_t MaxRandomXInstrCodeSize = 32
 
constexpr size_t MaxSuperscalarInstrSize = 14
 
constexpr size_t SuperscalarProgramHeader = 128
 
constexpr size_t CodeAlign = 4096
 
constexpr size_t ReserveCodeSize = CodeAlign
 
constexpr size_t RandomXCodeSize = alignSize(ReserveCodeSize + MaxRandomXInstrCodeSize * RANDOMX_PROGRAM_SIZE, CodeAlign)
 
constexpr size_t SuperscalarSize = alignSize(ReserveCodeSize + (SuperscalarProgramHeader + MaxSuperscalarInstrSize * SuperscalarMaxSize) * RANDOMX_CACHE_ACCESSES, CodeAlign)
 
constexpr int32_t superScalarHashOffset = RandomXCodeSize
 
const uint8_tcodePrologue = ADDR(randomx_program_prologue)
 
const uint8_tcodeLoopBegin = ADDR(randomx_program_loop_begin)
 
const uint8_tcodeLoopLoad = ADDR(randomx_program_loop_load)
 
const uint8_tcodeProgamStart = ADDR(randomx_program_start)
 
const uint8_tcodeReadDataset = ADDR(randomx_program_read_dataset)
 
const uint8_tcodeReadDatasetLightSshInit = ADDR(randomx_program_read_dataset_sshash_init)
 
const uint8_tcodeReadDatasetLightSshFin = ADDR(randomx_program_read_dataset_sshash_fin)
 
const uint8_tcodeDatasetInit = ADDR(randomx_dataset_init)
 
const uint8_tcodeLoopStore = ADDR(randomx_program_loop_store)
 
const uint8_tcodeLoopEnd = ADDR(randomx_program_loop_end)
 
const uint8_tcodeEpilogue = ADDR(randomx_program_epilogue)
 
const uint8_tcodeProgramEnd = ADDR(randomx_program_end)
 
const uint8_tcodeShhLoad = ADDR(randomx_sshash_load)
 
const uint8_tcodeShhPrefetch = ADDR(randomx_sshash_prefetch)
 
const uint8_tcodeShhEnd = ADDR(randomx_sshash_end)
 
const uint8_tcodeShhInit = ADDR(randomx_sshash_init)
 
const int32_t prologueSize = codeLoopBegin - codePrologue
 
const int32_t loopLoadSize = codeProgamStart - codeLoopLoad
 
const int32_t readDatasetSize = codeReadDatasetLightSshInit - codeReadDataset
 
const int32_t readDatasetLightInitSize = codeReadDatasetLightSshFin - codeReadDatasetLightSshInit
 
const int32_t readDatasetLightFinSize = codeLoopStore - codeReadDatasetLightSshFin
 
const int32_t loopStoreSize = codeLoopEnd - codeLoopStore
 
const int32_t datasetInitSize = codeEpilogue - codeDatasetInit
 
const int32_t epilogueSize = codeShhLoad - codeEpilogue
 
const int32_t codeSshLoadSize = codeShhPrefetch - codeShhLoad
 
const int32_t codeSshPrefetchSize = codeShhEnd - codeShhPrefetch
 
const int32_t codeSshInitSize = codeProgramEnd - codeShhInit
 
const int32_t epilogueOffset = CodeSize - epilogueSize
 
static const uint8_t REX_ADD_RR [] = { 0x4d, 0x03 }
 
static const uint8_t REX_ADD_RM [] = { 0x4c, 0x03 }
 
static const uint8_t REX_SUB_RR [] = { 0x4d, 0x2b }
 
static const uint8_t REX_SUB_RM [] = { 0x4c, 0x2b }
 
static const uint8_t REX_MOV_RR [] = { 0x41, 0x8b }
 
static const uint8_t REX_MOV_RR64 [] = { 0x49, 0x8b }
 
static const uint8_t REX_MOV_R64R [] = { 0x4c, 0x8b }
 
static const uint8_t REX_IMUL_RR [] = { 0x4d, 0x0f, 0xaf }
 
static const uint8_t REX_IMUL_RRI [] = { 0x4d, 0x69 }
 
static const uint8_t REX_IMUL_RM [] = { 0x4c, 0x0f, 0xaf }
 
static const uint8_t REX_MUL_R [] = { 0x49, 0xf7 }
 
static const uint8_t REX_MUL_M [] = { 0x48, 0xf7 }
 
static const uint8_t REX_81 [] = { 0x49, 0x81 }
 
static const uint8_t AND_EAX_I = 0x25
 
static const uint8_t MOV_EAX_I = 0xb8
 
static const uint8_t MOV_RAX_I [] = { 0x48, 0xb8 }
 
static const uint8_t MOV_RCX_I [] = { 0x48, 0xb9 }
 
static const uint8_t REX_LEA [] = { 0x4f, 0x8d }
 
static const uint8_t REX_MUL_MEM [] = { 0x48, 0xf7, 0x24, 0x0e }
 
static const uint8_t REX_IMUL_MEM [] = { 0x48, 0xf7, 0x2c, 0x0e }
 
static const uint8_t REX_SHR_RAX [] = { 0x48, 0xc1, 0xe8 }
 
static const uint8_t RAX_ADD_SBB_1 [] = { 0x48, 0x83, 0xC0, 0x01, 0x48, 0x83, 0xD8, 0x00 }
 
static const uint8_t MUL_RCX [] = { 0x48, 0xf7, 0xe1 }
 
static const uint8_t REX_SHR_RDX [] = { 0x48, 0xc1, 0xea }
 
static const uint8_t REX_SH [] = { 0x49, 0xc1 }
 
static const uint8_t MOV_RCX_RAX_SAR_RCX_63 [] = { 0x48, 0x89, 0xc1, 0x48, 0xc1, 0xf9, 0x3f }
 
static const uint8_t AND_ECX_I [] = { 0x81, 0xe1 }
 
static const uint8_t ADD_RAX_RCX [] = { 0x48, 0x01, 0xC8 }
 
static const uint8_t SAR_RAX_I8 [] = { 0x48, 0xC1, 0xF8 }
 
static const uint8_t NEG_RAX [] = { 0x48, 0xF7, 0xD8 }
 
static const uint8_t ADD_R_RAX [] = { 0x4C, 0x03 }
 
static const uint8_t XOR_EAX_EAX [] = { 0x33, 0xC0 }
 
static const uint8_t ADD_RDX_R [] = { 0x4c, 0x01 }
 
static const uint8_t SUB_RDX_R [] = { 0x4c, 0x29 }
 
static const uint8_t SAR_RDX_I8 [] = { 0x48, 0xC1, 0xFA }
 
static const uint8_t TEST_RDX_RDX [] = { 0x48, 0x85, 0xD2 }
 
static const uint8_t SETS_AL_ADD_RDX_RAX [] = { 0x0F, 0x98, 0xC0, 0x48, 0x03, 0xD0 }
 
static const uint8_t REX_NEG [] = { 0x49, 0xF7 }
 
static const uint8_t REX_XOR_RR [] = { 0x4D, 0x33 }
 
static const uint8_t REX_XOR_RI [] = { 0x49, 0x81 }
 
static const uint8_t REX_XOR_RM [] = { 0x4c, 0x33 }
 
static const uint8_t REX_ROT_CL [] = { 0x49, 0xd3 }
 
static const uint8_t REX_ROT_I8 [] = { 0x49, 0xc1 }
 
static const uint8_t SHUFPD [] = { 0x66, 0x0f, 0xc6 }
 
static const uint8_t REX_ADDPD [] = { 0x66, 0x41, 0x0f, 0x58 }
 
static const uint8_t REX_CVTDQ2PD_XMM12 [] = { 0xf3, 0x44, 0x0f, 0xe6, 0x24, 0x06 }
 
static const uint8_t REX_SUBPD [] = { 0x66, 0x41, 0x0f, 0x5c }
 
static const uint8_t REX_XORPS [] = { 0x41, 0x0f, 0x57 }
 
static const uint8_t REX_MULPD [] = { 0x66, 0x41, 0x0f, 0x59 }
 
static const uint8_t REX_MAXPD [] = { 0x66, 0x41, 0x0f, 0x5f }
 
static const uint8_t REX_DIVPD [] = { 0x66, 0x41, 0x0f, 0x5e }
 
static const uint8_t SQRTPD [] = { 0x66, 0x0f, 0x51 }
 
static const uint8_t AND_OR_MOV_LDMXCSR [] = { 0x25, 0x00, 0x60, 0x00, 0x00, 0x0D, 0xC0, 0x9F, 0x00, 0x00, 0x50, 0x0F, 0xAE, 0x14, 0x24, 0x58 }
 
static const uint8_t ROL_RAX [] = { 0x48, 0xc1, 0xc0 }
 
static const uint8_t XOR_ECX_ECX [] = { 0x33, 0xC9 }
 
static const uint8_t REX_CMP_R32I [] = { 0x41, 0x81 }
 
static const uint8_t REX_CMP_M32I [] = { 0x81, 0x3c, 0x06 }
 
static const uint8_t MOVAPD [] = { 0x66, 0x0f, 0x29 }
 
static const uint8_t REX_MOV_MR [] = { 0x4c, 0x89 }
 
static const uint8_t REX_XOR_EAX [] = { 0x41, 0x33 }
 
static const uint8_t SUB_EBX [] = { 0x83, 0xEB, 0x01 }
 
static const uint8_t JNZ [] = { 0x0f, 0x85 }
 
static const uint8_t JMP = 0xe9
 
static const uint8_t REX_XOR_RAX_R64 [] = { 0x49, 0x33 }
 
static const uint8_t REX_XCHG [] = { 0x4d, 0x87 }
 
static const uint8_t REX_ANDPS_XMM12 [] = { 0x45, 0x0F, 0x54, 0xE5, 0x45, 0x0F, 0x56, 0xE6 }
 
static const uint8_t REX_PADD [] = { 0x66, 0x44, 0x0f }
 
static const uint8_t PADD_OPCODES [] = { 0xfc, 0xfd, 0xfe, 0xd4 }
 
static const uint8_t CALL = 0xe8
 
static const uint8_t REX_ADD_I [] = { 0x49, 0x81 }
 
static const uint8_t REX_TEST [] = { 0x49, 0xF7 }
 
static const uint8_t JZ [] = { 0x0f, 0x84 }
 
static const uint8_t RET = 0xc3
 
static const uint8_t LEA_32 [] = { 0x41, 0x8d }
 
static const uint8_t MOVNTI [] = { 0x4c, 0x0f, 0xc3 }
 
static const uint8_t ADD_EBX_I [] = { 0x81, 0xc3 }
 
static const uint8_t NOP1 [] = { 0x90 }
 
static const uint8_t NOP2 [] = { 0x66, 0x90 }
 
static const uint8_t NOP3 [] = { 0x66, 0x66, 0x90 }
 
static const uint8_t NOP4 [] = { 0x0F, 0x1F, 0x40, 0x00 }
 
static const uint8_t NOP5 [] = { 0x0F, 0x1F, 0x44, 0x00, 0x00 }
 
static const uint8_t NOP6 [] = { 0x66, 0x0F, 0x1F, 0x44, 0x00, 0x00 }
 
static const uint8_t NOP7 [] = { 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00 }
 
static const uint8_t NOP8 [] = { 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }
 
static const uint8_tNOPX [] = { NOP1, NOP2, NOP3, NOP4, NOP5, NOP6, NOP7, NOP8 }
 
const MacroOp IMULH_R_ops_array [] = { MacroOp::Mov_rr, MacroOp::Mul_r, MacroOp::Mov_rr }
 
const MacroOp ISMULH_R_ops_array [] = { MacroOp::Mov_rr, MacroOp::Imul_r, MacroOp::Mov_rr }
 
const MacroOp IMUL_RCP_ops_array [] = { MacroOp::Mov_ri64, MacroOp(MacroOp::Imul_rr, true) }
 
const int buffer0 [] = { 4, 8, 4 }
 
const int buffer1 [] = { 7, 3, 3, 3 }
 
const int buffer2 [] = { 3, 7, 3, 3 }
 
const int buffer3 [] = { 4, 9, 3 }
 
const int buffer4 [] = { 4, 4, 4, 4 }
 
const int buffer5 [] = { 3, 3, 10 }
 
const SuperscalarInstructionInfoslot_3 [] = { &SuperscalarInstructionInfo::ISUB_R, &SuperscalarInstructionInfo::IXOR_R }
 
const SuperscalarInstructionInfoslot_3L [] = { &SuperscalarInstructionInfo::ISUB_R, &SuperscalarInstructionInfo::IXOR_R, &SuperscalarInstructionInfo::IMULH_R, &SuperscalarInstructionInfo::ISMULH_R }
 
const SuperscalarInstructionInfoslot_4 [] = { &SuperscalarInstructionInfo::IROR_C, &SuperscalarInstructionInfo::IADD_RS }
 
const SuperscalarInstructionInfoslot_7 [] = { &SuperscalarInstructionInfo::IXOR_C7, &SuperscalarInstructionInfo::IADD_C7 }
 
const SuperscalarInstructionInfoslot_8 [] = { &SuperscalarInstructionInfo::IXOR_C8, &SuperscalarInstructionInfo::IADD_C8 }
 
const SuperscalarInstructionInfoslot_9 [] = { &SuperscalarInstructionInfo::IXOR_C9, &SuperscalarInstructionInfo::IADD_C9 }
 
const SuperscalarInstructionInfoslot_10 = &SuperscalarInstructionInfo::IMUL_RCP
 
constexpr int CYCLE_MAP_SIZE = RANDOMX_SUPERSCALAR_LATENCY + 4
 
constexpr int LOOK_FORWARD_CYCLES = 4
 
constexpr int MAX_THROWAWAY_COUNT = 256
 
static volatile rx_vec_i128 aesDummy
 

Typedef Documentation

◆ addr_t

using randomx::addr_t = typedef uint32_t

◆ CacheDeallocFunc

typedef void() randomx::CacheDeallocFunc(randomx_cache *)

◆ CacheInitializeFunc

typedef void() randomx::CacheInitializeFunc(randomx_cache *, const void *, size_t)

◆ CompiledLightVmDefault

◆ CompiledLightVmDefaultSecure

◆ CompiledLightVmHardAes

◆ CompiledLightVmHardAesSecure

◆ CompiledLightVmLargePage

◆ CompiledLightVmLargePageHardAes

◆ CompiledLightVmLargePageHardAesSecure

◆ CompiledLightVmLargePageSecure

◆ CompiledVmDefault

◆ CompiledVmDefaultSecure

◆ CompiledVmHardAes

◆ CompiledVmHardAesSecure

◆ CompiledVmLargePage

◆ CompiledVmLargePageHardAes

◆ CompiledVmLargePageHardAesSecure

◆ CompiledVmLargePageSecure

◆ DatasetDeallocFunc

typedef void() randomx::DatasetDeallocFunc(randomx_dataset *)

◆ DatasetInitFunc

typedef void() randomx::DatasetInitFunc(randomx_cache *cache, uint8_t *dataset, uint32_t startBlock, uint32_t endBlock)

◆ DefaultAllocator

◆ InstructionFormatter

typedef void(Instruction::* randomx::InstructionFormatter) (std::ostream &) const

◆ InstructionGenBytecode

typedef void(BytecodeMachine::* randomx::InstructionGenBytecode) (RANDOMX_GEN_ARGS)

◆ InstructionGenerator

typedef void(AssemblyGeneratorX86::* randomx::InstructionGenerator) (Instruction &, int)

◆ InstructionGeneratorA64

typedef void(JitCompilerA64::* randomx::InstructionGeneratorA64) (Instruction &, uint32_t &)

◆ InstructionGeneratorX86

typedef void(JitCompilerX86::* randomx::InstructionGeneratorX86) (Instruction &, int)

◆ int_reg_t

using randomx::int_reg_t = typedef uint64_t

◆ InterpretedLightVmDefault

◆ InterpretedLightVmHardAes

◆ InterpretedLightVmLargePage

◆ InterpretedLightVmLargePageHardAes

◆ InterpretedVmDefault

◆ InterpretedVmHardAes

◆ InterpretedVmLargePage

◆ InterpretedVmLargePageHardAes

◆ JitCompiler

◆ ProgramFunc

typedef void() randomx::ProgramFunc(RegisterFile &, MemoryRegisters &, uint8_t *, uint64_t)

Enumeration Type Documentation

◆ InstructionType

enum class randomx::InstructionType : uint16_t
strong
Enumerator
IADD_RS 
IADD_M 
ISUB_R 
ISUB_M 
IMUL_R 
IMUL_M 
IMULH_R 
IMULH_M 
ISMULH_R 
ISMULH_M 
IMUL_RCP 
INEG_R 
IXOR_R 
IXOR_M 
IROR_R 
IROL_R 
ISWAP_R 
FSWAP_R 
FADD_R 
FADD_M 
FSUB_R 
FSUB_M 
FSCAL_R 
FMUL_R 
FDIV_M 
FSQRT_R 
CBRANCH 
CFROUND 
ISTORE 
NOP 

◆ SuperscalarInstructionType

Enumerator
ISUB_R 
IXOR_R 
IADD_RS 
IMUL_R 
IROR_C 
IADD_C7 
IXOR_C7 
IADD_C8 
IXOR_C8 
IADD_C9 
IXOR_C9 
IMULH_R 
ISMULH_R 
IMUL_RCP 
COUNT 
INVALID 

Function Documentation

◆ deallocCache()

template<class Allocator >
void randomx::deallocCache ( randomx_cache cache)

◆ deallocCache< DefaultAllocator >()

template void randomx::deallocCache< DefaultAllocator > ( randomx_cache cache)

◆ deallocCache< LargePageAllocator >()

◆ deallocDataset()

template<class Allocator >
void randomx::deallocDataset ( randomx_dataset dataset)

◆ executeSuperscalar()

void randomx::executeSuperscalar ( int_reg_t(&)  r[8],
SuperscalarProgram prog,
std::vector< uint64_t > *  reciprocals 
)

◆ generateSuperscalar()

void randomx::generateSuperscalar ( SuperscalarProgram prog,
Blake2Generator gen 
)

◆ getFloatMask()

static uint64_t randomx::getFloatMask ( uint64_t  entropy)
inlinestatic

◆ getMixBlock()

static uint8_t * randomx::getMixBlock ( uint64_t  registerValue,
uint8_t memory 
)
inlinestatic

◆ getSmallPositiveFloatBits()

static uint64_t randomx::getSmallPositiveFloatBits ( uint64_t  entropy)
inlinestatic

◆ getStaticExponent()

static uint64_t randomx::getStaticExponent ( uint64_t  entropy)
inlinestatic

◆ initCache()

void randomx::initCache ( randomx_cache cache,
const void *  key,
size_t  keySize 
)

◆ initCacheCompile()

void randomx::initCacheCompile ( randomx_cache cache,
const void *  key,
size_t  keySize 
)

◆ initDataset()

void randomx::initDataset ( randomx_cache cache,
uint8_t dataset,
uint32_t  startItem,
uint32_t  endItem 
)

◆ initDatasetItem()

void randomx::initDatasetItem ( randomx_cache cache,
uint8_t out,
uint64_t  itemNumber 
)

◆ isMultiplication()

static bool randomx::isMultiplication ( SuperscalarInstructionType  type)
static

◆ isZeroOrPowerOf2()

bool randomx::isZeroOrPowerOf2 ( uint64_t  x)
inline

◆ Log2()

template<typename T >
static constexpr size_t randomx::Log2 ( T  value)
staticconstexpr

◆ OPCODE_CEIL_DECLARE() [1/30]

randomx::OPCODE_CEIL_DECLARE ( CBRANCH  ,
FSQRT_R   
)

◆ OPCODE_CEIL_DECLARE() [2/30]

randomx::OPCODE_CEIL_DECLARE ( CFROUND  ,
CBRANCH   
)

◆ OPCODE_CEIL_DECLARE() [3/30]

randomx::OPCODE_CEIL_DECLARE ( FADD_M  ,
FADD_R   
)

◆ OPCODE_CEIL_DECLARE() [4/30]

randomx::OPCODE_CEIL_DECLARE ( FADD_R  ,
FSWAP_R   
)

◆ OPCODE_CEIL_DECLARE() [5/30]

randomx::OPCODE_CEIL_DECLARE ( FDIV_M  ,
FMUL_R   
)

◆ OPCODE_CEIL_DECLARE() [6/30]

randomx::OPCODE_CEIL_DECLARE ( FMUL_R  ,
FSCAL_R   
)

◆ OPCODE_CEIL_DECLARE() [7/30]

randomx::OPCODE_CEIL_DECLARE ( FSCAL_R  ,
FSUB_M   
)

◆ OPCODE_CEIL_DECLARE() [8/30]

randomx::OPCODE_CEIL_DECLARE ( FSQRT_R  ,
FDIV_M   
)

◆ OPCODE_CEIL_DECLARE() [9/30]

randomx::OPCODE_CEIL_DECLARE ( FSUB_M  ,
FSUB_R   
)

◆ OPCODE_CEIL_DECLARE() [10/30]

randomx::OPCODE_CEIL_DECLARE ( FSUB_R  ,
FADD_M   
)

◆ OPCODE_CEIL_DECLARE() [11/30]

randomx::OPCODE_CEIL_DECLARE ( FSWAP_R  ,
ISWAP_R   
)

◆ OPCODE_CEIL_DECLARE() [12/30]

randomx::OPCODE_CEIL_DECLARE ( IADD_M  ,
IADD_RS   
)

◆ OPCODE_CEIL_DECLARE() [13/30]

randomx::OPCODE_CEIL_DECLARE ( IADD_RS  ,
NULL   
)

◆ OPCODE_CEIL_DECLARE() [14/30]

randomx::OPCODE_CEIL_DECLARE ( IMUL_M  ,
IMUL_R   
)

◆ OPCODE_CEIL_DECLARE() [15/30]

randomx::OPCODE_CEIL_DECLARE ( IMUL_R  ,
ISUB_M   
)

◆ OPCODE_CEIL_DECLARE() [16/30]

randomx::OPCODE_CEIL_DECLARE ( IMUL_RCP  ,
ISMULH_M   
)

◆ OPCODE_CEIL_DECLARE() [17/30]

randomx::OPCODE_CEIL_DECLARE ( IMULH_M  ,
IMULH_R   
)

◆ OPCODE_CEIL_DECLARE() [18/30]

randomx::OPCODE_CEIL_DECLARE ( IMULH_R  ,
IMUL_M   
)

◆ OPCODE_CEIL_DECLARE() [19/30]

randomx::OPCODE_CEIL_DECLARE ( INEG_R  ,
IMUL_RCP   
)

◆ OPCODE_CEIL_DECLARE() [20/30]

randomx::OPCODE_CEIL_DECLARE ( IROL_R  ,
IROR_R   
)

◆ OPCODE_CEIL_DECLARE() [21/30]

randomx::OPCODE_CEIL_DECLARE ( IROR_R  ,
IXOR_M   
)

◆ OPCODE_CEIL_DECLARE() [22/30]

randomx::OPCODE_CEIL_DECLARE ( ISMULH_M  ,
ISMULH_R   
)

◆ OPCODE_CEIL_DECLARE() [23/30]

randomx::OPCODE_CEIL_DECLARE ( ISMULH_R  ,
IMULH_M   
)

◆ OPCODE_CEIL_DECLARE() [24/30]

randomx::OPCODE_CEIL_DECLARE ( ISTORE  ,
CFROUND   
)

◆ OPCODE_CEIL_DECLARE() [25/30]

randomx::OPCODE_CEIL_DECLARE ( ISUB_M  ,
ISUB_R   
)

◆ OPCODE_CEIL_DECLARE() [26/30]

randomx::OPCODE_CEIL_DECLARE ( ISUB_R  ,
IADD_M   
)

◆ OPCODE_CEIL_DECLARE() [27/30]

randomx::OPCODE_CEIL_DECLARE ( ISWAP_R  ,
IROL_R   
)

◆ OPCODE_CEIL_DECLARE() [28/30]

randomx::OPCODE_CEIL_DECLARE ( IXOR_M  ,
IXOR_R   
)

◆ OPCODE_CEIL_DECLARE() [29/30]

randomx::OPCODE_CEIL_DECLARE ( IXOR_R  ,
INEG_R   
)

◆ OPCODE_CEIL_DECLARE() [30/30]

randomx::OPCODE_CEIL_DECLARE ( NOP  ,
ISTORE   
)

◆ scheduleMop()

template<bool commit>
static int randomx::scheduleMop ( const MacroOp mop,
ExecutionPort::type(&)  portBusy[CYCLE_MAP_SIZE][3],
int  cycle,
int  depCycle 
)
static

◆ scheduleUop()

template<bool commit>
static int randomx::scheduleUop ( ExecutionPort::type  uop,
ExecutionPort::type(&)  portBusy[CYCLE_MAP_SIZE][3],
int  cycle 
)
static

◆ selectArgonImpl()

randomx_argon2_impl * randomx::selectArgonImpl ( randomx_flags  flags)
inline

◆ selectRegister()

static bool randomx::selectRegister ( std::vector< int > &  availableRegisters,
Blake2Generator gen,
int &  reg 
)
static

Variable Documentation

◆ ADD_EBX_I

const uint8_t randomx::ADD_EBX_I[] = { 0x81, 0xc3 }
static

◆ ADD_R_RAX

const uint8_t randomx::ADD_R_RAX[] = { 0x4C, 0x03 }
static

◆ ADD_RAX_RCX

const uint8_t randomx::ADD_RAX_RCX[] = { 0x48, 0x01, 0xC8 }
static

◆ ADD_RDX_R

const uint8_t randomx::ADD_RDX_R[] = { 0x4c, 0x01 }
static

◆ aesDummy

volatile rx_vec_i128 randomx::aesDummy
static

◆ AND_EAX_I

const uint8_t randomx::AND_EAX_I = 0x25
static

◆ AND_ECX_I

const uint8_t randomx::AND_ECX_I[] = { 0x81, 0xe1 }
static

◆ AND_OR_MOV_LDMXCSR

const uint8_t randomx::AND_OR_MOV_LDMXCSR[] = { 0x25, 0x00, 0x60, 0x00, 0x00, 0x0D, 0xC0, 0x9F, 0x00, 0x00, 0x50, 0x0F, 0xAE, 0x14, 0x24, 0x58 }
static

◆ ArgonBlockSize

constexpr uint32_t randomx::ArgonBlockSize = 1024
constexpr

◆ ArgonSaltSize

constexpr int randomx::ArgonSaltSize = sizeof("" RANDOMX_ARGON_SALT) - 1
constexpr

◆ buffer0

const int randomx::buffer0[] = { 4, 8, 4 }

◆ buffer1

const int randomx::buffer1[] = { 7, 3, 3, 3 }

◆ buffer2

const int randomx::buffer2[] = { 3, 7, 3, 3 }

◆ buffer3

const int randomx::buffer3[] = { 4, 9, 3 }

◆ buffer4

const int randomx::buffer4[] = { 4, 4, 4, 4 }

◆ buffer5

const int randomx::buffer5[] = { 3, 3, 10 }

◆ CacheLineAlignMask

constexpr uint32_t randomx::CacheLineAlignMask = (RANDOMX_DATASET_BASE_SIZE - 1) & ~(CacheLineSize - 1)
constexpr

◆ CacheLineSize

constexpr size_t randomx::CacheLineSize = RANDOMX_DATASET_ITEM_SIZE
constexpr

◆ CacheSize

constexpr uint32_t randomx::CacheSize = RANDOMX_ARGON_MEMORY * ArgonBlockSize
constexpr

◆ CalcDatasetItemSize

const size_t randomx::CalcDatasetItemSize
static
Initial value:
=
((RANDOMX_SUPERSCALAR_LATENCY * 3) + 2) * 16 +
) +
#define RANDOMX_SUPERSCALAR_LATENCY
Definition: configuration.h:47
#define RANDOMX_CACHE_ACCESSES
Definition: configuration.h:44
void randomx_calc_dataset_item_aarch64()
void randomx_calc_dataset_item_aarch64_store_result()
void randomx_calc_dataset_item_aarch64_prefetch()
void randomx_calc_dataset_item_aarch64_mix()
void randomx_calc_dataset_item_aarch64_end()
unsigned char uint8_t
Definition: stdint.h:124

◆ CALL

const uint8_t randomx::CALL = 0xe8
static

◆ ceil_NULL

constexpr int randomx::ceil_NULL = 0
constexpr

◆ CodeAlign

constexpr size_t randomx::CodeAlign = 4096
constexpr

◆ codeDatasetInit

const uint8_t* randomx::codeDatasetInit = ADDR(randomx_dataset_init)

◆ codeEpilogue

const uint8_t* randomx::codeEpilogue = ADDR(randomx_program_epilogue)

◆ codeLoopBegin

const uint8_t* randomx::codeLoopBegin = ADDR(randomx_program_loop_begin)

◆ codeLoopEnd

const uint8_t* randomx::codeLoopEnd = ADDR(randomx_program_loop_end)

◆ codeLoopLoad

const uint8_t* randomx::codeLoopLoad = ADDR(randomx_program_loop_load)

◆ codeLoopStore

const uint8_t* randomx::codeLoopStore = ADDR(randomx_program_loop_store)

◆ codeProgamStart

const uint8_t* randomx::codeProgamStart = ADDR(randomx_program_start)

◆ codeProgramEnd

const uint8_t* randomx::codeProgramEnd = ADDR(randomx_program_end)

◆ codePrologue

const uint8_t* randomx::codePrologue = ADDR(randomx_program_prologue)

◆ codeReadDataset

const uint8_t* randomx::codeReadDataset = ADDR(randomx_program_read_dataset)

◆ codeReadDatasetLightSshFin

const uint8_t* randomx::codeReadDatasetLightSshFin = ADDR(randomx_program_read_dataset_sshash_fin)

◆ codeReadDatasetLightSshInit

const uint8_t* randomx::codeReadDatasetLightSshInit = ADDR(randomx_program_read_dataset_sshash_init)

◆ codeShhEnd

const uint8_t* randomx::codeShhEnd = ADDR(randomx_sshash_end)

◆ codeShhInit

const uint8_t* randomx::codeShhInit = ADDR(randomx_sshash_init)

◆ codeShhLoad

const uint8_t* randomx::codeShhLoad = ADDR(randomx_sshash_load)

◆ codeShhPrefetch

const uint8_t* randomx::codeShhPrefetch = ADDR(randomx_sshash_prefetch)

◆ CodeSize

constexpr uint32_t randomx::CodeSize = ((uint8_t*)randomx_init_dataset_aarch64_end) - ((uint8_t*)randomx_program_aarch64)
staticconstexpr

◆ codeSshInitSize

const int32_t randomx::codeSshInitSize = codeProgramEnd - codeShhInit

◆ codeSshLoadSize

const int32_t randomx::codeSshLoadSize = codeShhPrefetch - codeShhLoad

◆ codeSshPrefetchSize

const int32_t randomx::codeSshPrefetchSize = codeShhEnd - codeShhPrefetch

◆ ConditionMask

constexpr uint32_t randomx::ConditionMask = ((1 << RANDOMX_JUMP_BITS) - 1)
constexpr

◆ ConditionOffset

constexpr int randomx::ConditionOffset = RANDOMX_JUMP_OFFSET
constexpr

◆ constExponentBits

constexpr uint64_t randomx::constExponentBits = 0x300
constexpr

◆ CYCLE_MAP_SIZE

constexpr int randomx::CYCLE_MAP_SIZE = RANDOMX_SUPERSCALAR_LATENCY + 4
constexpr

◆ DatasetExtraItems

constexpr uint32_t randomx::DatasetExtraItems = RANDOMX_DATASET_EXTRA_SIZE / RANDOMX_DATASET_ITEM_SIZE
constexpr

◆ datasetInitSize

const int32_t randomx::datasetInitSize = codeEpilogue - codeDatasetInit

◆ DatasetSize

constexpr uint64_t randomx::DatasetSize = RANDOMX_DATASET_BASE_SIZE + RANDOMX_DATASET_EXTRA_SIZE
constexpr

◆ dynamicExponentBits

constexpr int randomx::dynamicExponentBits = 4
constexpr

◆ dynamicMantissaMask

constexpr uint64_t randomx::dynamicMantissaMask = (1ULL << (mantissaSize + dynamicExponentBits)) - 1
constexpr

◆ epilogueOffset

const int32_t randomx::epilogueOffset = CodeSize - epilogueSize

◆ epilogueSize

const int32_t randomx::epilogueSize = codeShhLoad - codeEpilogue

◆ exponentBias

constexpr int randomx::exponentBias = 1023
constexpr

◆ exponentMask

constexpr uint64_t randomx::exponentMask = (1ULL << exponentSize) - 1
constexpr

◆ exponentMaskReg

const char* randomx::exponentMaskReg = "xmm14"
static

◆ exponentSize

constexpr int randomx::exponentSize = 11
constexpr

◆ IMUL_RCP_ops_array

const MacroOp randomx::IMUL_RCP_ops_array[] = { MacroOp::Mov_ri64, MacroOp(MacroOp::Imul_rr, true) }

◆ IMULH_R_ops_array

const MacroOp randomx::IMULH_R_ops_array[] = { MacroOp::Mov_rr, MacroOp::Mul_r, MacroOp::Mov_rr }

◆ ImulRcpLiteralsEnd

const size_t randomx::ImulRcpLiteralsEnd = ((uint8_t*)randomx_program_aarch64_imul_rcp_literals_end) - ((uint8_t*)randomx_program_aarch64)
static

◆ IntRegMap

constexpr uint32_t randomx::IntRegMap[8] = { 4, 5, 6, 7, 12, 13, 14, 15 }
constexpr

◆ ISMULH_R_ops_array

const MacroOp randomx::ISMULH_R_ops_array[] = { MacroOp::Mov_rr, MacroOp::Imul_r, MacroOp::Mov_rr }

◆ JMP

const uint8_t randomx::JMP = 0xe9
static

◆ JNZ

const uint8_t randomx::JNZ[] = { 0x0f, 0x85 }
static

◆ JZ

const uint8_t randomx::JZ[] = { 0x0f, 0x84 }
static

◆ LEA_32

const uint8_t randomx::LEA_32[] = { 0x41, 0x8d }
static

◆ LOOK_FORWARD_CYCLES

constexpr int randomx::LOOK_FORWARD_CYCLES = 4
constexpr

◆ loopLoadSize

const int32_t randomx::loopLoadSize = codeProgamStart - codeLoopLoad

◆ loopStoreSize

const int32_t randomx::loopStoreSize = codeLoopEnd - codeLoopStore

◆ MainLoopBegin

const size_t randomx::MainLoopBegin = ((uint8_t*)randomx_program_aarch64_main_loop) - ((uint8_t*)randomx_program_aarch64)
static

◆ mantissaMask

constexpr uint64_t randomx::mantissaMask = (1ULL << mantissaSize) - 1
constexpr

◆ mantissaMaskReg

const char* randomx::mantissaMaskReg = "xmm13"
static

◆ mantissaSize

constexpr int randomx::mantissaSize = 52
constexpr

◆ MAX_THROWAWAY_COUNT

constexpr int randomx::MAX_THROWAWAY_COUNT = 256
constexpr

◆ MaxRandomXInstrCodeSize

constexpr size_t randomx::MaxRandomXInstrCodeSize = 32
constexpr

◆ maxSeedSize

constexpr int randomx::maxSeedSize = 60
constexpr

◆ MaxSuperscalarInstrSize

constexpr size_t randomx::MaxSuperscalarInstrSize = 14
constexpr

◆ MOV_EAX_I

const uint8_t randomx::MOV_EAX_I = 0xb8
static

◆ MOV_RAX_I

const uint8_t randomx::MOV_RAX_I[] = { 0x48, 0xb8 }
static

◆ MOV_RCX_I

const uint8_t randomx::MOV_RCX_I[] = { 0x48, 0xb9 }
static

◆ MOV_RCX_RAX_SAR_RCX_63

const uint8_t randomx::MOV_RCX_RAX_SAR_RCX_63[] = { 0x48, 0x89, 0xc1, 0x48, 0xc1, 0xf9, 0x3f }
static

◆ MOVAPD

const uint8_t randomx::MOVAPD[] = { 0x66, 0x0f, 0x29 }
static

◆ MOVNTI

const uint8_t randomx::MOVNTI[] = { 0x4c, 0x0f, 0xc3 }
static

◆ MUL_RCX

const uint8_t randomx::MUL_RCX[] = { 0x48, 0xf7, 0xe1 }
static

◆ NEG_RAX

const uint8_t randomx::NEG_RAX[] = { 0x48, 0xF7, 0xD8 }
static

◆ NOP1

const uint8_t randomx::NOP1[] = { 0x90 }
static

◆ NOP2

const uint8_t randomx::NOP2[] = { 0x66, 0x90 }
static

◆ NOP3

const uint8_t randomx::NOP3[] = { 0x66, 0x66, 0x90 }
static

◆ NOP4

const uint8_t randomx::NOP4[] = { 0x0F, 0x1F, 0x40, 0x00 }
static

◆ NOP5

const uint8_t randomx::NOP5[] = { 0x0F, 0x1F, 0x44, 0x00, 0x00 }
static

◆ NOP6

const uint8_t randomx::NOP6[] = { 0x66, 0x0F, 0x1F, 0x44, 0x00, 0x00 }
static

◆ NOP7

const uint8_t randomx::NOP7[] = { 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00 }
static

◆ NOP8

const uint8_t randomx::NOP8[] = { 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }
static

◆ NOPX

const uint8_t* randomx::NOPX[] = { NOP1, NOP2, NOP3, NOP4, NOP5, NOP6, NOP7, NOP8 }
static

◆ PADD_OPCODES

const uint8_t randomx::PADD_OPCODES[] = { 0xfc, 0xfd, 0xfe, 0xd4 }
static

◆ PrologueSize

const size_t randomx::PrologueSize = ((uint8_t*)randomx_program_aarch64_vm_instructions) - ((uint8_t*)randomx_program_aarch64)
static

◆ prologueSize

const int32_t randomx::prologueSize = codeLoopBegin - codePrologue

◆ RandomXCodeSize

constexpr size_t randomx::RandomXCodeSize = alignSize(ReserveCodeSize + MaxRandomXInstrCodeSize * RANDOMX_PROGRAM_SIZE, CodeAlign)
constexpr

◆ RAX_ADD_SBB_1

const uint8_t randomx::RAX_ADD_SBB_1[] = { 0x48, 0x83, 0xC0, 0x01, 0x48, 0x83, 0xD8, 0x00 }
static

◆ readDatasetLightFinSize

const int32_t randomx::readDatasetLightFinSize = codeLoopStore - codeReadDatasetLightSshFin

◆ readDatasetLightInitSize

◆ readDatasetSize

◆ regA

const char* randomx::regA[] = { "xmm8", "xmm9", "xmm10", "xmm11" }
static

◆ regE

const char* randomx::regE[] = { "xmm4", "xmm5", "xmm6", "xmm7" }
static

◆ regF

const char* randomx::regF[] = { "xmm0", "xmm1", "xmm2", "xmm3" }
static

◆ regFE

const char* randomx::regFE[] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" }
static

◆ regIc

const char* randomx::regIc = "rbx"
static

◆ regIc32

const char* randomx::regIc32 = "ebx"
static

◆ regIc8

const char* randomx::regIc8 = "bl"
static

◆ RegisterCountFlt

constexpr int randomx::RegisterCountFlt = RegistersCount / 2
constexpr

◆ RegisterNeedsDisplacement

constexpr int randomx::RegisterNeedsDisplacement = 5
constexpr

◆ RegisterNeedsSib

constexpr int randomx::RegisterNeedsSib = 4
constexpr

◆ RegistersCount

constexpr int randomx::RegistersCount = 8
constexpr

◆ regR

const char* randomx::regR[] = { "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }
static

◆ regR32

const char* randomx::regR32[] = { "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }
static

◆ regScratchpadAddr

const char* randomx::regScratchpadAddr = "rsi"
static

◆ ReserveCodeSize

constexpr size_t randomx::ReserveCodeSize = CodeAlign
constexpr

◆ RET

const uint8_t randomx::RET = 0xc3
static

◆ REX_81

const uint8_t randomx::REX_81[] = { 0x49, 0x81 }
static

◆ REX_ADD_I

const uint8_t randomx::REX_ADD_I[] = { 0x49, 0x81 }
static

◆ REX_ADD_RM

const uint8_t randomx::REX_ADD_RM[] = { 0x4c, 0x03 }
static

◆ REX_ADD_RR

const uint8_t randomx::REX_ADD_RR[] = { 0x4d, 0x03 }
static

◆ REX_ADDPD

const uint8_t randomx::REX_ADDPD[] = { 0x66, 0x41, 0x0f, 0x58 }
static

◆ REX_ANDPS_XMM12

const uint8_t randomx::REX_ANDPS_XMM12[] = { 0x45, 0x0F, 0x54, 0xE5, 0x45, 0x0F, 0x56, 0xE6 }
static

◆ REX_CMP_M32I

const uint8_t randomx::REX_CMP_M32I[] = { 0x81, 0x3c, 0x06 }
static

◆ REX_CMP_R32I

const uint8_t randomx::REX_CMP_R32I[] = { 0x41, 0x81 }
static

◆ REX_CVTDQ2PD_XMM12

const uint8_t randomx::REX_CVTDQ2PD_XMM12[] = { 0xf3, 0x44, 0x0f, 0xe6, 0x24, 0x06 }
static

◆ REX_DIVPD

const uint8_t randomx::REX_DIVPD[] = { 0x66, 0x41, 0x0f, 0x5e }
static

◆ REX_IMUL_MEM

const uint8_t randomx::REX_IMUL_MEM[] = { 0x48, 0xf7, 0x2c, 0x0e }
static

◆ REX_IMUL_RM

const uint8_t randomx::REX_IMUL_RM[] = { 0x4c, 0x0f, 0xaf }
static

◆ REX_IMUL_RR

const uint8_t randomx::REX_IMUL_RR[] = { 0x4d, 0x0f, 0xaf }
static

◆ REX_IMUL_RRI

const uint8_t randomx::REX_IMUL_RRI[] = { 0x4d, 0x69 }
static

◆ REX_LEA

const uint8_t randomx::REX_LEA[] = { 0x4f, 0x8d }
static

◆ REX_MAXPD

const uint8_t randomx::REX_MAXPD[] = { 0x66, 0x41, 0x0f, 0x5f }
static

◆ REX_MOV_MR

const uint8_t randomx::REX_MOV_MR[] = { 0x4c, 0x89 }
static

◆ REX_MOV_R64R

const uint8_t randomx::REX_MOV_R64R[] = { 0x4c, 0x8b }
static

◆ REX_MOV_RR

const uint8_t randomx::REX_MOV_RR[] = { 0x41, 0x8b }
static

◆ REX_MOV_RR64

const uint8_t randomx::REX_MOV_RR64[] = { 0x49, 0x8b }
static

◆ REX_MUL_M

const uint8_t randomx::REX_MUL_M[] = { 0x48, 0xf7 }
static

◆ REX_MUL_MEM

const uint8_t randomx::REX_MUL_MEM[] = { 0x48, 0xf7, 0x24, 0x0e }
static

◆ REX_MUL_R

const uint8_t randomx::REX_MUL_R[] = { 0x49, 0xf7 }
static

◆ REX_MULPD

const uint8_t randomx::REX_MULPD[] = { 0x66, 0x41, 0x0f, 0x59 }
static

◆ REX_NEG

const uint8_t randomx::REX_NEG[] = { 0x49, 0xF7 }
static

◆ REX_PADD

const uint8_t randomx::REX_PADD[] = { 0x66, 0x44, 0x0f }
static

◆ REX_ROT_CL

const uint8_t randomx::REX_ROT_CL[] = { 0x49, 0xd3 }
static

◆ REX_ROT_I8

const uint8_t randomx::REX_ROT_I8[] = { 0x49, 0xc1 }
static

◆ REX_SH

const uint8_t randomx::REX_SH[] = { 0x49, 0xc1 }
static

◆ REX_SHR_RAX

const uint8_t randomx::REX_SHR_RAX[] = { 0x48, 0xc1, 0xe8 }
static

◆ REX_SHR_RDX

const uint8_t randomx::REX_SHR_RDX[] = { 0x48, 0xc1, 0xea }
static

◆ REX_SUB_RM

const uint8_t randomx::REX_SUB_RM[] = { 0x4c, 0x2b }
static

◆ REX_SUB_RR

const uint8_t randomx::REX_SUB_RR[] = { 0x4d, 0x2b }
static

◆ REX_SUBPD

const uint8_t randomx::REX_SUBPD[] = { 0x66, 0x41, 0x0f, 0x5c }
static

◆ REX_TEST

const uint8_t randomx::REX_TEST[] = { 0x49, 0xF7 }
static

◆ REX_XCHG

const uint8_t randomx::REX_XCHG[] = { 0x4d, 0x87 }
static

◆ REX_XOR_EAX

const uint8_t randomx::REX_XOR_EAX[] = { 0x41, 0x33 }
static

◆ REX_XOR_RAX_R64

const uint8_t randomx::REX_XOR_RAX_R64[] = { 0x49, 0x33 }
static

◆ REX_XOR_RI

const uint8_t randomx::REX_XOR_RI[] = { 0x49, 0x81 }
static

◆ REX_XOR_RM

const uint8_t randomx::REX_XOR_RM[] = { 0x4c, 0x33 }
static

◆ REX_XOR_RR

const uint8_t randomx::REX_XOR_RR[] = { 0x4D, 0x33 }
static

◆ REX_XORPS

const uint8_t randomx::REX_XORPS[] = { 0x41, 0x0f, 0x57 }
static

◆ ROL_RAX

const uint8_t randomx::ROL_RAX[] = { 0x48, 0xc1, 0xc0 }
static

◆ SAR_RAX_I8

const uint8_t randomx::SAR_RAX_I8[] = { 0x48, 0xC1, 0xF8 }
static

◆ SAR_RDX_I8

const uint8_t randomx::SAR_RDX_I8[] = { 0x48, 0xC1, 0xFA }
static

◆ scaleMaskReg

const char* randomx::scaleMaskReg = "xmm15"
static

◆ ScratchpadL1

constexpr uint32_t randomx::ScratchpadL1 = RANDOMX_SCRATCHPAD_L1 / sizeof(int_reg_t)
constexpr

◆ ScratchpadL1Mask

constexpr int randomx::ScratchpadL1Mask = (ScratchpadL1 - 1) * 8
constexpr

◆ ScratchpadL1Mask16

constexpr int randomx::ScratchpadL1Mask16 = (ScratchpadL1 / 2 - 1) * 16
constexpr

◆ ScratchpadL2

constexpr uint32_t randomx::ScratchpadL2 = RANDOMX_SCRATCHPAD_L2 / sizeof(int_reg_t)
constexpr

◆ ScratchpadL2Mask

constexpr int randomx::ScratchpadL2Mask = (ScratchpadL2 - 1) * 8
constexpr

◆ ScratchpadL2Mask16

constexpr int randomx::ScratchpadL2Mask16 = (ScratchpadL2 / 2 - 1) * 16
constexpr

◆ ScratchpadL3

constexpr uint32_t randomx::ScratchpadL3 = RANDOMX_SCRATCHPAD_L3 / sizeof(int_reg_t)
constexpr

◆ ScratchpadL3Mask

constexpr int randomx::ScratchpadL3Mask = (ScratchpadL3 - 1) * 8
constexpr

◆ ScratchpadL3Mask64

constexpr int randomx::ScratchpadL3Mask64 = (ScratchpadL3 / 8 - 1) * 64
constexpr

◆ ScratchpadSize

constexpr int randomx::ScratchpadSize = RANDOMX_SCRATCHPAD_L3
constexpr

◆ SETS_AL_ADD_RDX_RAX

const uint8_t randomx::SETS_AL_ADD_RDX_RAX[] = { 0x0F, 0x98, 0xC0, 0x48, 0x03, 0xD0 }
static

◆ SHUFPD

const uint8_t randomx::SHUFPD[] = { 0x66, 0x0f, 0xc6 }
static

◆ slot_10

◆ slot_3

◆ slot_3L

◆ slot_4

◆ slot_7

◆ slot_8

◆ slot_9

◆ SQRTPD

const uint8_t randomx::SQRTPD[] = { 0x66, 0x0f, 0x51 }
static

◆ staticExponentBits

constexpr int randomx::staticExponentBits = 4
constexpr

◆ StoreL3Condition

constexpr int randomx::StoreL3Condition = 14
constexpr

◆ SUB_EBX

const uint8_t randomx::SUB_EBX[] = { 0x83, 0xEB, 0x01 }
static

◆ SUB_RDX_R

const uint8_t randomx::SUB_RDX_R[] = { 0x4c, 0x29 }
static

◆ superscalarAdd1

constexpr uint64_t randomx::superscalarAdd1 = 9298411001130361340ULL
constexpr

◆ superscalarAdd2

constexpr uint64_t randomx::superscalarAdd2 = 12065312585734608966ULL
constexpr

◆ superscalarAdd3

constexpr uint64_t randomx::superscalarAdd3 = 9306329213124626780ULL
constexpr

◆ superscalarAdd4

constexpr uint64_t randomx::superscalarAdd4 = 5281919268842080866ULL
constexpr

◆ superscalarAdd5

constexpr uint64_t randomx::superscalarAdd5 = 10536153434571861004ULL
constexpr

◆ superscalarAdd6

constexpr uint64_t randomx::superscalarAdd6 = 3398623926847679864ULL
constexpr

◆ superscalarAdd7

constexpr uint64_t randomx::superscalarAdd7 = 9549104520008361294ULL
constexpr

◆ superScalarHashOffset

constexpr int32_t randomx::superScalarHashOffset = RandomXCodeSize
constexpr

◆ SuperscalarMaxSize

constexpr int randomx::SuperscalarMaxSize = 3 * RANDOMX_SUPERSCALAR_LATENCY + 2
constexpr

◆ superscalarMul0

constexpr uint64_t randomx::superscalarMul0 = 6364136223846793005ULL
constexpr

◆ SuperscalarProgramHeader

constexpr size_t randomx::SuperscalarProgramHeader = 128
constexpr

◆ SuperscalarSize

◆ tempRegx

const char* randomx::tempRegx = "xmm12"
static

◆ TEST_RDX_RDX

const uint8_t randomx::TEST_RDX_RDX[] = { 0x48, 0x85, 0xD2 }
static

◆ trace

constexpr bool randomx::trace = false
constexpr

◆ wtSum

constexpr int randomx::wtSum
constexpr
Initial value:
#define RANDOMX_FREQ_IADD_M
Definition: configuration.h:86
#define RANDOMX_FREQ_IROL_R
Definition: configuration.h:100
#define RANDOMX_FREQ_FMUL_R
Definition: configuration.h:110
#define RANDOMX_FREQ_IMUL_M
Definition: configuration.h:90
#define RANDOMX_FREQ_IXOR_M
Definition: configuration.h:98
#define RANDOMX_FREQ_IMULH_M
Definition: configuration.h:92
#define RANDOMX_FREQ_IROR_R
Definition: configuration.h:99
#define RANDOMX_FREQ_CBRANCH
Definition: configuration.h:115
#define RANDOMX_FREQ_IMUL_R
Definition: configuration.h:89
#define RANDOMX_FREQ_ISTORE
Definition: configuration.h:119
#define RANDOMX_FREQ_FSUB_R
Definition: configuration.h:107
#define RANDOMX_FREQ_FSQRT_R
Definition: configuration.h:112
#define RANDOMX_FREQ_ISWAP_R
Definition: configuration.h:101
#define RANDOMX_FREQ_ISUB_M
Definition: configuration.h:88
#define RANDOMX_FREQ_FADD_M
Definition: configuration.h:106
#define RANDOMX_FREQ_ISMULH_R
Definition: configuration.h:93
#define RANDOMX_FREQ_FSWAP_R
Definition: configuration.h:104
#define RANDOMX_FREQ_IADD_RS
Definition: configuration.h:85
#define RANDOMX_FREQ_CFROUND
Definition: configuration.h:116
#define RANDOMX_FREQ_FSUB_M
Definition: configuration.h:108
#define RANDOMX_FREQ_ISMULH_M
Definition: configuration.h:94
#define RANDOMX_FREQ_INEG_R
Definition: configuration.h:96
#define RANDOMX_FREQ_ISUB_R
Definition: configuration.h:87
#define RANDOMX_FREQ_FSCAL_R
Definition: configuration.h:109
#define RANDOMX_FREQ_FADD_R
Definition: configuration.h:105
#define RANDOMX_FREQ_IMUL_RCP
Definition: configuration.h:95
#define RANDOMX_FREQ_FDIV_M
Definition: configuration.h:111
#define RANDOMX_FREQ_NOP
Definition: configuration.h:122
#define RANDOMX_FREQ_IMULH_R
Definition: configuration.h:91
#define RANDOMX_FREQ_IXOR_R
Definition: configuration.h:97

◆ XOR_EAX_EAX

const uint8_t randomx::XOR_EAX_EAX[] = { 0x33, 0xC0 }
static

◆ XOR_ECX_ECX

const uint8_t randomx::XOR_ECX_ECX[] = { 0x33, 0xC9 }
static