[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [4544] added tcg_temp_free() and improved the handling
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] [4544] added tcg_temp_free() and improved the handling of constants |
Date: |
Fri, 23 May 2008 19:03:35 +0100 |
User-agent: |
KMail/1.9.9 |
> 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