All of lore.kernel.org
 help / color / mirror / Atom feed
From: matheus.ferst@eldorado.org.br
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: danielhb413@gmail.com, richard.henderson@linaro.org,
	groug@kaod.org, clg@kaod.org,
	Matheus Ferst <matheus.ferst@eldorado.org.br>,
	david@gibson.dropbear.id.au
Subject: [PATCH 13/37] target/ppc: Implement Vector Compare Quadword
Date: Fri,  7 Jan 2022 15:56:29 -0300	[thread overview]
Message-ID: <20220107185653.1609775-14-matheus.ferst@eldorado.org.br> (raw)
In-Reply-To: <20220107185653.1609775-1-matheus.ferst@eldorado.org.br>

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

Implement the following PowerISA v3.1 instructions:
vcmpsq: Vector Compare Signed Quadword
vcmpuq: Vector Compare Unsigned Quadword

Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
 target/ppc/insn32.decode            |  6 ++++
 target/ppc/translate/vmx-impl.c.inc | 45 +++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/target/ppc/insn32.decode b/target/ppc/insn32.decode
index 45649f7d1d..605e66872e 100644
--- a/target/ppc/insn32.decode
+++ b/target/ppc/insn32.decode
@@ -60,6 +60,9 @@
 &VX             vrt vra vrb
 @VX             ...... vrt:5 vra:5 vrb:5 .......... .   &VX
 
+&VX_bf          bf vra vrb
+@VX_bf          ...... bf:3 .. vra:5 vrb:5 ...........          &VX_bf
+
 &VX_uim4        vrt uim vrb
 @VX_uim4        ...... vrt:5 . uim:4 vrb:5 ...........  &VX_uim4
 
@@ -404,6 +407,9 @@ VCMPNEZB        000100 ..... ..... ..... . 0100000111   @VC
 VCMPNEZH        000100 ..... ..... ..... . 0101000111   @VC
 VCMPNEZW        000100 ..... ..... ..... . 0110000111   @VC
 
+VCMPSQ          000100 ... -- ..... ..... 00101000001   @VX_bf
+VCMPUQ          000100 ... -- ..... ..... 00100000001   @VX_bf
+
 ## Vector Bit Manipulation Instruction
 
 VCFUGED         000100 ..... ..... ..... 10101001101    @VX
diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index 302ef4370a..2c13fbeb39 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -1204,6 +1204,51 @@ static bool do_vcmpgtq(DisasContext *ctx, arg_VC *a, bool sign)
 TRANS(VCMPGTSQ, do_vcmpgtq, true)
 TRANS(VCMPGTUQ, do_vcmpgtq, false)
 
+static bool do_vcmpq(DisasContext *ctx, arg_VX_bf *a, bool sign)
+{
+    TCGv_i64 vra, vrb;
+    TCGLabel *gt, *lt, *done;
+
+    REQUIRE_INSNS_FLAGS2(ctx, ISA310);
+    REQUIRE_VECTOR(ctx);
+
+    vra = tcg_temp_local_new_i64();
+    vrb = tcg_temp_local_new_i64();
+    gt = gen_new_label();
+    lt = gen_new_label();
+    done = gen_new_label();
+
+    get_avr64(vra, a->vra, true);
+    get_avr64(vrb, a->vrb, true);
+    tcg_gen_brcond_i64((sign ? TCG_COND_GT : TCG_COND_GTU), vra, vrb, gt);
+    tcg_gen_brcond_i64((sign ? TCG_COND_LT : TCG_COND_LTU), vra, vrb, lt);
+
+    get_avr64(vra, a->vra, false);
+    get_avr64(vrb, a->vrb, false);
+    tcg_gen_brcond_i64(TCG_COND_GTU, vra, vrb, gt);
+    tcg_gen_brcond_i64(TCG_COND_LTU, vra, vrb, lt);
+
+    tcg_gen_movi_i32(cpu_crf[a->bf], CRF_EQ);
+    tcg_gen_br(done);
+
+    gen_set_label(gt);
+    tcg_gen_movi_i32(cpu_crf[a->bf], CRF_GT);
+    tcg_gen_br(done);
+
+    gen_set_label(lt);
+    tcg_gen_movi_i32(cpu_crf[a->bf], CRF_LT);
+    tcg_gen_br(done);
+
+    gen_set_label(done);
+    tcg_temp_free_i64(vra);
+    tcg_temp_free_i64(vrb);
+
+    return true;
+}
+
+TRANS(VCMPSQ, do_vcmpq, true)
+TRANS(VCMPUQ, do_vcmpq, false)
+
 GEN_VXRFORM(vcmpeqfp, 3, 3)
 GEN_VXRFORM(vcmpgefp, 3, 7)
 GEN_VXRFORM(vcmpgtfp, 3, 11)
-- 
2.25.1



  parent reply	other threads:[~2022-01-07 19:21 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 18:56 [PATCH 00/37] target/ppc: PowerISA Vector/VSX instruction batch matheus.ferst
2022-01-07 18:56 ` [PATCH 01/37] target/ppc: Introduce TRANS*FLAGS macros matheus.ferst
2022-01-09  4:02   ` Richard Henderson
2022-01-07 18:56 ` [PATCH 02/37] target/ppc: moved vector even and odd multiplication to decodetree matheus.ferst
2022-01-07 18:56 ` [PATCH 03/37] target/ppc: Moved vector multiply high and low " matheus.ferst
2022-01-07 18:56 ` [PATCH 04/37] target/ppc: vmulh* instructions use gvec matheus.ferst
2022-01-07 18:56 ` [PATCH 05/37] target/ppc: Implement vmsumcud instruction matheus.ferst
2022-01-07 18:56 ` [PATCH 06/37] target/ppc: Implement vmsumudm instruction matheus.ferst
2022-01-07 18:56 ` [PATCH 07/37] target/ppc: Move vexts[bhw]2[wd] to decodetree matheus.ferst
2022-01-07 18:56 ` [PATCH 08/37] target/ppc: Implement vextsd2q matheus.ferst
2022-01-07 18:56 ` [PATCH 09/37] target/ppc: Move Vector Compare Equal/Not Equal/Greater Than to decodetree matheus.ferst
2022-01-07 18:56 ` [PATCH 10/37] target/ppc: Move Vector Compare Not Equal or Zero " matheus.ferst
2022-01-07 18:56 ` [PATCH 11/37] target/ppc: Implement Vector Compare Equal Quadword matheus.ferst
2022-01-07 18:56 ` [PATCH 12/37] target/ppc: Implement Vector Compare Greater Than Quadword matheus.ferst
2022-01-07 18:56 ` matheus.ferst [this message]
2022-01-07 18:56 ` [PATCH 14/37] target/ppc: implement vstri[bh][lr] matheus.ferst
2022-01-07 18:56 ` [PATCH 15/37] target/ppc: implement vclrlb matheus.ferst
2022-01-07 18:56 ` [PATCH 16/37] target/ppc: implement vclrrb matheus.ferst
2022-01-07 18:56 ` [PATCH 17/37] target/ppc: implement vcntmb[bhwd] matheus.ferst
2022-01-07 18:56 ` [PATCH 18/37] target/ppc: implement vgnb matheus.ferst
2022-01-07 18:56 ` [PATCH 19/37] target/ppc: Move vsel and vperm/vpermr to decodetree matheus.ferst
2022-01-07 18:56 ` [PATCH 20/37] target/ppc: Move xxsel " matheus.ferst
2022-01-07 18:56 ` [PATCH 21/37] target/ppc: move xxperm/xxpermr " matheus.ferst
2022-01-07 18:56 ` [PATCH 22/37] target/ppc: Move xxpermdi " matheus.ferst
2022-01-07 18:56 ` [PATCH 23/37] target/ppc: Implement xxpermx instruction matheus.ferst
2022-01-07 18:56 ` [PATCH 24/37] tcg/tcg-op-gvec.c: Introduce tcg_gen_gvec_4i matheus.ferst
2022-01-07 18:56 ` [PATCH 25/37] target/ppc: Implement xxeval matheus.ferst
2022-01-07 18:56 ` [PATCH 26/37] target/ppc: Implement xxgenpcv[bhwd]m instruction matheus.ferst
2022-01-07 18:56 ` [PATCH 27/37] target/ppc: move xs[n]madd[am][ds]p/xs[n]msub[am][ds]p to decodetree matheus.ferst
2022-01-07 18:56 ` [PATCH 28/37] target/ppc: implement xs[n]maddqp[o]/xs[n]msubqp[o] matheus.ferst
2022-01-07 18:56 ` [PATCH 29/37] target/ppc: Implement xvtlsbb instruction matheus.ferst
2022-01-07 18:56 ` [PATCH 30/37] target/ppc: Refactor VSX_SCALAR_CMP_DP matheus.ferst
2022-01-07 18:56 ` [PATCH 31/37] target/ppc: Implement xscmp{eq,ge,gt}qp matheus.ferst
2022-01-07 18:56 ` [PATCH 32/37] target/ppc: Implement do_helper_XX3 and move xxperm* to use it matheus.ferst
2022-01-07 18:56 ` [PATCH 33/37] target/ppc: Move xscmp{eq,ge,gt,ne}dp to decodetree matheus.ferst
2022-01-07 18:56 ` [PATCH 34/37] target/ppc: Move xs{max, min}[cj]dp to use do_helper_XX3 matheus.ferst
2022-01-07 18:56 ` [PATCH 35/37] target/ppc: Refactor VSX_MAX_MINC helper matheus.ferst
2022-01-07 18:56 ` [PATCH 36/37] target/ppc: Implement xs{max,min}cqp matheus.ferst
2022-01-07 18:56 ` [PATCH 37/37] target/ppc: Implement xvcvbf16spn and xvcvspbf16 instructions matheus.ferst
2022-01-10 14:51 ` [PATCH 00/37] target/ppc: PowerISA Vector/VSX instruction batch Daniel Henrique Barboza
2022-01-24 17:01 ` Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220107185653.1609775-14-matheus.ferst@eldorado.org.br \
    --to=matheus.ferst@eldorado.org.br \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.