diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-10-02 11:39:09 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-10-02 11:39:09 -0700 |
commit | 82372d00398ce3712f0c7e9f243f6828041e0859 (patch) | |
tree | c023a7afd306544a8eb5f3e0cf059a3b2dc9da4a /riscv/insns/srai.h | |
parent | e78da5da4a6e6a38953cda9b35992c421768c776 (diff) | |
download | spike-82372d00398ce3712f0c7e9f243f6828041e0859.zip spike-82372d00398ce3712f0c7e9f243f6828041e0859.tar.gz spike-82372d00398ce3712f0c7e9f243f6828041e0859.tar.bz2 |
clean up shift instruction implementation
Diffstat (limited to 'riscv/insns/srai.h')
-rw-r--r-- | riscv/insns/srai.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/riscv/insns/srai.h b/riscv/insns/srai.h index 69066ef..7ae1d4e 100644 --- a/riscv/insns/srai.h +++ b/riscv/insns/srai.h @@ -1,8 +1,2 @@ -if (xlen == 64) - WRITE_RD(sreg_t(RS1) >> SHAMT); -else -{ - if(SHAMT & 0x20) - throw trap_illegal_instruction(); - WRITE_RD(sext32(int32_t(RS1) >> SHAMT)); -} +require(SHAMT < xlen); +WRITE_RD(sext_xlen(sext_xlen(RS1) >> SHAMT)); |