qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH][PPC] mtfsf: fix FPSCR_VX and FPSCR_FEX computat


From: Jocelyn Mayer
Subject: Re: [Qemu-devel] [PATCH][PPC] mtfsf: fix FPSCR_VX and FPSCR_FEX computation
Date: Mon, 10 Dec 2007 13:10:38 +0100

On Mon, 2007-12-10 at 10:13 +0100, Aurelien Jarno wrote:
> Hi all,

Hi,

> The patch below fix the computation of FPSCR_VX and FPSCR_FEX when
> using the mtfsf instruction. As stated in the PowerPC manual the mtfsf
> instruction can't alter those bit, and thus it should always be 
> computed.

You're right, the values are not computed properly.
I'll commit your fix.


> Index: target-ppc/op_helper.c
> ===================================================================
> RCS file: /sources/qemu/qemu/target-ppc/op_helper.c,v
> retrieving revision 1.73
> diff -u -d -p -r1.73 op_helper.c
> --- target-ppc/op_helper.c    24 Nov 2007 02:03:55 -0000      1.73
> +++ target-ppc/op_helper.c    10 Dec 2007 09:10:30 -0000
> @@ -888,12 +888,16 @@ void do_store_fpscr (uint32_t mask)
>      /* Update VX and FEX */
>      if (fpscr_ix != 0)
>          env->fpscr |= 1 << FPSCR_VX;
> +    else
> +        env->fpscr &= ~(1 << FPSCR_VX);
>      if ((fpscr_ex & fpscr_eex) != 0) {
>          env->fpscr |= 1 << FPSCR_FEX;
>          env->exception_index = POWERPC_EXCP_PROGRAM;
>          /* XXX: we should compute it properly */
>          env->error_code = POWERPC_EXCP_FP;
>      }
> +    else
> +        env->fpscr &= ~(1 << FPSCR_FEX);
>      fpscr_set_rounding_mode();
>  }
>  #undef WORD0

-- 
Jocelyn Mayer <address@hidden>





reply via email to

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