qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 4/4] target/mips: Do not treat msa INSERT as NOP when wd is z


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 4/4] target/mips: Do not treat msa INSERT as NOP when wd is zero
Date: Tue, 31 May 2022 10:09:26 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 3/5/22 15:07, nihui wrote:
From: Ni Hui <shuizhuyuanluo@126.com>

Only for msa COPY_U/COPY_S with wd zero, we treat it as NOP.

Move this special rule into COPY_U and COPY_S trans function.

Fixes: 97fe675519 ("target/mips: Convert MSA COPY_S and INSERT opcodes to decodetree")

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Ni Hui <shuizhuyuanluo@126.com>
---
  target/mips/tcg/msa_translate.c | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
index 92ccc6f921..0b3dd0957c 100644
--- a/target/mips/tcg/msa_translate.c
+++ b/target/mips/tcg/msa_translate.c
@@ -603,11 +603,6 @@ static bool trans_msa_elm_fn(DisasContext *ctx, 
arg_msa_elm_df *a,
          return true;
      }
- if (a->wd == 0) {
-        /* Treat as NOP. */
-        return true;
-    }
-
      gen_msa_elm[a->df](cpu_env,
                         tcg_constant_i32(a->wd),
                         tcg_constant_i32(a->ws),
@@ -624,6 +619,11 @@ static bool trans_msa_elm_fn(DisasContext *ctx, 
arg_msa_elm_df *a,
static bool trans_COPY_U(DisasContext *ctx, arg_msa_elm_df *a)
  {
+    if (a->wd == 0) {
+        /* Treat as NOP. */
+        return true;
+    }
+
      static gen_helper_piii * const gen_msa_copy_u[4] = {
          gen_helper_msa_copy_u_b, gen_helper_msa_copy_u_h,
          NULL_IF_MIPS32(gen_helper_msa_copy_u_w), NULL
@@ -634,6 +634,11 @@ static bool trans_COPY_U(DisasContext *ctx, arg_msa_elm_df 
*a)
static bool trans_COPY_S(DisasContext *ctx, arg_msa_elm_df *a)
  {
+    if (a->wd == 0) {
+        /* Treat as NOP. */
+        return true;
+    }
+
      static gen_helper_piii * const gen_msa_copy_s[4] = {
          gen_helper_msa_copy_s_b, gen_helper_msa_copy_s_h,
          gen_helper_msa_copy_s_w, NULL_IF_MIPS32(gen_helper_msa_copy_s_d)




reply via email to

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