diff options
author | David Li <li.davidm96@gmail.com> | 2016-01-11 09:29:42 -0700 |
---|---|---|
committer | David Li <li.davidm96@gmail.com> | 2016-01-11 09:29:42 -0700 |
commit | ab4ba59cca5094f15987ab16bddbd0ca4ea50a62 (patch) | |
tree | 1ce6392ff92f3001174ff0010d323eb2304f839c /src/simulator.rs | |
parent | 2c80c2afc190b3a37c42808995f4dd0389d4202e (diff) |
Fix BGE, BGEU, funct3 calculation
Diffstat (limited to 'src/simulator.rs')
-rw-r--r-- | src/simulator.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simulator.rs b/src/simulator.rs index 716c0e1..1c87d57 100644 --- a/src/simulator.rs +++ b/src/simulator.rs @@ -112,9 +112,9 @@ impl<'a> Core<'a> { isa::funct3::BEQ => rs1 == rs2, isa::funct3::BNE => rs1 != rs2, isa::funct3::BLT => (rs1 as isa::SignedWord) < (rs2 as isa::SignedWord), - isa::funct3::BGE => (rs1 as isa::SignedWord) > (rs2 as isa::SignedWord), + isa::funct3::BGE => (rs1 as isa::SignedWord) >= (rs2 as isa::SignedWord), isa::funct3::BLTU => rs1 < rs2, - isa::funct3::BGEU => rs1 > rs2, + isa::funct3::BGEU => rs1 >= rs2, _ => { self.trap(Trap::IllegalInstruction { address: pc, |