1
0
forked from Rativel/BurritOS

Added OPIW OPs and made some fix (see description)

Fix some warning which appear on clippy
Fix print with 2 OPIW operations
Fix doc in mod.rs
This commit is contained in:
Quentin Legot
2023-02-04 18:16:52 +01:00
parent 83c212199e
commit 3762547402
4 changed files with 38 additions and 11 deletions

View File

@@ -91,9 +91,9 @@ pub fn print(ins: Instruction, pc: i32) -> String { //TODO pc should be u64
RISCV_OPIW => {
if ins.funct3 == RISCV_OPIW_SRW {
if ins.funct7 == RISCV_OPIW_SRW_SRLIW {
format!("srlwi\t{}, {}, {}", REG_X[rd], REG_X[rs1], REG_X[rs2])
format!("srliw\t{}, {}, {}", REG_X[rd], REG_X[rs1], REG_X[rs2])
} else {
format!("srawi\t{}, {}, {}", REG_X[rd], REG_X[rs1], REG_X[rs2])
format!("sraiw\t{}, {}, {}", REG_X[rd], REG_X[rs1], REG_X[rs2])
}
} else if ins.funct3 == RISCV_OPIW_SLLIW {
format!("{}\t{}, {}, {}", NAMES_OPI[ins.funct3 as usize], REG_X[rd], REG_X[rs1], REG_X[rs2])