qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] TCG new op: setcond
Date: Sun, 9 Nov 2008 12:50:46 +0200	[thread overview]
Message-ID: <f43fc5580811090250x37200fc7ibce2bf23150e755e@mail.gmail.com> (raw)
In-Reply-To: <761ea48b0811050811l18152234jfc3046f2a502fecf@mail.gmail.com>

On 11/5/08, Laurent Desnogues <laurent.desnogues@gmail.com> wrote:
> Hello,
>
>  Here is an updated patch for setcond.
>
>  Changes since the previous patch:
>
>   - support TCG i386 for 32 and 64 bit variants
>   - support TCG x86_64 support for 32 and 64 bit variants
>   - fix for x86_64 prefix output
>   - fix for input/output overlap
>   - use setcond for Alpha cmp instructions
>   - add setcondi
>
>  Digging into x86 is certainly not a pleasant experience for me,
>  especially as I have no experience on it.  So this patch may
>  contain bugs and overlooks;  note however my changes were
>  tested on x86_64 and i386 platforms with test programs for
>  Alpha and ARM.
>
>  What remains to be done:
>
>
>   - document setcond in tcg/README
>
>   - implement it in all backends (ARM, PPC, PPC64, SPARC)

There is no equivalent instruction for Sparc32 (V8), it should be
implemented otherwise. Though currently we assume that V9 is always
available.

Sparc64 (V9) has a conditional move instruction (MOVcc). The manual
suggests a three-instruction sequence (cmp, mov, movcc) to implement a
setcond-type operation. For setcondi where the immediate value is
zero, MOVR may be used to skip the comparison (mov, movrcc).

>  - use it at least once in every frontend (cris, i386, m68k, MIPS,
>    PPC, sh4, SPARC)

Candidate brconds to be replaced by setcond in target-sparc/translate
are: all of gen_cc_*, gen_op_mulscc, gen_op_div_cc and gen_cond_reg.
Especially gen_cond_reg should benefit.

> Also there's a choice to be done between return 1 if the test
> succeeds or -1.

'1' would be much more useful than '-1' for Sparc target, because it
can be shifted to form PSR_xxx values that can be or'ed to the
condition codes. All of the above candidates except gen_cond_reg would
need additional masking to remove the other bits than the zeroth.

  reply	other threads:[~2008-11-09 10:50 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
2008-11-04 14:24 ` Avi Kivity
2008-11-05 16:11   ` Laurent Desnogues
2008-11-09 10:50     ` Blue Swirl [this message]
  -- 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=f43fc5580811090250x37200fc7ibce2bf23150e755e@mail.gmail.com \
    --to=blauwirbel@gmail.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).