mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-20 00:22:02 -06:00
target/loongarch: Fix helper_asrtle_d/asrtgt_d raise wrong exception
Raise EXCCODE_BCE instead of EXCCODE_ADEM for helper_asrtle_d/asrtgt_d. Signed-off-by: Song Gao <gaosong@loongson.cn> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220624031049.1716097-10-gaosong@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
7d552f0e0a
commit
7fe7eea6ff
2 changed files with 4 additions and 2 deletions
|
@ -51,6 +51,7 @@ static const char * const excp_names[] = {
|
||||||
[EXCCODE_IPE] = "Instruction privilege error",
|
[EXCCODE_IPE] = "Instruction privilege error",
|
||||||
[EXCCODE_FPE] = "Floating Point Exception",
|
[EXCCODE_FPE] = "Floating Point Exception",
|
||||||
[EXCCODE_DBP] = "Debug breakpoint",
|
[EXCCODE_DBP] = "Debug breakpoint",
|
||||||
|
[EXCCODE_BCE] = "Bound Check Exception",
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *loongarch_exception_name(int32_t exception)
|
const char *loongarch_exception_name(int32_t exception)
|
||||||
|
@ -176,6 +177,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
|
||||||
case EXCCODE_INE:
|
case EXCCODE_INE:
|
||||||
case EXCCODE_IPE:
|
case EXCCODE_IPE:
|
||||||
case EXCCODE_FPE:
|
case EXCCODE_FPE:
|
||||||
|
case EXCCODE_BCE:
|
||||||
env->CSR_BADV = env->pc;
|
env->CSR_BADV = env->pc;
|
||||||
QEMU_FALLTHROUGH;
|
QEMU_FALLTHROUGH;
|
||||||
case EXCCODE_ADEM:
|
case EXCCODE_ADEM:
|
||||||
|
|
|
@ -49,14 +49,14 @@ target_ulong helper_bitswap(target_ulong v)
|
||||||
void helper_asrtle_d(CPULoongArchState *env, target_ulong rj, target_ulong rk)
|
void helper_asrtle_d(CPULoongArchState *env, target_ulong rj, target_ulong rk)
|
||||||
{
|
{
|
||||||
if (rj > rk) {
|
if (rj > rk) {
|
||||||
do_raise_exception(env, EXCCODE_ADEM, GETPC());
|
do_raise_exception(env, EXCCODE_BCE, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void helper_asrtgt_d(CPULoongArchState *env, target_ulong rj, target_ulong rk)
|
void helper_asrtgt_d(CPULoongArchState *env, target_ulong rj, target_ulong rk)
|
||||||
{
|
{
|
||||||
if (rj <= rk) {
|
if (rj <= rk) {
|
||||||
do_raise_exception(env, EXCCODE_ADEM, GETPC());
|
do_raise_exception(env, EXCCODE_BCE, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue