diff options
author | Andrew Waterman <andrew@sifive.com> | 2024-04-25 16:27:22 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2024-04-25 16:27:45 -0700 |
commit | fb9d13a695bbeae38e97a288fabdae87a6d972f9 (patch) | |
tree | 7b6f7339d734c70515cf41256164acbe4362bb43 /machine/misaligned_ldst.c | |
parent | 48e96c042d9e39da6a17fca49d237eba44e132aa (diff) | |
download | pk-fb9d13a695bbeae38e97a288fabdae87a6d972f9.zip pk-fb9d13a695bbeae38e97a288fabdae87a6d972f9.tar.gz pk-fb9d13a695bbeae38e97a288fabdae87a6d972f9.tar.bz2 |
Fix emulation of misaligned c.swsp/c.sdsp with rd=x0
Diffstat (limited to 'machine/misaligned_ldst.c')
-rw-r--r-- | machine/misaligned_ldst.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/machine/misaligned_ldst.c b/machine/misaligned_ldst.c index 185897d..a421672 100644 --- a/machine/misaligned_ldst.c +++ b/machine/misaligned_ldst.c @@ -116,12 +116,12 @@ void misaligned_store_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc) # if __riscv_xlen >= 64 else if ((insn & MASK_C_SD) == MATCH_C_SD) len = 8, val.intx = GET_RS2S(insn, regs); - else if ((insn & MASK_C_SDSP) == MATCH_C_SDSP && ((insn >> SH_RD) & 0x1f)) + else if ((insn & MASK_C_SDSP) == MATCH_C_SDSP) len = 8, val.intx = GET_RS2C(insn, regs); # endif else if ((insn & MASK_C_SW) == MATCH_C_SW) len = 4, val.intx = GET_RS2S(insn, regs); - else if ((insn & MASK_C_SWSP) == MATCH_C_SWSP && ((insn >> SH_RD) & 0x1f)) + else if ((insn & MASK_C_SWSP) == MATCH_C_SWSP) len = 4, val.intx = GET_RS2C(insn, regs); # ifdef PK_ENABLE_FP_EMULATION else if ((insn & MASK_C_FSD) == MATCH_C_FSD) |