qemu-devel
[Top][All Lists]
Advanced

[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: Richard Henderson
Subject: Re: [PATCH v4 1/5] tcg/sparc: Add scratch argument to tcg_out_movi_int
Date: Sat, 5 Feb 2022 07:42:38 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/5/22 04:35, Peter Maydell wrote:
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.

Oops.  Good catch.  I shouldn't have moved the assert.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]