qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH RESEND v5 14/57] target/loongarch: Implement xvadd/xvsub


From: Richard Henderson
Subject: Re: [PATCH RESEND v5 14/57] target/loongarch: Implement xvadd/xvsub
Date: Sat, 9 Sep 2023 18:44:06 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

On 9/7/23 01:31, Song Gao wrote:
--- a/target/loongarch/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/insn_trans/trans_vec.c.inc
@@ -208,6 +208,16 @@ static bool gvec_vvv(DisasContext *ctx, arg_vvv *a, MemOp 
mop,
      return gvec_vvv_vl(ctx, a, 16, mop, func);
  }
+static bool gvec_xxx(DisasContext *ctx, arg_vvv *a, MemOp mop,
+                     void (*func)(unsigned, uint32_t, uint32_t,
+                                  uint32_t, uint32_t, uint32_t))
+{
+    if (!check_vec(ctx, 32)) {
+        return true;
+    }
+
+    return gvec_vvv_vl(ctx, a, 32, mop, func);
+}

You can move check_vec into gvec_vvv_vl, removing it from gvec_vvv.

+static bool gen_vaddsub_q_vl(DisasContext *ctx, arg_vvv *a, uint32_t oprsz,
+                             void (*func)(TCGv_i64, TCGv_i64, TCGv_i64,
+                                          TCGv_i64, TCGv_i64, TCGv_i64))
+{
+    int i;
+    TCGv_i64 rh, rl, ah, al, bh, bl;

Have check_vec here ...

+static bool gen_vaddsub_q(DisasContext *ctx, arg_vvv *a,
+                          void (*func)(TCGv_i64, TCGv_i64, TCGv_i64,
+                                       TCGv_i64, TCGv_i64, TCGv_i64))
+{
+    if (!check_vec(ctx, 16)) {
+        return true;
+    }
+
+    return gen_vaddsub_q_vl(ctx, a, 16, func);
+}
+
+static bool gen_xvaddsub_q(DisasContext *ctx, arg_vvv *a,
+                           void (*func)(TCGv_i64, TCGv_i64, TCGv_i64,
+                                        TCGv_i64, TCGv_i64, TCGv_i64))
+{
+    if (!check_vec(ctx, 32)) {
+        return true;
+    }
+    return gen_vaddsub_q_vl(ctx, a, 16, func);
+}

... instead of these two places.


r~



reply via email to

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