Monero
Loading...
Searching...
No Matches
superscalar.cpp File Reference
#include "configuration.h"
#include "program.hpp"
#include "blake2/endian.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <iomanip>
#include "superscalar.hpp"
#include "intrin_portable.h"
#include "reciprocal.h"
#include "common.hpp"
Include dependency graph for superscalar.cpp:

Classes

class  randomx::MacroOp
class  randomx::SuperscalarInstructionInfo
class  randomx::DecoderBuffer
class  randomx::RegisterInfo
class  randomx::SuperscalarInstruction

Namespaces

namespace  randomx
namespace  randomx::ExecutionPort

Typedefs

using randomx::ExecutionPort::type = int

Functions

static bool randomx::isMultiplication (SuperscalarInstructionType type)
static bool randomx::selectRegister (std::vector< int > &availableRegisters, Blake2Generator &gen, int &reg)
template<bool commit>
static int randomx::scheduleUop (ExecutionPort::type uop, ExecutionPort::type(&portBusy)[CYCLE_MAP_SIZE][3], int cycle)
template<bool commit>
static int randomx::scheduleMop (const MacroOp &mop, ExecutionPort::type(&portBusy)[CYCLE_MAP_SIZE][3], int cycle, int depCycle)
void randomx::generateSuperscalar (SuperscalarProgram &prog, Blake2Generator &gen)
void randomx::executeSuperscalar (int_reg_t(&r)[8], SuperscalarProgram &prog, std::vector< uint64_t > *reciprocals)

Variables

constexpr type randomx::ExecutionPort::Null = 0
constexpr type randomx::ExecutionPort::P0 = 1
constexpr type randomx::ExecutionPort::P1 = 2
constexpr type randomx::ExecutionPort::P5 = 4
constexpr type randomx::ExecutionPort::P01 = P0 | P1
constexpr type randomx::ExecutionPort::P05 = P0 | P5
constexpr type randomx::ExecutionPort::P015 = P0 | P1 | P5
const MacroOp randomx::IMULH_R_ops_array [] = { MacroOp::Mov_rr, MacroOp::Mul_r, MacroOp::Mov_rr }
const MacroOp randomx::ISMULH_R_ops_array [] = { MacroOp::Mov_rr, MacroOp::Imul_r, MacroOp::Mov_rr }
const MacroOp randomx::IMUL_RCP_ops_array [] = { MacroOp::Mov_ri64, MacroOp(MacroOp::Imul_rr, true) }
const int randomx::buffer0 [] = { 4, 8, 4 }
const int randomx::buffer1 [] = { 7, 3, 3, 3 }
const int randomx::buffer2 [] = { 3, 7, 3, 3 }
const int randomx::buffer3 [] = { 4, 9, 3 }
const int randomx::buffer4 [] = { 4, 4, 4, 4 }
const int randomx::buffer5 [] = { 3, 3, 10 }
const SuperscalarInstructionInforandomx::slot_3 [] = { &SuperscalarInstructionInfo::ISUB_R, &SuperscalarInstructionInfo::IXOR_R }
const SuperscalarInstructionInforandomx::slot_3L [] = { &SuperscalarInstructionInfo::ISUB_R, &SuperscalarInstructionInfo::IXOR_R, &SuperscalarInstructionInfo::IMULH_R, &SuperscalarInstructionInfo::ISMULH_R }
const SuperscalarInstructionInforandomx::slot_4 [] = { &SuperscalarInstructionInfo::IROR_C, &SuperscalarInstructionInfo::IADD_RS }
const SuperscalarInstructionInforandomx::slot_7 [] = { &SuperscalarInstructionInfo::IXOR_C7, &SuperscalarInstructionInfo::IADD_C7 }
const SuperscalarInstructionInforandomx::slot_8 [] = { &SuperscalarInstructionInfo::IXOR_C8, &SuperscalarInstructionInfo::IADD_C8 }
const SuperscalarInstructionInforandomx::slot_9 [] = { &SuperscalarInstructionInfo::IXOR_C9, &SuperscalarInstructionInfo::IADD_C9 }
const SuperscalarInstructionInforandomx::slot_10 = &SuperscalarInstructionInfo::IMUL_RCP
constexpr int randomx::CYCLE_MAP_SIZE = RANDOMX_SUPERSCALAR_LATENCY + 4
constexpr int randomx::LOOK_FORWARD_CYCLES = 4
constexpr int randomx::MAX_THROWAWAY_COUNT = 256