minor bug fixes

This commit is contained in:
Blaise Tine
2022-02-05 06:37:54 -05:00
parent a2342cfd82
commit 703d3faf27
2 changed files with 6 additions and 2 deletions

View File

@@ -450,6 +450,7 @@ std::shared_ptr<Instr> Decoder::decode(uint32_t code) const {
case 0x71: // FCLASS.D, FMV.X.D case 0x71: // FCLASS.D, FMV.X.D
instr->setDestReg(rd, RegType::Integer); instr->setDestReg(rd, RegType::Integer);
instr->setSrcReg(rs1, RegType::Float); instr->setSrcReg(rs1, RegType::Float);
instr->setSrcReg(rs2, RegType::Integer);
break; break;
case 0x68: // FCVT.S.W, FCVT.S.WU, FCVT.S.L, FCVT.S.LU case 0x68: // FCVT.S.W, FCVT.S.WU, FCVT.S.L, FCVT.S.LU
case 0x69: // FCVT.D.W, FCVT.D.WU, FCVT.D.L, FCVT.D.LU case 0x69: // FCVT.D.W, FCVT.D.WU, FCVT.D.L, FCVT.D.LU
@@ -457,6 +458,7 @@ std::shared_ptr<Instr> Decoder::decode(uint32_t code) const {
case 0x79: // FMV.D.X case 0x79: // FMV.D.X
instr->setDestReg(rd, RegType::Float); instr->setDestReg(rd, RegType::Float);
instr->setSrcReg(rs1, RegType::Integer); instr->setSrcReg(rs1, RegType::Integer);
instr->setSrcReg(rs2, RegType::Integer);
break; break;
default: default:
instr->setDestReg(rd, RegType::Float); instr->setDestReg(rd, RegType::Float);

View File

@@ -57,7 +57,9 @@ public:
, has_imm_(false) , has_imm_(false)
, rdest_type_(RegType::None) , rdest_type_(RegType::None)
, rdest_(0) , rdest_(0)
, func2_(0)
, func3_(0) , func3_(0)
, func6_(0)
, func7_(0) { , func7_(0) {
for (uint32_t i = 0; i < MAX_REG_SOURCES; ++i) { for (uint32_t i = 0; i < MAX_REG_SOURCES; ++i) {
rsrc_type_[i] = RegType::None; rsrc_type_[i] = RegType::None;
@@ -121,6 +123,7 @@ private:
uint32_t func2_; uint32_t func2_;
uint32_t func3_; uint32_t func3_;
uint32_t func6_; uint32_t func6_;
uint32_t func7_;
// Vector // Vector
uint32_t vmask_; uint32_t vmask_;
@@ -130,8 +133,7 @@ private:
uint32_t vs3_; uint32_t vs3_;
uint32_t vlmul_; uint32_t vlmul_;
uint32_t vsew_; uint32_t vsew_;
uint32_t vediv_; uint32_t vediv_;
uint32_t func7_;
friend std::ostream &operator<<(std::ostream &, const Instr&); friend std::ostream &operator<<(std::ostream &, const Instr&);
}; };