aboutsummaryrefslogtreecommitdiff
path: root/src/isa/mod.rs
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-06 15:37:08 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-06 15:37:08 -0700
commit9b37e5da43f7e2a0e42bc36c0a1b1cc66a402808 (patch)
tree9e00409ca95ee3e1a575b75536910e4b56231cfd /src/isa/mod.rs
parentaf31eff1db5fea09b7b01e5d163c1684d800f7f0 (diff)
Implement LUI, AUIPC
Diffstat (limited to 'src/isa/mod.rs')
-rw-r--r--src/isa/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/isa/mod.rs b/src/isa/mod.rs
index 9da1751..8a6e65b 100644
--- a/src/isa/mod.rs
+++ b/src/isa/mod.rs
@@ -176,4 +176,8 @@ impl Instruction {
let low12 = ((self.word as SignedWord) >> 31) as Word;
((low12 << 12) | (low11 << 11) | (low5 << 5) | (low1 << 1)) as SignedWord
}
+
+ pub fn u_imm(&self) -> SignedWord {
+ (self.word & 0xFFFFF000) as SignedWord
+ }
}