From: Michael Matz <matz@suse.de>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: consul@collegeclub.com, qemu-devel@nongnu.org,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] Re: [PATCH 1/5] Fix i386 Host
Date: Fri, 18 Jan 2008 15:05:52 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0801181444130.20583@wotan.suse.de> (raw)
In-Reply-To: <alpine.LSU.1.00.0801181333480.5731@racer.site>
Hi,
On Fri, 18 Jan 2008, Johannes Schindelin wrote:
> > > > asm (" ... movzbl %b1, %%edx\n ... " : : "r" (blubb), "r" (bla) );
> > >
> > > Okay, but this only concerns gcc4, apparently.
> >
> > No, it's nothing to do with GCC.
>
> But apparently it has! With gcc < 4 I did never get the error.
As I tried to explain, this is pure luck.
> Which probably means that gcc < 4 did _not_ use ecx, and therefore it
> does not have to be pushed and popped.
We are talking about the hunk using the "q" constraint for operand 1 in
st[bw]_kernel. The change in the clobber list (and the associated
saving/restoring of %ecx around the call) is something entirely different.
> Which -- judging from how commonly glue() is called in op.c -- could
> mean a performance hit.
glue() is a macro, the function called is stw_kernel (inline function).
> I am all for supporting gcc > 3, but please, please not at the cost of
> having a performance hit for _existing_ users.
Have you measured this? This function actually does a call to stw_mmu, a
rather slow and big function, the overhead of one register store more or
less is probably zero.
But that point is mood anyway. When it works without the "q" constraint
in gcc 3.4.2 it only does so, because GCC allocates one of the ax-dx
registers to that operand (by luck, not by design). As T1 is coming in in
esi there anyway existed a reg-reg move already, so you pay that
performance hit (if you like to call it such) already.
> > Only if you want to trust your luck. I fear I don't have gcc 3.4.2
> > lying around anywhere, so I can't really help debugging this reload
> > breakage in that GCC version. It might help to introduce a temporary to
> > guide GCC through this problematic reload case by detaching the global
> > register variable from the asm operand. For cases where it's no problem
> > this should be optimized away, so doesn't inhibit a performance cost.
> > What I mean is something like the below. If someone with gcc 3.4.2
> > could test that ...
>
> I do ask myself how gcc would optimise away instructions that are
> explicitely written in the asm() statement. If it does so, I consider
> this a serious bug in gcc.
My patch in the last mail introduces a copy in C (to vtmp), _that_ can be
optimized away under the right circumstances. Of course GCC does not
change the asm template in any way.
Ciao,
Michael.
next prev parent reply other threads:[~2008-01-18 14:05 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 6:42 [Qemu-devel] [PATCH 1/5] Fix i386 Host Alexander Graf
2008-01-17 8:10 ` Alexander Graf
2008-01-17 12:21 ` Jens Arm
2008-01-17 9:42 ` Alexander Graf
2008-01-17 14:26 ` Alexander Graf
2008-01-17 14:42 ` Johannes Schindelin
2008-01-17 14:47 ` Johannes Schindelin
2008-01-17 15:08 ` Alexander Graf
2008-01-17 15:55 ` Johannes Schindelin
2008-01-18 1:14 ` [Qemu-devel] " consul
2008-01-18 1:22 ` Johannes Schindelin
2008-01-18 2:05 ` Johannes Schindelin
[not found] ` <86022C39-B85C-4769-8ECD-4CB007D82F2E@suse.de>
2008-01-18 12:23 ` Michael Matz
2008-01-18 12:47 ` Johannes Schindelin
2008-01-18 13:12 ` Michael Matz
2008-01-18 13:41 ` Johannes Schindelin
2008-01-18 14:05 ` Michael Matz [this message]
2008-01-18 14:22 ` Johannes Schindelin
2008-01-18 14:34 ` Michael Matz
2008-01-18 14:43 ` Johannes Schindelin
2008-01-18 14:54 ` Michael Matz
2008-01-18 15:32 ` Johannes Schindelin
2008-01-18 15:41 ` Michael Matz
2008-01-18 15:51 ` Johannes Schindelin
2008-01-18 15:15 ` Andreas Färber
2008-01-18 6:23 ` Alexander Graf
2008-01-18 13:44 ` Johannes Schindelin
2008-01-18 12:33 ` Alexander Graf
2008-01-17 14:49 ` [Qemu-devel] " Alexander Graf
2008-01-17 15:29 ` Johannes Schindelin
2008-01-17 17:11 ` Andreas Färber
2008-01-17 17:34 ` Alexander Graf
2008-01-17 23:25 ` Andreas Färber
2008-01-18 0:40 ` Mike Kronenberg
2008-01-18 3:07 ` Mike Kronenberg
2008-01-18 12:42 ` Johannes Schindelin
2008-01-18 6:19 ` Alexander Graf
2008-01-18 8:58 ` Andreas Färber
2008-01-18 14:52 ` Andreas Färber
2008-01-17 14:43 ` Jens Arm
2008-01-17 12:44 ` Johannes Schindelin
2008-01-17 13:18 ` Thiemo Seufer
2008-01-17 11:23 ` Johannes Schindelin
2008-01-17 7:54 ` Alexander Graf
2008-01-17 11:40 ` Jens Arm
2008-01-17 12:37 ` Johannes Schindelin
2008-01-17 13:25 ` Johannes Schindelin
2008-01-17 14:27 ` Alexander Graf
2008-01-18 15:41 ` Fabrice Bellard
2008-01-18 15:49 ` Johannes Schindelin
2008-01-18 16:49 ` Alexander Graf
2008-01-18 18:10 ` Johannes Schindelin
2008-01-18 19:08 ` Markus Hitter
2008-01-18 19:28 ` Johannes Schindelin
2008-01-19 8:10 ` Markus Hitter
2008-01-19 11:16 ` Johannes Schindelin
2008-01-19 11:27 ` Markus Hitter
2008-01-19 22:06 ` Johannes Schindelin
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=Pine.LNX.4.64.0801181444130.20583@wotan.suse.de \
--to=matz@suse.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=agraf@suse.de \
--cc=consul@collegeclub.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).