parent
d9770c48b2
commit
53c6d74a6b
|
@ -257,7 +257,8 @@ impl VM {
|
||||||
self.gpr[ins.field_ra() as usize],
|
self.gpr[ins.field_ra() as usize],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
let left = if ins.field_ra() == 0 && ins.op == Opcode::Addi {
|
let load_zero = ins.field_ra() == 0 && ins.op == Opcode::Addi;
|
||||||
|
let left = if load_zero {
|
||||||
GprValue::Constant(0)
|
GprValue::Constant(0)
|
||||||
} else {
|
} else {
|
||||||
self.gpr[ins.field_ra() as usize].value
|
self.gpr[ins.field_ra() as usize].value
|
||||||
|
@ -271,7 +272,7 @@ impl VM {
|
||||||
),
|
),
|
||||||
_ => GprValue::Unknown,
|
_ => GprValue::Unknown,
|
||||||
};
|
};
|
||||||
if ins.field_ra() == 0 {
|
if load_zero {
|
||||||
// li rD, SIMM
|
// li rD, SIMM
|
||||||
self.gpr[ins.field_rd() as usize].set_direct(value);
|
self.gpr[ins.field_rd() as usize].set_direct(value);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue