From: Richard Henderson <rth@twiddle.net>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH 2/3] target-sparc: Free instruction temporaries.
Date: Sat, 17 Apr 2010 12:49:32 -0500 [thread overview]
Message-ID: <4BC9F4AC.1080001@twiddle.net> (raw)
In-Reply-To: <w2xf43fc5581004170941u6bb7f3c0kb8b49f7c5b5db04e@mail.gmail.com>
On 04/17/2010 11:41 AM, Blue Swirl wrote:
> About this patch: it's good that we now free the constants, but
> constant handling is still not optimal and I think this series
> actually may add extra 'movi' ops in the worst case. It would be nice
> if we detected if constants are in play and call immediate versions
> (addi, subi etc) automatically. This may need bigger refactoring,
> though.
No, that won't help, since the first thing that addi, subi, etc
do is to load the constant into a temporary.
What would *really* help though, is something along the lines of
Aurelien's constant propagation patch, followed by some mechanism
to refactor constants in the backend.
Aurelien's patch does a good job of building the full constant
that the RISC instruction stream needed to use to generate the
full 32-bit or 64-bit constant. If the host is x86, that's just
about all we need. However, if the host is a RISC, we'll
generally need to decompose the constant again.
I've got the outline of an idea by which TCG can remember which
constants are actually loaded into registers. And it should be
designed so that the host backend can call into it to load other
constants. In this way when we have a pair of constants like
0xfff00011
0xfff00022
the sparc backend can (if things go well with register allocation)
load the %hi(0xfff00000) just once, and form the full constants
with addition from there.
r~
next prev parent reply other threads:[~2010-04-17 17:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-16 14:50 [Qemu-devel] [PATCH 1/3] target-sparc: Fix TARGET_{PHYS, VIRT}_ADDR_SPACE_BITS Richard Henderson
2010-04-16 14:50 ` [Qemu-devel] [PATCH 2/3] target-sparc: Free instruction temporaries Richard Henderson
2010-04-16 14:50 ` [Qemu-devel] [PATCH 3/3] Fix --enable-profiler compilation Richard Henderson
2010-04-17 16:41 ` [Qemu-devel] Re: [PATCH 2/3] target-sparc: Free instruction temporaries Blue Swirl
2010-04-17 17:49 ` Richard Henderson [this message]
2010-04-17 18:00 ` Richard Henderson
2010-04-17 18:50 ` Blue Swirl
2010-04-17 18:41 ` Blue Swirl
2010-04-18 15:02 ` Richard Henderson
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=4BC9F4AC.1080001@twiddle.net \
--to=rth@twiddle.net \
--cc=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).