qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v4 11/17] target/riscv: support for 128-bit shift instruction


From: Richard Henderson
Subject: Re: [PATCH v4 11/17] target/riscv: support for 128-bit shift instructions
Date: Sat, 30 Oct 2021 21:03:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/25/21 5:28 AM, Frédéric Pétrot wrote:
+    if (get_xl(ctx) < MXL_RV128 || max_len < 128) {

Only the second test is required; the first is redundant.

  static bool gen_shift(DisasContext *ctx, arg_r *a, DisasExtend ext,
-                      void (*func)(TCGv, TCGv, TCGv))
+                      void (*func)(TCGv, TCGv, TCGv),
+                      void (*f128)(TCGv, TCGv, TCGv, TCGv, TCGv))
  {
-    TCGv dest = dest_gpr(ctx, a->rd);
-    TCGv src1 = get_gpr(ctx, a->rs1, ext);
      TCGv src2 = get_gpr(ctx, a->rs2, EXT_NONE);
      TCGv ext2 = tcg_temp_new();
tcg_gen_andi_tl(ext2, src2, get_olen(ctx) - 1);
-    func(dest, src1, ext2);
- gen_set_gpr(ctx, a->rd, dest);
+    TCGv dest = dest_gpr(ctx, a->rd);
+    TCGv src1 = get_gpr(ctx, a->rs1, ext);
+
+    if (get_xl(ctx) < MXL_RV128 || get_ol(ctx) < MXL_RV128) {

Again, only one test; probably better pulling out max_len, like we did above, since now we query OL twice.

+}
+
+

Careful with the extra lines.


r~



reply via email to

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