[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 27/49] target/ppc: implement vrlqmi
From: |
matheus . ferst |
Subject: |
[PATCH v5 27/49] target/ppc: implement vrlqmi |
Date: |
Fri, 25 Feb 2022 18:09:14 -0300 |
From: Matheus Ferst <matheus.ferst@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
target/ppc/insn32.decode | 1 +
target/ppc/translate/vmx-impl.c.inc | 21 +++++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/target/ppc/insn32.decode b/target/ppc/insn32.decode
index 87d482c5d9..abc2007129 100644
--- a/target/ppc/insn32.decode
+++ b/target/ppc/insn32.decode
@@ -495,6 +495,7 @@ VRLQ 000100 ..... ..... ..... 00000000101 @VX
VRLWMI 000100 ..... ..... ..... 00010000101 @VX
VRLDMI 000100 ..... ..... ..... 00011000101 @VX
+VRLQMI 000100 ..... ..... ..... 00001000101 @VX
VRLWNM 000100 ..... ..... ..... 00110000101 @VX
VRLDNM 000100 ..... ..... ..... 00111000101 @VX
diff --git a/target/ppc/translate/vmx-impl.c.inc
b/target/ppc/translate/vmx-impl.c.inc
index eb305e84da..352250fad0 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -1109,7 +1109,8 @@ static void do_vrlq_mask(TCGv_i64 mh, TCGv_i64 ml,
TCGv_i64 b, TCGv_i64 e)
tcg_temp_free_i64(t1);
}
-static bool do_vector_rotl_quad(DisasContext *ctx, arg_VX *a, bool mask)
+static bool do_vector_rotl_quad(DisasContext *ctx, arg_VX *a, bool mask,
+ bool insert)
{
TCGv_i64 ah, al, vrb, n, t0, t1, zero = tcg_constant_i64(0);
@@ -1146,7 +1147,7 @@ static bool do_vector_rotl_quad(DisasContext *ctx, arg_VX
*a, bool mask)
tcg_gen_shri_i64(ah, ah, 1);
tcg_gen_or_i64(t1, ah, t1);
- if (mask) {
+ if (mask || insert) {
tcg_gen_shri_i64(n, vrb, 8);
tcg_gen_shri_i64(vrb, vrb, 16);
tcg_gen_andi_i64(n, n, 0x7f);
@@ -1156,6 +1157,17 @@ static bool do_vector_rotl_quad(DisasContext *ctx,
arg_VX *a, bool mask)
tcg_gen_and_i64(t0, t0, ah);
tcg_gen_and_i64(t1, t1, al);
+
+ if (insert) {
+ get_avr64(n, a->vrt, true);
+ get_avr64(vrb, a->vrt, false);
+ tcg_gen_not_i64(ah, ah);
+ tcg_gen_not_i64(al, al);
+ tcg_gen_and_i64(n, n, ah);
+ tcg_gen_and_i64(vrb, vrb, al);
+ tcg_gen_or_i64(t0, t0, n);
+ tcg_gen_or_i64(t1, t1, vrb);
+ }
}
set_avr64(a->vrt, t0, true);
@@ -1171,8 +1183,9 @@ static bool do_vector_rotl_quad(DisasContext *ctx, arg_VX
*a, bool mask)
return true;
}
-TRANS(VRLQ, do_vector_rotl_quad, false)
-TRANS(VRLQNM, do_vector_rotl_quad, true)
+TRANS(VRLQ, do_vector_rotl_quad, false, false)
+TRANS(VRLQNM, do_vector_rotl_quad, true, false)
+TRANS(VRLQMI, do_vector_rotl_quad, false, true)
#define GEN_VXFORM_SAT(NAME, VECE, NORM, SAT, OPC2, OPC3) \
static void glue(glue(gen_, NAME), _vec)(unsigned vece, TCGv_vec t, \
--
2.25.1
- [PATCH v5 17/49] target/ppc: implement vcntmb[bhwd], (continued)
- [PATCH v5 17/49] target/ppc: implement vcntmb[bhwd], matheus . ferst, 2022/02/25
- [PATCH v5 19/49] target/ppc: move vs[lr][a][bhwd] to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 18/49] target/ppc: implement vgnb, matheus . ferst, 2022/02/25
- [PATCH v5 21/49] target/ppc: implement vsrq, matheus . ferst, 2022/02/25
- [PATCH v5 20/49] target/ppc: implement vslq, matheus . ferst, 2022/02/25
- [PATCH v5 22/49] target/ppc: implement vsraq, matheus . ferst, 2022/02/25
- [PATCH v5 23/49] target/ppc: move vrl[bhwd] to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 24/49] target/ppc: move vrl[bhwd]nm/vrl[bhwd]mi to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 25/49] target/ppc: implement vrlq, matheus . ferst, 2022/02/25
- [PATCH v5 27/49] target/ppc: implement vrlqmi,
matheus . ferst <=
- [PATCH v5 26/49] target/ppc: implement vrlqnm, matheus . ferst, 2022/02/25
- [PATCH v5 28/49] target/ppc: Move vsel and vperm/vpermr to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 29/49] target/ppc: Move xxsel to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 30/49] target/ppc: move xxperm/xxpermr to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 31/49] target/ppc: Move xxpermdi to decodetree, matheus . ferst, 2022/02/25
- [PATCH v5 32/49] target/ppc: Implement xxpermx instruction, matheus . ferst, 2022/02/25
- [PATCH v5 33/49] tcg/tcg-op-gvec.c: Introduce tcg_gen_gvec_4i, matheus . ferst, 2022/02/25
- [PATCH v5 34/49] target/ppc: Implement xxeval, matheus . ferst, 2022/02/25