summaryrefslogtreecommitdiff
path: root/src/instructions/rvi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/instructions/rvi.rs')
-rw-r--r--src/instructions/rvi.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/instructions/rvi.rs b/src/instructions/rvi.rs
index 5e2faa4..9f34fb1 100644
--- a/src/instructions/rvi.rs
+++ b/src/instructions/rvi.rs
@@ -4,7 +4,7 @@
// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
// See LICENSE file in the project root for full license text.
-use crate::{consts::RegValue, core::Core, decode::Instruction, exceptions::ExceptionType};
+use crate::{consts::RegValue, core::Core, decode::Instruction, exceptions::Exception};
use std::ops::{BitAnd, BitOr, BitXor};
@@ -49,25 +49,25 @@ instr_op!(
instr_op!(sltu, sltiu, |a, b| (a < b) as RegValue);
instr_op!(slt, slti, |a, b| ((a as i64) < (b as i64)) as RegValue);
-pub fn lui(core: &mut Core, instr: Instruction) -> Result<(), ExceptionType> {
+pub fn lui(core: &mut Core, instr: Instruction) -> Result<(), Exception> {
core.reg_write(instr.rd(), instr.imm_u());
core.advance_pc();
Ok(())
}
-pub fn auipc(core: &mut Core, instr: Instruction) -> Result<(), ExceptionType> {
+pub fn auipc(core: &mut Core, instr: Instruction) -> Result<(), Exception> {
core.reg_write(instr.rd(), core.pc.wrapping_add(instr.imm_u()));
core.advance_pc();
Ok(())
}
-pub fn jal(core: &mut Core, instr: Instruction) -> Result<(), ExceptionType> {
+pub fn jal(core: &mut Core, instr: Instruction) -> Result<(), Exception> {
core.reg_write(instr.rd(), core.pc.wrapping_add(4));
core.pc = core.pc.wrapping_add(instr.imm_j());
Ok(())
}
-pub fn jalr(core: &mut Core, instr: Instruction) -> Result<(), ExceptionType> {
+pub fn jalr(core: &mut Core, instr: Instruction) -> Result<(), Exception> {
core.reg_write(instr.rd(), core.pc.wrapping_add(4));
core.pc = core.reg_read(instr.rs1()).wrapping_add(instr.imm_i());
Ok(())