RISCV_OP fixed
This commit is contained in:
parent
673c2c8d20
commit
7a89d06f36
18
src/print.rs
18
src/print.rs
@ -147,7 +147,23 @@ pub fn print(ins: Instruction, pc: i32) -> String { //TODO pc should be u64
|
||||
if ins.funct7 == 1 { // Use mul array
|
||||
name = names_mul[ins.funct3 as usize]
|
||||
} else {
|
||||
name = names_op[ins.funct3 as usize];
|
||||
if ins.funct3 == RISCV_OP_ADD {
|
||||
// Add or Sub
|
||||
if ins.funct7 == RISCV_OP_ADD_ADD {
|
||||
name = "add";
|
||||
} else {
|
||||
name = "sub";
|
||||
}
|
||||
} else if ins.funct3 == RISCV_OP_SR {
|
||||
// Srl or Sra
|
||||
if ins.funct7 == RISCV_OP_SR_SRL {
|
||||
name = "srl";
|
||||
} else {
|
||||
name = "sra";
|
||||
}
|
||||
} else {
|
||||
name = names_op[ins.funct3 as usize];
|
||||
}
|
||||
}
|
||||
format!("{} r{}, r{}, r{}", name.to_string(), &ins.rd.to_string(), &ins.rs1.to_string(), &ins.rs2.to_string())
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user