mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
target/ppc: Fix do_float_check_status vs inexact
The underflow and inexact exceptions are not mutually exclusive. Check for both of them. Tidy the reset of FPSCR[FI]. Fixes: https://bugs.launchpad.net/bugs/1841442 Reported-by: Paul Clarke <pc@us.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Paul Clarke <pc@us.ibm.com> Message-Id: <20190826165434.18403-2-richard.henderson@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
cbc65a8f22
commit
16ce2fffa6
1 changed files with 3 additions and 7 deletions
|
@ -630,19 +630,15 @@ static void do_float_check_status(CPUPPCState *env, uintptr_t raddr)
|
||||||
{
|
{
|
||||||
CPUState *cs = env_cpu(env);
|
CPUState *cs = env_cpu(env);
|
||||||
int status = get_float_exception_flags(&env->fp_status);
|
int status = get_float_exception_flags(&env->fp_status);
|
||||||
bool inexact_happened = false;
|
|
||||||
|
|
||||||
if (status & float_flag_overflow) {
|
if (status & float_flag_overflow) {
|
||||||
float_overflow_excp(env);
|
float_overflow_excp(env);
|
||||||
} else if (status & float_flag_underflow) {
|
} else if (status & float_flag_underflow) {
|
||||||
float_underflow_excp(env);
|
float_underflow_excp(env);
|
||||||
} else if (status & float_flag_inexact) {
|
|
||||||
float_inexact_excp(env);
|
|
||||||
inexact_happened = true;
|
|
||||||
}
|
}
|
||||||
|
if (status & float_flag_inexact) {
|
||||||
/* if the inexact flag was not set */
|
float_inexact_excp(env);
|
||||||
if (inexact_happened == false) {
|
} else {
|
||||||
env->fpscr &= ~(1 << FPSCR_FI); /* clear the FPSCR[FI] bit */
|
env->fpscr &= ~(1 << FPSCR_FI); /* clear the FPSCR[FI] bit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue