qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jocelyn Mayer <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH][PPC] mtfsf: fix FPSCR_VX and FPSCR_FEX computation
Date: Mon, 10 Dec 2007 13:10:38 +0100	[thread overview]
Message-ID: <1197288638.20253.45.camel@jma4.dev.netgem.com> (raw)
In-Reply-To: <20071210091318.GA3937@hall.aurel32.net>


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 <l_indien@magic.fr>

  reply	other threads:[~2007-12-10 12:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-10  9:13 [Qemu-devel] [PATCH][PPC] mtfsf: fix FPSCR_VX and FPSCR_FEX computation Aurelien Jarno
2007-12-10 12:10 ` Jocelyn Mayer [this message]
2008-01-23 15:20   ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1197288638.20253.45.camel@jma4.dev.netgem.com \
    --to=l_indien@magic.fr \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).