[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 09/13] tcg/i386: Implement vector vmrgh instructi
From: |
Stefan Brankovic |
Subject: |
[Qemu-devel] [PATCH v4 09/13] tcg/i386: Implement vector vmrgh instructions |
Date: |
Thu, 27 Jun 2019 12:56:21 +0200 |
Signed-off-by: Stefan Brankovic <address@hidden>
---
tcg/i386/tcg-target.h | 2 +-
tcg/i386/tcg-target.inc.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index e11b22d..daae35f 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -192,7 +192,7 @@ extern bool have_avx2;
#define TCG_TARGET_HAS_minmax_vec 1
#define TCG_TARGET_HAS_bitsel_vec 0
#define TCG_TARGET_HAS_cmpsel_vec -1
-#define TCG_TARGET_HAS_vmrgh_vec 0
+#define TCG_TARGET_HAS_vmrgh_vec 1
#define TCG_TARGET_deposit_i32_valid(ofs, len) \
(((ofs) == 0 && (len) == 8) || ((ofs) == 8 && (len) == 8) || \
diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c
index 6ddeebf..31e1b2b 100644
--- a/tcg/i386/tcg-target.inc.c
+++ b/tcg/i386/tcg-target.inc.c
@@ -2823,6 +2823,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_umax_vec:
insn = umax_insn[vece];
goto gen_simd;
+ case INDEX_op_vmrgh_vec:
+ insn = punpckh_insn[vece];
+ goto gen_simd;
case INDEX_op_shlv_vec:
insn = shlv_insn[vece];
goto gen_simd;
@@ -3223,6 +3226,7 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode
op)
case INDEX_op_umin_vec:
case INDEX_op_smax_vec:
case INDEX_op_umax_vec:
+ case INDEX_op_vmrgh_vec:
case INDEX_op_shlv_vec:
case INDEX_op_shrv_vec:
case INDEX_op_sarv_vec:
@@ -3321,6 +3325,8 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type,
unsigned vece)
case INDEX_op_umax_vec:
case INDEX_op_abs_vec:
return vece <= MO_32;
+ case INDEX_op_vmrgh_vec:
+ return vece <= MO_32 ? -1 : 0;
default:
return 0;
@@ -3614,6 +3620,14 @@ static void expand_vec_cmpsel(TCGType type, unsigned
vece, TCGv_vec v0,
tcg_temp_free_vec(t);
}
+static void expand_vec_vmrg(TCGOpcode opc, TCGType type, unsigned vece,
+ TCGv_vec v0, TCGv_vec v1, TCGv_vec v2)
+{
+ vec_gen_3(opc, type, vece,
+ tcgv_vec_arg(v0), tcgv_vec_arg(v2),
+ tcgv_vec_arg(v1));
+}
+
void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece,
TCGArg a0, ...)
{
@@ -3653,6 +3667,11 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type,
unsigned vece,
expand_vec_cmpsel(type, vece, v0, v1, v2, v3, v4, va_arg(va, TCGArg));
break;
+ case INDEX_op_vmrgh_vec:
+ v2 = temp_tcgv_vec(arg_temp(a2));
+ expand_vec_vmrg(opc, type, vece, v0, v1, v2);
+ break;
+
default:
break;
}
--
2.7.4
- [Qemu-devel] [PATCH v4 00/13] target/ppc, tcg, tcg/i386: Optimize emulation of some Altivec instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 04/13] target/ppc: Optimize emulation of vclzd instruction, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 02/13] target/ppc: Optimize emulation of vsl and vsr instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 01/13] target/ppc: Optimize emulation of lvsl and lvsr instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 03/13] target/ppc: Optimize emulation of vgbbd instruction, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 05/13] target/ppc: Optimize emulation of vclzw instruction, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 06/13] target/ppc: Optimize emulation of vclzh and vclzb instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 09/13] tcg/i386: Implement vector vmrgh instructions,
Stefan Brankovic <=
- [Qemu-devel] [PATCH v4 10/13] target/ppc: convert vmrgh instructions to vector operations, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 07/13] target/ppc: Refactor emulation of vmrgew and vmrgow instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 11/13] tcg: Add opcodes for verctor vmrgl instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 12/13] tcg/i386: Implement vector vmrgl instructions, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 13/13] target/ppc: convert vmrgl instructions to vector operations, Stefan Brankovic, 2019/06/27
- [Qemu-devel] [PATCH v4 08/13] tcg: Add opcodes for vector vmrgh instructions, Stefan Brankovic, 2019/06/27
- Re: [Qemu-devel] [PATCH v4 00/13] target/ppc, tcg, tcg/i386: Optimize emulation of some Altivec instructions, Howard Spoelstra, 2019/06/27