Received: from eggs.gnu.org ([208.118.235.92]:53593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ3Ds-0003ti-TT for qemu-devel@nongnu.org; Wed, 10 Apr 2013 18:10:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ3Dr-0004jt-QD for qemu-devel@nongnu.org; Wed, 10 Apr 2013 18:10:32 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <1365519655-30416-1-git-send-email-chouteau@adacore.com> Date: Thu, 11 Apr 2013 00:09:46 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1365519655-30416-1-git-send-email-chouteau@adacore.com> Subject: Re: [Qemu-devel] [PATCH] powerpc: correctly handle fpu exceptions. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: Tristan Gingold , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 09.04.2013, at 17:00, Fabien Chouteau wrote: > From: Tristan Gingold >=20 > Raise the exception on the first occurence, do not wait for the next > floating point operation. Do you have a test case for this one that I could use to compare results = with real hardware? Alex >=20 > Signed-off-by: Fabien Chouteau > --- > target-ppc/fpu_helper.c | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) >=20 > diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c > index 9e779ea..1e141fb 100644 > --- a/target-ppc/fpu_helper.c > +++ b/target-ppc/fpu_helper.c > @@ -470,6 +470,18 @@ void store_fpscr(CPUPPCState *env, uint64_t arg, = uint32_t mask) >=20 > void helper_float_check_status(CPUPPCState *env) > { > + int status =3D get_float_exception_flags(&env->fp_status); > + > + if (status & float_flag_divbyzero) { > + float_zero_divide_excp(env); > + } else if (status & float_flag_overflow) { > + float_overflow_excp(env); > + } else if (status & float_flag_underflow) { > + float_underflow_excp(env); > + } else if (status & float_flag_inexact) { > + float_inexact_excp(env); > + } > + > if (env->exception_index =3D=3D POWERPC_EXCP_PROGRAM && > (env->error_code & POWERPC_EXCP_FP)) { > /* Differred floating-point exception after target FPR update = */ > @@ -477,17 +489,6 @@ void helper_float_check_status(CPUPPCState *env) > helper_raise_exception_err(env, env->exception_index, > env->error_code); > } > - } else { > - int status =3D get_float_exception_flags(&env->fp_status); > - if (status & float_flag_divbyzero) { > - float_zero_divide_excp(env); > - } else if (status & float_flag_overflow) { > - float_overflow_excp(env); > - } else if (status & float_flag_underflow) { > - float_underflow_excp(env); > - } else if (status & float_flag_inexact) { > - float_inexact_excp(env); > - } > } > } >=20 > --=20 > 1.7.9.5 >=20