Fixed non-portable deserialization

This commit is contained in:
tevador
2019-03-11 23:04:34 +01:00
parent 2edf05cedc
commit 958d2bdc15
6 changed files with 68 additions and 63 deletions
+14 -14
View File
@@ -37,7 +37,7 @@ namespace RandomX {
}
void Instruction::genAddressImm(std::ostream& os) const {
os << "L3" << "[" << (imm32 & ScratchpadL3Mask) << "]";
os << "L3" << "[" << (getImm32() & ScratchpadL3Mask) << "]";
}
void Instruction::h_IADD_R(std::ostream& os) const {
@@ -45,7 +45,7 @@ namespace RandomX {
os << "r" << (int)dst << ", r" << (int)src << std::endl;
}
else {
os << "r" << (int)dst << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", " << (int32_t)getImm32() << std::endl;
}
}
@@ -63,7 +63,7 @@ namespace RandomX {
}
void Instruction::h_IADD_RC(std::ostream& os) const {
os << "r" << (int)dst << ", r" << (int)src << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", r" << (int)src << ", " << (int32_t)getImm32() << std::endl;
}
//1 uOP
@@ -72,7 +72,7 @@ namespace RandomX {
os << "r" << (int)dst << ", r" << (int)src << std::endl;
}
else {
os << "r" << (int)dst << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", " << (int32_t)getImm32() << std::endl;
}
}
@@ -90,7 +90,7 @@ namespace RandomX {
}
void Instruction::h_IMUL_9C(std::ostream& os) const {
os << "r" << (int)dst << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", " << (int32_t)getImm32() << std::endl;
}
void Instruction::h_IMUL_R(std::ostream& os) const {
@@ -98,7 +98,7 @@ namespace RandomX {
os << "r" << (int)dst << ", r" << (int)src << std::endl;
}
else {
os << "r" << (int)dst << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", " << (int32_t)getImm32() << std::endl;
}
}
@@ -158,7 +158,7 @@ namespace RandomX {
os << "r" << (int)dst << ", r" << (int)src << std::endl;
}
else {
os << "r" << (int)dst << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", " << (int32_t)getImm32() << std::endl;
}
}
@@ -180,7 +180,7 @@ namespace RandomX {
os << "r" << (int)dst << ", r" << (int)src << std::endl;
}
else {
os << "r" << (int)dst << ", " << (imm32 & 63) << std::endl;
os << "r" << (int)dst << ", " << (getImm32() & 63) << std::endl;
}
}
@@ -189,16 +189,16 @@ namespace RandomX {
os << "r" << (int)dst << ", r" << (int)src << std::endl;
}
else {
os << "r" << (int)dst << ", " << (imm32 & 63) << std::endl;
os << "r" << (int)dst << ", " << (getImm32() & 63) << std::endl;
}
}
void Instruction::h_IMUL_RCP(std::ostream& os) const {
os << "r" << (int)dst << ", " << imm32 << std::endl;
os << "r" << (int)dst << ", " << getImm32() << std::endl;
}
void Instruction::h_ISDIV_C(std::ostream& os) const {
os << "r" << (int)dst << ", " << (int32_t)imm32 << std::endl;
os << "r" << (int)dst << ", " << (int32_t)getImm32() << std::endl;
}
void Instruction::h_ISWAP_R(std::ostream& os) const {
@@ -274,7 +274,7 @@ namespace RandomX {
}
void Instruction::h_CFROUND(std::ostream& os) const {
os << "r" << (int)src << ", " << (imm32 & 63) << std::endl;
os << "r" << (int)src << ", " << (getImm32() & 63) << std::endl;
}
static inline const char* condition(int index) {
@@ -302,13 +302,13 @@ namespace RandomX {
}
void Instruction::h_COND_R(std::ostream& os) const {
os << "r" << (int)dst << ", " << condition((mod >> 2) & 7) << "(r" << (int)src << ", " << (int32_t)imm32 << ")" << std::endl;
os << "r" << (int)dst << ", " << condition((mod >> 2) & 7) << "(r" << (int)src << ", " << (int32_t)getImm32() << ")" << std::endl;
}
void Instruction::h_COND_M(std::ostream& os) const {
os << "r" << (int)dst << ", " << condition((mod >> 2) & 7) << "(";
genAddressReg(os);
os << ", " << (int32_t)imm32 << ")" << std::endl;
os << ", " << (int32_t)getImm32() << ")" << std::endl;
}
void Instruction::h_ISTORE(std::ostream& os) const {