From ae3bcd0a39ddd8538cd136dbae6ef14344405114 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 4 Aug 2010 20:28:47 -0700 Subject: [PATCH] [sim] Bug fixes in shifts, plus a new test case --- riscv/insns/srav.h | 2 +- riscv/insns/srlvw.h | 2 +- riscv/insns/srlw.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/riscv/insns/srav.h b/riscv/insns/srav.h index ec6fee8..e01fcd5 100644 --- a/riscv/insns/srav.h +++ b/riscv/insns/srav.h @@ -1,2 +1,2 @@ require64; -RC = RB >> (RA & 0x3F); +RC = sreg_t(RB) >> (RA & 0x3F); diff --git a/riscv/insns/srlvw.h b/riscv/insns/srlvw.h index 7e1755f..c523b59 100644 --- a/riscv/insns/srlvw.h +++ b/riscv/insns/srlvw.h @@ -1 +1 @@ -RC = sext32(RB >> (RA & 0x1F)); +RC = sext32((uint32_t)RB >> (RA & 0x1F)); diff --git a/riscv/insns/srlw.h b/riscv/insns/srlw.h index 0537a1c..9e41c8c 100644 --- a/riscv/insns/srlw.h +++ b/riscv/insns/srlw.h @@ -1 +1 @@ -RC = sext32(RB >> SHAMT); +RC = sext32((uint32_t)RB >> SHAMT); -- 2.30.2