On 18 April 2011 22:00, Aurelien Jarno <aurel...@aurel32.net> 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?

>  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;

-- PMM

Reply via email to