mirror of
https://github.com/wownero/RandomX.git
synced 2026-10-18 16:01:40 +02:00
Assembly code generator for Windows 64-bit
This commit is contained in:
+1
-22
@@ -22,37 +22,17 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include "common.hpp"
|
||||
#include "Instruction.hpp"
|
||||
|
||||
class Pcg32;
|
||||
|
||||
namespace RandomX {
|
||||
|
||||
struct Instruction {
|
||||
uint8_t opcode;
|
||||
uint8_t loca;
|
||||
uint8_t rega;
|
||||
uint8_t locb;
|
||||
uint8_t regb;
|
||||
uint8_t locc;
|
||||
uint8_t regc;
|
||||
uint8_t imm0;
|
||||
uint32_t addr0;
|
||||
union {
|
||||
uint32_t addr1;
|
||||
int32_t imm1;
|
||||
};
|
||||
};
|
||||
|
||||
static_assert(sizeof(Instruction) == 16, "Invalid alignment of struct Instruction");
|
||||
|
||||
class Program {
|
||||
public:
|
||||
Instruction& operator()(uint64_t pc) {
|
||||
return programBuffer[pc];
|
||||
}
|
||||
const char* getName(Instruction& instr) {
|
||||
return instrNames[instr.opcode];
|
||||
}
|
||||
void initialize(Pcg32& gen);
|
||||
friend std::ostream& operator<<(std::ostream& os, const Program& p) {
|
||||
p.print(os);
|
||||
@@ -60,7 +40,6 @@ namespace RandomX {
|
||||
}
|
||||
private:
|
||||
void print(std::ostream&) const;
|
||||
static const char* instrNames[256];
|
||||
Instruction programBuffer[ProgramLength];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user