From: "Laurent Desnogues" <laurent.desnogues@gmail.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] TCG new op: setcond
Date: Tue, 4 Nov 2008 14:33:08 +0100 [thread overview]
Message-ID: <761ea48b0811040533o487c689ek8e8f776590717086@mail.gmail.com> (raw)
In-Reply-To: <200811041316.39122.paul@codesourcery.com>
On Tue, Nov 4, 2008 at 2:16 PM, Paul Brook <paul@codesourcery.com> wrote:
>> this patch implements a new TCG op, setcond, that sets a temp
>> to 1 if the condition is true, else to 0. The benefit is the potential
>> removal of brcond instructions, and helpers size reduction which
>> can lead to using TCG instead of helpers.
>
>> - a variant that sets -1 instead of 1 for masking
>
> I'm worried about this. If we're not careful we'll end up with an explosion of
> different patterns, many of which aren't optimal of different hosts.
I am worried too. I added that because you mentioned you would
prefer -1 over 1. I am still unsure which one of these variants is
the most useful and/or host runtime critical (one can be derived
from the other by generating one extra TCG op).
>> - 64 bit setcond's
>
> You should do this sooner rather than later, and on a 32-bit host.
OK.
>> + /* clear ret since setcc only sets the lower 8 bits */
>> + tcg_out_modrm(s, 0x01 | (ARITH_XOR << 3) | rexw, ret, ret);
>
> This is broken. Inputs and outputs may overlap.
Oh right. I will use some bit extending instruction.
>> + // TODO this should use tcg_out_modrm
>> + // however currently tcg_out_modrm outputs an extra byte for
>> [abcd]l + //tcg_out_modrm(s, (0x90 + tcg_cond_to_jcc[cond]) | P_EXT |
>> P_REXB, ret, 0)
>
> This is the wrong way to fix this. If you really care about the extra code
> byte (which is harmless) you should fix tcg_out_modrm.
I asked about that directly to Fabrice yesterday. I am waiting for
his answer. I certainly am not very good at x86 and its baroque
encoding :)
> Also, please use C comments, not c++ style //.
These were done so that it is explicit they are here temporarily for
reviewers. They will disappear in the final patch.
Thanks for the comments.
Laurent
next prev parent reply other threads:[~2008-11-04 13:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 10:15 [Qemu-devel] [RFC] TCG new op: setcond Laurent Desnogues
2008-11-04 13:16 ` Paul Brook
2008-11-04 13:33 ` Laurent Desnogues [this message]
2008-11-04 14:24 ` Avi Kivity
2008-11-05 16:11 ` Laurent Desnogues
2008-11-09 10:50 ` Blue Swirl
-- strict thread matches above, loose matches on Subject: below --
2008-11-08 19:13 Laurent Desnogues
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=761ea48b0811040533o487c689ek8e8f776590717086@mail.gmail.com \
--to=laurent.desnogues@gmail.com \
--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).