qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "J. Mayer" <l_indien@magic.fr>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Compile fixes for newer gcc
Date: Wed, 11 May 2005 23:20:48 +0200	[thread overview]
Message-ID: <1115846448.29701.53.camel@rapid> (raw)
In-Reply-To: <200505102210.59973.paul@codesourcery.com>

On Tue, 2005-05-10 at 22:10 +0100, Paul Brook wrote:
> On Tuesday 10 May 2005 21:47, J. Mayer wrote:
> > On Mon, 2005-05-09 at 02:49 +0100, Paul Brook wrote:
> > > The attached patch fixes some trivial build problems with newer gcc on
> > > amd64. It adds FORCE_RET on load ops,
> >
> > Index: target-ppc/exec.h
> > ===================================================================
> > RCS file: /cvsroot/qemu/qemu/target-ppc/exec.h,v
> > retrieving revision 1.10
> > diff -u -p -r1.10 exec.h
> > --- target-ppc/exec.h   13 Mar 2005 17:01:22 -0000      1.10
> > +++ target-ppc/exec.h   9 May 2005 01:33:04 -0000
> > @@ -33,11 +33,7 @@ register uint32_t T2 asm(AREG3);
> >  #define FT1 (env->ft1)
> >  #define FT2 (env->ft2)
> >
> > -#if defined (DEBUG_OP)
> > -#define RETURN() __asm__ __volatile__("nop");
> > -#else
> > -#define RETURN() __asm__ __volatile__("");
> > -#endif
> > +#define RETURN() FORCE_RET()
> >
> > Please don't change this. This is usefull and your so-called "fix" only
> > makes debug harder.
> > Same goes for all other patches: use RETURN macro everywhere in PowerPC
> > emulation code.
> 
> Ok. This slipped in from a following patch, so we can revisit it when I submit 
> those changes. A much better way to do this is to add the NOPs in dyngen. 
> Then you get nops after all ops, not just the ones that use RETURN()

A better fix would be to improve qemu disasembly routines so it can
clearly separate micro-ops when displaying generated code. Since I'm too
lazy to do this, those days, a simple nop is all I need. I think
patching dyngen for a debug-only feature is a really bad idea...

> > >  and introduces helper functions for floating
> > > point negation (these require a literal constant load).
> >
> > /* fneg */
> > +void do_fneg (void);
> >  PPC_OP(fneg)
> >  {
> > -    FT0 = -FT0;
> > +    do_fneg();
> >      RETURN();
> >  }
> >
> > Where's the problem ? It compiles and run perfectly on my amd64. Calling
> > a function for this is a nonsense. Don't apply this.
> 
> As I said it's required to avoid a pc-relative constant literal load.
> gcc4.0 compiles fneg to:

Then use the softfloat helper, but never call a function for such a
thing:
replace it with FT0 = float64_chs(FT0);
It uses a 8 bit constant with gcc3. gcc 4 should do the same, if it's
not too buggy....

-- 
J. Mayer <l_indien@magic.fr>
Never organized

      reply	other threads:[~2005-05-11 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09  1:49 [Qemu-devel] Compile fixes for newer gcc Paul Brook
2005-05-10 20:47 ` J. Mayer
2005-05-10 21:10   ` Paul Brook
2005-05-11 21:20     ` J. Mayer [this message]

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=1115846448.29701.53.camel@rapid \
    --to=l_indien@magic.fr \
    --cc=paul@codesourcery.com \
    --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).