riscv

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 6e76c2772415b01db88491717914bfc99e8bcf5a
parent b6b3810842a068f27100369152fef579a38b8d82
Author: Brian Swetland <swetland@frotz.net>
Date:   Wed, 16 Oct 2019 15:12:39 -0700

fix typo in sltiu instruction and fix j immediate getter

Diffstat:
Minstab.txt | 2+-
Mriscv.h | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/instab.txt b/instab.txt @@ -31,7 +31,7 @@ 000000000000-----000-----0010011 mv %d, %1 -----------------000-----0010011 addi %d, %1, %i -----------------010-----0010011 slti %d, %1, %i ------------------011-----0010011 sltui %d, %1, %i +-----------------011-----0010011 sltiu %d, %1, %i -----------------100-----0010011 xori %d, %1, %i -----------------110-----0010011 ori %d, %1, %i -----------------111-----0010011 andi %d, %1, %i diff --git a/riscv.h b/riscv.h @@ -28,7 +28,7 @@ static inline uint32_t get_iu(uint32_t ins) { return ins & 0xFFFFF000; } static inline uint32_t get_ij(uint32_t ins) { - return (((int32_t)ins) >> 11) | + return (((int32_t)(ins & 0x80000000)) >> 11) | (ins & 0xFF000) | ((ins >> 9) & 0x800) | ((ins >> 20) & 0x7fe);