qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: qemu-devel@nongnu.org
Cc: Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] Re: [PATCH 1/5] Fix i386 Host
Date: Fri, 18 Jan 2008 13:23:59 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0801181310220.20583@wotan.suse.de> (raw)
In-Reply-To: <86022C39-B85C-4769-8ECD-4CB007D82F2E@suse.de>

Hi,

[answering to a forwarded mail, hence breaking thread, sorry]
[and keep me CCed :) ]

On Fri, 18 Jan 2008, Alexander Graf wrote:

> >From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> >Date: January 18, 2008 3:05:58 AM GMT+01:00
> >To: consul <consul@collegeclub.com>
> >Cc: qemu-devel@nongnu.org
> >Subject: Re: [Qemu-devel] Re: [PATCH 1/5] Fix i386 Host
> >Reply-To: qemu-devel@nongnu.org
> >
> >Hi,
> >
> >On Fri, 18 Jan 2008, Johannes Schindelin wrote:
> >
> > >On Thu, 17 Jan 2008, consul wrote:
> > >
> > > >It broke mingw build with gcc-3.4.2
> > >
> > >Now that's funny, since the last incarnation Alexander should have
> >>_exactly_ the same code as before for gcc < 4.  Are you sure that you do
> > >not have applied the patch that exchanges at least one "#ifdef
> > >HOST_I386" for "#ifdef GCC_BREAKS_T_REGISTER"?
> >
> >Okay, I see it, too.  Seems this is the culprit:
> >
> >-- snip --
> >diff --git a/softmmu_header.h b/softmmu_header.h
> >index 80eefa8..7e4bc03 100644
> >--- a/softmmu_header.h
> >+++ b/softmmu_header.h
> >@@ -209,7 +215,11 @@ static inline void glue(glue(st, SUFFIX),
> >MEMSUFFIX)(target_ulong ptr, RES_TYPE
> > : "r" (ptr),
> >/* NOTE: 'q' would be needed as constraint, but we could not use it
> >   with T1 ! */
> >+#if DATA_SIZE == 1 || DATA_SIZE == 2
> >+                  "q" (v),
> >+#else
> >                  "r" (v),
> >+#endif
> >                  "i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),
> >                  "i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),
> >                  "i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),
> >-- snap --
> >
> >Michael, Alexander, what is this hunk supposed to do?

This is required to generate valid assembler code.  Without that hunk, the 
interesting parts of the asm look like so (for DATA_SIZE == 1):

asm (" ... movzbl %b1, %%edx\n ... " : : "r" (blubb), "r" (bla) );

I.e. an instruction which requires a byte register in operand 1.  Now 
constraint "r" only guarantees a free integer register, including e.g. 
%edi, for which no low 8bit part exists (on i386).  The constraints have 
to match the use in the asm template, so in this case must mention an 
integer register for which low parts are constructible, %eax,%ebx,%ecx or 
%edx, i.e. constraint "q".

The comment above this constraint is true in the sense that T1 (== AREG2 
== %esi on i386) can not be used in this operand for DATA_SIZE being 1 or 
2.  But if it were ever used before the patch in that place it would have 
generated invalid assembler code already, and as it didn't the conclusion 
must be, that T1 simply isn't used with this datasize.  So the comment is 
true, but harmless (especially if T1 is defined to env->t1, instead of 
AREG2 to reduce register pressure).  What problems do you have with this 
hunk?


Ciao,
Michael.

  parent reply	other threads:[~2008-01-18 12:24 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 [this message]
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
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.0801181310220.20583@wotan.suse.de \
    --to=matz@suse.de \
    --cc=agraf@suse.de \
    --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).