aboutsummaryrefslogtreecommitdiff
path: root/src/isa
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-06 12:11:27 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-06 12:11:27 -0700
commita50fad7afbbd63615d4e675838d7b5f531abd26c (patch)
tree8634d258efcd780a49407f297afac98f54ee485f /src/isa
parent966b97cc90e714aefb4b06c71e77175bc0f7ff7a (diff)
Correct s_imm calculation
Diffstat (limited to 'src/isa')
-rw-r--r--src/isa/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/isa/mod.rs b/src/isa/mod.rs
index cfdde50..9da1751 100644
--- a/src/isa/mod.rs
+++ b/src/isa/mod.rs
@@ -155,8 +155,8 @@ impl Instruction {
pub fn s_imm(&self) -> SignedWord {
let low = (self.word >> 7) & 0x1F;
- let high = (((self.word as SignedWord) >> 25) & 0x7F) as Word;
- ((high << 7) | low) as SignedWord
+ let high = ((self.word as SignedWord) >> 25) as Word;
+ ((high << 5) | low) as SignedWord
}
pub fn uj_imm(&self) -> SignedWord {