riscv

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

commit 1fdc064971cf06f8bc729487523c236c159d9ea7
parent 51eaca816ab2e04688fa8ae8dca7dedce6a64a84
Author: Brian Swetland <swetland@frotz.net>
Date:   Thu, 21 Apr 2022 18:48:06 -0700

riscv.h: fix clobbering bit 11 in relative branch immediates

Diffstat:
Mriscv.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/riscv.h b/riscv.h @@ -28,7 +28,7 @@ static inline uint32_t get_ib(uint32_t ins) { return ((ins >> 7) & 0x1e) | ((ins >> 20) & 0x7e0) | ((ins << 4) & 0x800) | - (((int32_t)(ins & 0x80000000)) >> 20); + (((int32_t)(ins & 0x80000000)) >> 19); } static inline uint32_t get_iu(uint32_t ins) { return ins & 0xFFFFF000;