From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [4544] added tcg_temp_free() and improved the handling of constants
Date: Fri, 23 May 2008 19:03:35 +0100 [thread overview]
Message-ID: <200805231903.35923.paul@codesourcery.com> (raw)
In-Reply-To: <E1Jzb99-0007QE-J0@cvs.savannah.gnu.org>
> added tcg_temp_free() and improved the handling of constants
Should the return value of tcg_const_i32 et. al. be considered immutable, or
is it ok to use it as a temporary?
e.g.:
static TCGv do_frob(TCGv base, int addend)
{
TCGv tmp = tcg_const_i32(addend);
tcg_gen_helper_frob(tmp, tmp, base)
return tmp;
}
or should this be written as:
static TCGv do_frob(TCGv base, int addend)
{
TCGv tmp = tcg_temp_new(TCG_TYPE_I32);
tcg_gen_movi_i32(tmp, addend);
tcg_gen_helper_frob(tmp, tmp, base)
return tmp;
}
Currently it's fairly hard to enforce this restriction automatically, but we
need to decide whether it's a feature or a bug.
Paul
next prev parent reply other threads:[~2008-05-23 18:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-23 17:33 [Qemu-devel] [4544] added tcg_temp_free() and improved the handling of constants Fabrice Bellard
2008-05-23 18:03 ` Paul Brook [this message]
2008-05-23 18:27 ` Fabrice Bellard
2008-05-30 18:59 ` Blue Swirl
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=200805231903.35923.paul@codesourcery.com \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.