qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 20/35] tcg/sparc64: Hoist read of tcg_cond_to_rcond


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 20/35] tcg/sparc64: Hoist read of tcg_cond_to_rcond
Date: Mon, 6 Nov 2023 22:02:10 +0100
User-agent: Mozilla Thunderbird

On 28/10/23 21:45, Richard Henderson wrote:
Use a non-zero value here (an illegal encoding) as a better
condition than is_unsigned_cond for when MOVR/BPR is usable.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  tcg/sparc64/tcg-target.c.inc | 25 ++++++++++++++-----------
  1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc
index ac86b92b75..e16b25e309 100644
--- a/tcg/sparc64/tcg-target.c.inc
+++ b/tcg/sparc64/tcg-target.c.inc
@@ -620,7 +620,7 @@ static const uint8_t tcg_cond_to_bcond[] = {
      [TCG_COND_GTU] = COND_GU,
  };
-static const uint8_t tcg_cond_to_rcond[] = {
+static const uint8_t tcg_cond_to_rcond[16] = {


-static void tcg_out_movr(TCGContext *s, TCGCond cond, TCGReg ret, TCGReg c1,
+static void tcg_out_movr(TCGContext *s, int rcond, TCGReg ret, TCGReg c1,

Isn't rcond unsigned?

Regardless,
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

                           int32_t v1, int v1const)
  {
-    tcg_out32(s, ARITH_MOVR | INSN_RD(ret) | INSN_RS1(c1)
-              | (tcg_cond_to_rcond[cond] << 10)
+    tcg_out32(s, ARITH_MOVR | INSN_RD(ret) | INSN_RS1(c1) | (rcond << 10)
                | (v1const ? INSN_IMM10(v1) : INSN_RS2(v1)));
  }




reply via email to

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