From 639f91b19263e09b64bfdee4d42e54f96a2c6aaf Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Tue, 8 Jun 2021 11:31:58 +0200 Subject: [PATCH] [decoder] removed sign extension for CSR type instructions --- riscemu/decoder/formats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/riscemu/decoder/formats.py b/riscemu/decoder/formats.py index 296e6ca..9d3e544 100644 --- a/riscemu/decoder/formats.py +++ b/riscemu/decoder/formats.py @@ -98,6 +98,10 @@ def decode_i_shamt(ins: int) -> List[int]: return decode_i(ins) +def decode_i_unsigned(ins: int) -> List[int]: + return [rd(ins), rs1(ins), imm110(ins)] + + INSTRUCTION_ARGS_DECODER: Dict[int, Callable[[int], List[int]]] = { 0x00: decode_i, 0x04: decode_i_shamt, @@ -108,5 +112,5 @@ INSTRUCTION_ARGS_DECODER: Dict[int, Callable[[int], List[int]]] = { 0x18: decode_b, 0x19: decode_i, 0x1b: decode_j, - 0x1c: decode_i + 0x1c: decode_i_unsigned }