[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-4.1 v3 08/17] tcg: Add tcg_out_dupm_vec to the b
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH for-4.1 v3 08/17] tcg: Add tcg_out_dupm_vec to the backend interface |
Date: |
Tue, 19 Mar 2019 10:21:17 -0700 |
Currently stubbed out in all backends that support vectors.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/aarch64/tcg-target.inc.c | 6 ++++++
tcg/i386/tcg-target.inc.c | 7 +++++++
tcg/tcg.c | 19 ++++++++++++++++++-
3 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c
index 17e35f2fb6..b34a1e5b06 100644
--- a/tcg/aarch64/tcg-target.inc.c
+++ b/tcg/aarch64/tcg-target.inc.c
@@ -822,6 +822,12 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type,
unsigned vece,
return true;
}
+static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
+ TCGReg r, TCGReg base, intptr_t offset)
+{
+ return false;
+}
+
static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd,
tcg_target_long value)
{
diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c
index 09e2308557..ae88df440a 100644
--- a/tcg/i386/tcg-target.inc.c
+++ b/tcg/i386/tcg-target.inc.c
@@ -890,6 +890,13 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type,
unsigned vece,
return true;
}
+static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
+ TCGReg r, TCGReg base, intptr_t offset)
+{
+ return false;
+}
+
+
static void tcg_out_dupi_vec(TCGContext *s, TCGType type,
TCGReg ret, tcg_target_long arg)
{
diff --git a/tcg/tcg.c b/tcg/tcg.c
index b11b30bbec..b157e52d5c 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -110,6 +110,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const
TCGArg *args,
#if TCG_TARGET_MAYBE_vec
static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
TCGReg dst, TCGReg src);
+static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
+ TCGReg dst, TCGReg base, intptr_t offset);
static void tcg_out_dupi_vec(TCGContext *s, TCGType type,
TCGReg dst, tcg_target_long arg);
static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl,
@@ -121,6 +123,11 @@ static inline bool tcg_out_dup_vec(TCGContext *s, TCGType
type, unsigned vece,
{
g_assert_not_reached();
}
+static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece,
+ TCGReg dst, TCGReg base, intptr_t offset)
+{
+ g_assert_not_reached();
+}
static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type,
TCGReg dst, tcg_target_long arg)
{
@@ -3412,6 +3419,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp
*op)
TCGRegSet dup_out_regs, dup_in_regs;
TCGTemp *its, *ots;
TCGType itype, vtype;
+ intptr_t endian_fixup;
unsigned vece;
bool ok;
@@ -3481,7 +3489,16 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp
*op)
/* fall through */
case TEMP_VAL_MEM:
- /* TODO: dup from memory */
+#ifdef HOST_WORDS_BIGENDIAN
+ endian_fixup = itype == TCG_TYPE_I32 ? 4 : 8;
+ endian_fixup -= 1 << vece;
+#else
+ endian_fixup = 0;
+#endif
+ if (tcg_out_dupm_vec(s, vtype, vece, ots->reg, its->mem_base->reg,
+ its->mem_offset + endian_fixup)) {
+ goto done;
+ }
tcg_out_ld(s, itype, ots->reg, its->mem_base->reg, its->mem_offset);
break;
--
2.17.2
- [Qemu-devel] [PATCH for-4.1 v3 00/17] tcg/ppc: Add vector opcodes, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 01/17] target/arm: Fill in .opc for cmtst_op, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 02/17] tcg: Assert fixed_reg is read-only, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 04/17] tcg: Support cross-class moves without instruction support, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 03/17] tcg: Return bool success from tcg_out_mov, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 05/17] tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 06/17] tcg: Promote tcg_out_{dup, dupi}_vec to backend interface, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 08/17] tcg: Add tcg_out_dupm_vec to the backend interface,
Richard Henderson <=
- [Qemu-devel] [PATCH for-4.1 v3 09/17] tcg/i386: Implement tcg_out_dupm_vec, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 07/17] tcg: Manually expand INDEX_op_dup_vec, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 10/17] tcg/aarch64: Implement tcg_out_dupm_vec, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 11/17] tcg: Add INDEX_op_dup_mem_vec, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 13/17] tcg/ppc: Support vector shift by immediate, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 14/17] tcg/ppc: Support vector multiply, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 15/17] tcg/ppc: Update vector support to v2.06, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 16/17] tcg/ppc: Update vector support to v2.07, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 12/17] tcg/ppc: Initial backend support for Altivec, Richard Henderson, 2019/03/19
- [Qemu-devel] [PATCH for-4.1 v3 17/17] tcg/ppc: Update vector support to v3.00, Richard Henderson, 2019/03/19