qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 55/81] tcg: Merge INDEX_op_and_{i32,i64}


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 55/81] tcg: Merge INDEX_op_and_{i32,i64}
Date: Wed, 8 Jan 2025 18:53:58 +0100
User-agent: Mozilla Thunderbird

On 7/1/25 09:00, Richard Henderson wrote:
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  include/tcg/tcg-opc.h    |  3 +--
  target/sh4/translate.c   |  4 ++--
  tcg/optimize.c           | 40 ++++++++++++----------------------------
  tcg/tcg-op.c             |  4 ++--
  tcg/tcg.c                |  9 +++------
  tcg/tci.c                |  5 ++---
  tcg/tci/tcg-target.c.inc |  2 +-
  7 files changed, 23 insertions(+), 44 deletions(-)


@@ -1694,8 +1693,7 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op)
      TempOptInfo *t2 = arg_info(op->args[2]);
      int ofs = op->args[3];
      int len = op->args[4];
-    int width;
-    TCGOpcode and_opc;
+    int width = ctx->type == TCG_TYPE_I32 ? 32 : 64;

Some places (like in patch #10) you add assertions and here you remove.
Could leaving the switch case help if someone hypotecally implement for
128-bit hosts?

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

      uint64_t z_mask, s_mask;
if (ti_is_const(t1) && ti_is_const(t2)) {
@@ -1704,24 +1702,11 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op)
                                            ti_const_val(t2)));
      }
- switch (ctx->type) {
-    case TCG_TYPE_I32:
-        and_opc = INDEX_op_and_i32;
-        width = 32;
-        break;
-    case TCG_TYPE_I64:
-        and_opc = INDEX_op_and_i64;
-        width = 64;
-        break;
-    default:
-        g_assert_not_reached();
-    }




reply via email to

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