qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 17/20] target-i386: fix logarithmic and trigonom


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 17/20] target-i386: fix logarithmic and trigonometric helpers wrt softfloat
Date: Wed, 20 Apr 2011 11:41:27 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Apr 19, 2011 at 06:37:14PM +0100, Peter Maydell wrote:
> On 18 April 2011 22:00, Aurelien Jarno <address@hidden> wrote:
> > +#include <math.h>
> 
> Why does this patch need this? I couldn't see anywhere where
> the patch added calls to math functions we weren't calling before,
> or did I miss one?

Because softloat-native.h include it, but not softfloat.h.

> >  void helper_fptan(void)
> >  {
> > -    CPU86_LDouble fptemp;
> > +    double fptemp = CPU86_LDouble_to_double(ST0);
> >
> > -    fptemp = ST0;
> >     if((fptemp > MAXTAN)||(fptemp < -MAXTAN)) {
> >         env->fpus |= 0x400;
> >     } else {
> > -        ST0 = tan(fptemp);
> > +        fptemp = tan(fptemp);
> > +        ST0 = double_to_CPU86_LDouble(fptemp);
> >         fpush();
> > -        ST0 = 1.0;
> > +        ST0 = double_to_CPU86_LDouble(1.0);
> 
> You could just say:
>    ST0 = floatx_one;
> 

Correct, will fix that.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]