qemu-ppc
[Top][All Lists]
Advanced

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

[PATCH v2 33/38] target/ppc: Implement do_helper_XX3 and move xxperm* to


From: matheus . ferst
Subject: [PATCH v2 33/38] target/ppc: Implement do_helper_XX3 and move xxperm* to use it
Date: Tue, 25 Jan 2022 09:19:38 -0300

From: Víctor Colombo <victor.colombo@eldorado.org.br>

do_helper_XX3 is a wrapper for instructions that only call its helper.
It will be used later to implement instructions like xscmp*dp.

Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/translate/vsx-impl.c.inc | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/target/ppc/translate/vsx-impl.c.inc 
b/target/ppc/translate/vsx-impl.c.inc
index e1fea01a3a..330411f8a6 100644
--- a/target/ppc/translate/vsx-impl.c.inc
+++ b/target/ppc/translate/vsx-impl.c.inc
@@ -1159,7 +1159,8 @@ GEN_VSX_HELPER_X2(xvrspiz, 0x12, 0x09, 0, PPC2_VSX)
 GEN_VSX_HELPER_2(xvtstdcsp, 0x14, 0x1A, 0, PPC2_VSX)
 GEN_VSX_HELPER_2(xvtstdcdp, 0x14, 0x1E, 0, PPC2_VSX)
 
-static bool trans_XXPERM(DisasContext *ctx, arg_XX3 *a)
+static bool do_helper_XX3(DisasContext *ctx, arg_XX3 *a,
+    void (*helper)(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr))
 {
     TCGv_ptr xt, xa, xb;
 
@@ -1170,7 +1171,7 @@ static bool trans_XXPERM(DisasContext *ctx, arg_XX3 *a)
     xa = gen_vsr_ptr(a->xa);
     xb = gen_vsr_ptr(a->xb);
 
-    gen_helper_VPERM(xt, xa, xt, xb);
+    helper(cpu_env, xt, xa, xb);
 
     tcg_temp_free_ptr(xt);
     tcg_temp_free_ptr(xa);
@@ -1179,25 +1180,8 @@ static bool trans_XXPERM(DisasContext *ctx, arg_XX3 *a)
     return true;
 }
 
-static bool trans_XXPERMR(DisasContext *ctx, arg_XX3 *a)
-{
-    TCGv_ptr xt, xa, xb;
-
-    REQUIRE_INSNS_FLAGS2(ctx, ISA300);
-    REQUIRE_VSX(ctx);
-
-    xt = gen_vsr_ptr(a->xt);
-    xa = gen_vsr_ptr(a->xa);
-    xb = gen_vsr_ptr(a->xb);
-
-    gen_helper_VPERMR(xt, xa, xt, xb);
-
-    tcg_temp_free_ptr(xt);
-    tcg_temp_free_ptr(xa);
-    tcg_temp_free_ptr(xb);
-
-    return true;
-}
+TRANS(XXPERM, do_helper_XX3, gen_helper_VPERM);
+TRANS(XXPERMR, do_helper_XX3, gen_helper_VPERMR);
 
 static bool trans_XXPERMDI(DisasContext *ctx, arg_XX3_dm *a)
 {
-- 
2.25.1




reply via email to

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