mirror of
https://github.com/wownero/RandomWOW.git
synced 2026-10-17 15:31:46 +02:00
Interpreter with bytecode
Fixed some undefined behavior with signed types Fixed different results on big endian systems Removed unused code files Restored FNEG_R instructions Updated documentation
This commit is contained in:
+7
-4
@@ -24,22 +24,25 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
||||
#include "common.hpp"
|
||||
#include "Instruction.hpp"
|
||||
|
||||
class Pcg32;
|
||||
|
||||
namespace RandomX {
|
||||
|
||||
class Program {
|
||||
public:
|
||||
Instruction& operator()(uint64_t pc) {
|
||||
Instruction& operator()(int pc) {
|
||||
return programBuffer[pc];
|
||||
}
|
||||
void initialize(Pcg32& gen);
|
||||
friend std::ostream& operator<<(std::ostream& os, const Program& p) {
|
||||
p.print(os);
|
||||
return os;
|
||||
}
|
||||
uint64_t getEntropy(int i) {
|
||||
return entropyBuffer[i];
|
||||
}
|
||||
private:
|
||||
void print(std::ostream&) const;
|
||||
uint64_t entropyBuffer[16];
|
||||
Instruction programBuffer[ProgramLength];
|
||||
};
|
||||
|
||||
static_assert(sizeof(Program) % 64 == 0, "Invalid size of class Program");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user