Merge branch 'decode_print' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into decode_print

This commit is contained in:
Quentin Legot
2023-01-11 15:36:27 +01:00
2 changed files with 61 additions and 65 deletions

View File

@ -23,7 +23,7 @@ impl Machine {
value = (value << 32) + value;
for item in &mut shiftmask {
*item = value;
value = value >> 1;
value >>= 1;
}
Machine {
@ -202,8 +202,7 @@ impl Machine {
machine.int_reg[inst.rd as usize] = machine.int_reg[inst.rs1 as usize] + inst.imm12_I_signed as i64;
},
RISCV_OPI_SLTI => {
machine.int_reg[inst.rd as usize] =
if machine.int_reg[inst.rs1 as usize] < inst.imm12_I_signed as i64 { 1 } else { 0 };
machine.int_reg[inst.rd as usize] = (machine.int_reg[inst.rs1 as usize] < inst.imm12_I_signed as i64) as i64;
},
RISCV_OPI_XORI => {
machine.int_reg[inst.rd as usize] = machine.int_reg[inst.rs1 as usize] ^ inst.imm12_I_signed as i64;
@ -378,6 +377,5 @@ impl Machine {
#[cfg(test)]
mod test {
use super::Machine;
}
}