[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 11/18] tcg/s390: Implement field extraction opcod
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v2 11/18] tcg/s390: Implement field extraction opcodes |
Date: |
Tue, 18 Oct 2016 08:10:24 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/s390/tcg-target.h | 4 ++--
tcg/s390/tcg-target.inc.c | 11 +++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
index 9220f1f..52b33d7 100644
--- a/tcg/s390/tcg-target.h
+++ b/tcg/s390/tcg-target.h
@@ -78,7 +78,7 @@ extern uint64_t s390_facilities;
#define TCG_TARGET_HAS_nand_i32 0
#define TCG_TARGET_HAS_nor_i32 0
#define TCG_TARGET_HAS_deposit_i32 (s390_facilities & FACILITY_GEN_INST_EXT)
-#define TCG_TARGET_HAS_extract_i32 0
+#define TCG_TARGET_HAS_extract_i32 (s390_facilities & FACILITY_GEN_INST_EXT)
#define TCG_TARGET_HAS_sextract_i32 0
#define TCG_TARGET_HAS_movcond_i32 1
#define TCG_TARGET_HAS_add2_i32 1
@@ -109,7 +109,7 @@ extern uint64_t s390_facilities;
#define TCG_TARGET_HAS_nand_i64 0
#define TCG_TARGET_HAS_nor_i64 0
#define TCG_TARGET_HAS_deposit_i64 (s390_facilities & FACILITY_GEN_INST_EXT)
-#define TCG_TARGET_HAS_extract_i64 0
+#define TCG_TARGET_HAS_extract_i64 (s390_facilities & FACILITY_GEN_INST_EXT)
#define TCG_TARGET_HAS_sextract_i64 0
#define TCG_TARGET_HAS_movcond_i64 1
#define TCG_TARGET_HAS_add2_i64 1
diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c
index 9f51133..083c992 100644
--- a/tcg/s390/tcg-target.inc.c
+++ b/tcg/s390/tcg-target.inc.c
@@ -1247,6 +1247,12 @@ static void tgen_deposit(TCGContext *s, TCGReg dest,
TCGReg src,
tcg_out_risbg(s, dest, src, msb, lsb, ofs, 0);
}
+static void tgen_extract(TCGContext *s, TCGReg dest, TCGReg src,
+ int ofs, int len)
+{
+ tcg_out_risbg(s, dest, src, 64 - len, 63, 64 - ofs, 1);
+}
+
static void tgen_gotoi(TCGContext *s, int cc, tcg_insn_unit *dest)
{
ptrdiff_t off = dest - s->code_ptr;
@@ -2153,6 +2159,9 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
OP_32_64(deposit):
tgen_deposit(s, args[0], args[2], args[3], args[4]);
break;
+ OP_32_64(extract):
+ tgen_extract(s, args[0], args[1], args[2], args[3]);
+ break;
case INDEX_op_mb:
/* The host memory model is quite strong, we simply need to
@@ -2222,6 +2231,7 @@ static const TCGTargetOpDef s390_op_defs[] = {
{ INDEX_op_setcond_i32, { "r", "r", "rC" } },
{ INDEX_op_movcond_i32, { "r", "r", "rC", "r", "0" } },
{ INDEX_op_deposit_i32, { "r", "0", "r" } },
+ { INDEX_op_extract_i32, { "r", "r" } },
{ INDEX_op_qemu_ld_i32, { "r", "L" } },
{ INDEX_op_qemu_ld_i64, { "r", "L" } },
@@ -2283,6 +2293,7 @@ static const TCGTargetOpDef s390_op_defs[] = {
{ INDEX_op_setcond_i64, { "r", "r", "rC" } },
{ INDEX_op_movcond_i64, { "r", "r", "rC", "r", "0" } },
{ INDEX_op_deposit_i64, { "r", "0", "r" } },
+ { INDEX_op_extract_i64, { "r", "r" } },
{ INDEX_op_mb, { } },
{ -1 },
--
2.7.4
- [Qemu-devel] [PATCH v2 10/18] tcg/s390: Expose host facilities to tcg-target.h, (continued)
- [Qemu-devel] [PATCH v2 10/18] tcg/s390: Expose host facilities to tcg-target.h, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 16/18] target-mips: Use the new extract op, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 14/18] target-arm: Use new deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 12/18] tcg/s390: Support deposit into zero, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 13/18] target-alpha: Use deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 18/18] target-s390x: Use the new deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 08/18] tcg/mips: Implement field extraction opcodes, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 11/18] tcg/s390: Implement field extraction opcodes,
Richard Henderson <=
- [Qemu-devel] [PATCH v2 17/18] target-ppc: Use the new deposit and extract ops, Richard Henderson, 2016/10/18
- [Qemu-devel] [PATCH v2 15/18] target-i386: Use new deposit and extract ops, Richard Henderson, 2016/10/18
- Re: [Qemu-devel] [PATCH v2 00/18] tcg field extract primitives, no-reply, 2016/10/18
- Re: [Qemu-devel] [PATCH v2 00/18] tcg field extract primitives, Richard Henderson, 2016/10/24