diff options
author | Mark Fedorov <mark.fedorov@cloudbear.ru> | 2021-07-26 19:41:47 +0300 |
---|---|---|
committer | Mark Fedorov <mark.fedorov@cloudbear.ru> | 2021-07-26 19:41:47 +0300 |
commit | 6de25efd238f4d55f067f11f2cb1182c775751eb (patch) | |
tree | 3e0fb87bb1158e61c6558e1abd7f4d7edec12a77 /riscv/insns/insb.h | |
parent | 5aec3dd51998ed5e99100094facd59d246ed0eca (diff) | |
download | riscv-isa-sim-6de25efd238f4d55f067f11f2cb1182c775751eb.zip riscv-isa-sim-6de25efd238f4d55f067f11f2cb1182c775751eb.tar.gz riscv-isa-sim-6de25efd238f4d55f067f11f2cb1182c775751eb.tar.bz2 |
Fixed rv32 legality issues.
Diffstat (limited to 'riscv/insns/insb.h')
-rw-r--r-- | riscv/insns/insb.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/riscv/insns/insb.h b/riscv/insns/insb.h index 199a8c6..4a98235 100644 --- a/riscv/insns/insb.h +++ b/riscv/insns/insb.h @@ -1,3 +1,4 @@ require_extension('P'); -reg_t bpos = (xlen == 32) ? insn.p_imm2() : insn.p_imm3(); +reg_t bpos = insn.p_imm3(); +require(bpos < (unsigned long)xlen/8); // imm[2] == 1 is illegal on rv32 WRITE_RD(sext_xlen(set_field(RD, make_mask64(bpos * 8, 8), P_B(RS1, 0))));
\ No newline at end of file |