target-i386: fix helper_fdiv() wrt softfloat

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
Aurelien Jarno 2011-04-20 13:04:23 +02:00
parent c9ad19c57b
commit 13822781d4
2 changed files with 7 additions and 2 deletions

View file

@ -3440,9 +3440,10 @@ static void fpu_set_exception(int mask)
static inline CPU86_LDouble helper_fdiv(CPU86_LDouble a, CPU86_LDouble b)
{
if (b == 0.0)
if (floatx_is_zero(b)) {
fpu_set_exception(FPUS_ZE);
return a / b;
}
return floatx_div(a, b, &env->fp_status);
}
static void fpu_raise_exception(void)