[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/5] tcg/sparc: Add scratch argument to tcg_out_movi_int
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 1/5] tcg/sparc: Add scratch argument to tcg_out_movi_int |
Date: |
Fri, 4 Feb 2022 17:35:02 +0000 |
On Fri, 4 Feb 2022 at 07:53, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> This will allow us to control exactly what scratch register is
> used for loading the constant. Also, fix a theoretical problem
> in recursing through tcg_out_movi, which may provide a different
> value for in_prologue.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> tcg/sparc/tcg-target.c.inc | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
> static void tcg_out_movi(TCGContext *s, TCGType type,
> TCGReg ret, tcg_target_long arg)
> {
> - tcg_out_movi_int(s, type, ret, arg, false);
> + tcg_debug_assert(ret != TCG_REG_T2);
> + tcg_out_movi_int(s, type, ret, arg, false, TCG_REG_T2);
Here we assert that 'ret' isn't TCG_REG_T2, but in
tcg_out_addsub2_i64() we do:
tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_T2, bh);
and
tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_T2, bh + (is_sub ? -1 : 1));
Otherwise looks OK.
thanks
-- PMM