[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v2 26/32] s390x/tcg: Implement VECTOR SIGN EXTEND TO
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v2 26/32] s390x/tcg: Implement VECTOR SIGN EXTEND TO DOUBLEWORD |
Date: |
Fri, 1 Mar 2019 12:54:07 +0100 |
Load both elements signed and store them into the two 64 bit elements.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/insn-data.def | 2 ++
target/s390x/translate_vx.inc.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index ae58ff440b..555250fd5a 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -1032,6 +1032,8 @@
E(0xe71a, VSCEG, VRV, V, la2, 0, 0, 0, vsce, 0, ES_64, IF_VEC)
/* VECTOR SELECT */
F(0xe78d, VSEL, VRR_e, V, 0, 0, 0, 0, vsel, 0, IF_VEC)
+/* VECTOR SIGN EXTEND TO DOUBLEWORD */
+ F(0xe75f, VSEG, VRR_a, V, 0, 0, 0, 0, vseg, 0, IF_VEC)
#ifndef CONFIG_USER_ONLY
/* COMPARE AND SWAP AND PURGE */
diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.inc.c
index c65e76b6f6..e808d2abb2 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -780,3 +780,36 @@ static DisasJumpType op_vsel(DisasContext *s, DisasOps *o)
get_field(s->fields, v3), get_field(s->fields, v4), &gvec_op);
return DISAS_NEXT;
}
+
+static DisasJumpType op_vseg(DisasContext *s, DisasOps *o)
+{
+ const uint8_t es = get_field(s->fields, m3);
+ int idx1, idx2;
+ TCGv_i64 tmp;
+
+ switch (es) {
+ case ES_8:
+ idx1 = 7;
+ idx2 = 15;
+ break;
+ case ES_16:
+ idx1 = 3;
+ idx2 = 7;
+ break;
+ case ES_32:
+ idx1 = 1;
+ idx2 = 3;
+ break;
+ default:
+ gen_program_exception(s, PGM_SPECIFICATION);
+ return DISAS_NORETURN;
+ }
+
+ tmp = tcg_temp_new_i64();
+ read_vec_element_i64(tmp, get_field(s->fields, v2), idx1, es | MO_SIGN);
+ write_vec_element_i64(tmp, get_field(s->fields, v1), 0, ES_64);
+ read_vec_element_i64(tmp, get_field(s->fields, v2), idx2, es | MO_SIGN);
+ write_vec_element_i64(tmp, get_field(s->fields, v1), 1, ES_64);
+ tcg_temp_free_i64(tmp);
+ return DISAS_NEXT;
+}
--
2.17.2
- Re: [qemu-s390x] [Qemu-devel] [PATCH v2 19/32] s390x/tcg: Implement VECTOR PACK *, (continued)
- [qemu-s390x] [PATCH v2 21/32] s390x/tcg: Implement VECTOR PERMUTE DOUBLEWORD IMMEDIATE, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 22/32] s390x/tcg: Implement VECTOR REPLICATE, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 23/32] s390x/tcg: Implement VECTOR REPLICATE IMMEDIATE, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 24/32] s390x/tcg: Implement VECTOR SCATTER ELEMENT, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 25/32] s390x/tcg: Implement VECTOR SELECT, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 26/32] s390x/tcg: Implement VECTOR SIGN EXTEND TO DOUBLEWORD,
David Hildenbrand <=
- [qemu-s390x] [PATCH v2 27/32] s390x/tcg: Provide probe_write helper, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 28/32] s390x/tcg: Implement VECTOR STORE, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 29/32] s390x/tcg: Implement VECTOR STORE ELEMENT, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 30/32] s390x/tcg: Implement VECTOR STORE MULTIPLE, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 31/32] s390x/tcg: Implement VECTOR STORE WITH LENGTH, David Hildenbrand, 2019/03/01
- [qemu-s390x] [PATCH v2 32/32] s390x/tcg: Implement VECTOR UNPACK *, David Hildenbrand, 2019/03/01
- Re: [qemu-s390x] [Qemu-devel] [PATCH v2 00/32] s390x/tcg: Vector Instruction Support Part 1, no-reply, 2019/03/01