target/loongarch: Fix LD/ST{LE/GT} instructions get wrong CSR_ERA and CSR_BADV
authorSong Gao <gaosong@loongson.cn>
Mon, 15 May 2023 13:00:42 +0000 (21:00 +0800)
committerSong Gao <gaosong@loongson.cn>
Fri, 26 May 2023 09:21:12 +0000 (17:21 +0800)
commit2e2ca3c8fa52c03c3725edfdd726972a223b74f3
tree0fa2388f4282f2aad3f893399aee9fce758293e9
parenta3cb6d5004ff638aefe686ecd540718a793bd1b1
target/loongarch: Fix LD/ST{LE/GT} instructions get wrong CSR_ERA and CSR_BADV

1.helper_asrtle_d/helper_asrtgt_d need use GETPC() to get PC;
2 LD/ST{LE/GT} need set CSR_BADV = gpr[rj];
3 ASRTLE.D/ASRTGT.D also write CSR_BADV, but this value is random
  and has no reference value.

Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230515130042.2719712-1-gaosong@loongson.cn>
target/loongarch/cpu.c
target/loongarch/op_helper.c