qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH 16/33] target/ppc: Implement Vector Insert Word from GPR usin


From: Richard Henderson
Subject: Re: [PATCH 16/33] target/ppc: Implement Vector Insert Word from GPR using Immediate insns
Date: Fri, 22 Oct 2021 21:42:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/21/21 12:45 PM, matheus.ferst@eldorado.org.br wrote:
+static bool do_vins_VX_uim4(DisasContext *ctx, arg_VX_uim4 *a, int size,
+                        void (*gen_helper)(TCGv_ptr, TCGv_ptr, TCGv_i64, TCGv))
+{
+    REQUIRE_INSNS_FLAGS2(ctx, ISA310);
+    REQUIRE_VECTOR(ctx);
+
+    if (a->uim > (16 - size)) {
+        qemu_log_mask(LOG_GUEST_ERROR, "Invalid index for VINS* at"
+            " 0x" TARGET_FMT_lx ", UIM = %d > %d\n", ctx->cia, a->uim,
+            16 - size);
+        return true;
+    }

Does this really do nothing on real hw?
I know the manual says undefined, but I would have expected SIGILL.

+#if defined(TARGET_PPC64)
+    return do_vinsx(ctx, a->vrt, size, false, tcg_constant_tl(a->uim),
+                    cpu_gpr[a->vrb], gen_helper);
+#else
+    bool ok;
+    TCGv_i64 val;
+
+    val = tcg_temp_new_i64();
+    tcg_gen_extu_tl_i64(val, cpu_gpr[a->vrb]);
+
+    ok = do_vinsx(ctx, a->vrt, size, false, tcg_constant_tl(a->uim), val,
+                  gen_helper);
+
+    tcg_temp_free_i64(val);
+    return ok;
+#endif

Similarly wrt target_ulong.

r~



reply via email to

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