[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL SUBSYSTEM s390x 38/40] s390x/tcg: Implement VECTOR SU
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PULL SUBSYSTEM s390x 38/40] s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD |
Date: |
Fri, 17 May 2019 12:21:43 +0200 |
Similar to VECTOR SUM ACROSS DOUBLEWORD, however without a loop and
using 128-bit calculations.
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 | 32 ++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index dd37003082..2483ee01d7 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -1184,6 +1184,8 @@
F(0xe7bd, VSBCBI, VRR_d, V, 0, 0, 0, 0, vsbcbi, 0, IF_VEC)
/* VECTOR SUM ACROSS DOUBLEWORD */
F(0xe765, VSUMG, VRR_c, V, 0, 0, 0, 0, vsumg, 0, IF_VEC)
+/* VECTOR SUM ACROSS QUADWORD */
+ F(0xe767, VSUMQ, VRR_c, V, 0, 0, 0, 0, vsumq, 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 7b4efee5c0..16bfbfce57 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -2281,3 +2281,35 @@ static DisasJumpType op_vsumg(DisasContext *s, DisasOps
*o)
tcg_temp_free_i64(tmp);
return DISAS_NEXT;
}
+
+static DisasJumpType op_vsumq(DisasContext *s, DisasOps *o)
+{
+ const uint8_t es = get_field(s->fields, m4);
+ const uint8_t max_idx = NUM_VEC_ELEMENTS(es) - 1;
+ TCGv_i64 sumh, suml, zero, tmpl;
+ uint8_t idx;
+
+ if (es < ES_32 || es > ES_64) {
+ gen_program_exception(s, PGM_SPECIFICATION);
+ return DISAS_NORETURN;
+ }
+
+ sumh = tcg_const_i64(0);
+ suml = tcg_temp_new_i64();
+ zero = tcg_const_i64(0);
+ tmpl = tcg_temp_new_i64();
+
+ read_vec_element_i64(suml, get_field(s->fields, v3), max_idx, es);
+ for (idx = 0; idx <= max_idx; idx++) {
+ read_vec_element_i64(tmpl, get_field(s->fields, v2), idx, es);
+ tcg_gen_add2_i64(suml, sumh, suml, sumh, tmpl, zero);
+ }
+ write_vec_element_i64(sumh, get_field(s->fields, v1), 0, ES_64);
+ write_vec_element_i64(suml, get_field(s->fields, v1), 1, ES_64);
+
+ tcg_temp_free_i64(sumh);
+ tcg_temp_free_i64(suml);
+ tcg_temp_free_i64(zero);
+ tcg_temp_free_i64(tmpl);
+ return DISAS_NEXT;
+}
--
2.20.1
- [qemu-s390x] [PULL SUBSYSTEM s390x 00/40] s390x/tcg: s390x/tcg: Vector Instruction Support Part 2, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 08/40] s390x/tcg: Implement VECTOR CHECKSUM, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 40/40] s390x/tcg: Implement VECTOR TEST UNDER MASK, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 39/40] s390x/tcg: Implement VECTOR SUM ACROSS WORD, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 36/40] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 37/40] s390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 35/40] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDICATION, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 38/40] s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD,
David Hildenbrand <=
- [qemu-s390x] [PULL SUBSYSTEM s390x 32/40] s390x/tcg: Implement VECTOR SHIFT RIGHT LOGICAL *, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 34/40] s390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW INDICATION, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 33/40] s390x/tcg: Implement VECTOR SUBTRACT, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 31/40] s390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 30/40] s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 29/40] s390x/tcg: Implement VECTOR SHIFT LEFT (BY BYTE), David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 28/40] s390x/tcg: Implement VECTOR ELEMENT SHIFT, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 26/40] s390x/tcg: Implement VECTOR ELEMENT ROTATE LEFT LOGICAL, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 25/40] s390x/tcg: Implement VECTOR POPULATION COUNT, David Hildenbrand, 2019/05/17
- [qemu-s390x] [PULL SUBSYSTEM s390x 23/40] s390x/tcg: Implement VECTOR OR, David Hildenbrand, 2019/05/17