[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 38/54] s390x/tcg: Implement VECTOR SUBTRACT
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 38/54] s390x/tcg: Implement VECTOR SUBTRACT |
Date: |
Mon, 20 May 2019 19:02:46 +0200 |
From: David Hildenbrand <address@hidden>
We can use tcg_gen_sub2_i64() to do 128-bit subtraction and otherwise
existing gvec helpers.
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 | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index f3bf9edfcab5..58a61f41efeb 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -1174,6 +1174,8 @@
F(0xe77c, VSRL, VRR_c, V, 0, 0, 0, 0, vsrl, 0, IF_VEC)
/* VECTOR SHIFT RIGHT LOGICAL BY BYTE */
F(0xe77d, VSRLB, VRR_c, V, 0, 0, 0, 0, vsrl, 0, IF_VEC)
+/* VECTOR SUBTRACT */
+ F(0xe7f7, VS, VRR_c, V, 0, 0, 0, 0, vs, 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 5dfbf1bcd408..5f53ae7ec546 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -2123,3 +2123,20 @@ static DisasJumpType op_vsrl(DisasContext *s, DisasOps
*o)
tcg_temp_free_i64(shift);
return DISAS_NEXT;
}
+
+static DisasJumpType op_vs(DisasContext *s, DisasOps *o)
+{
+ const uint8_t es = get_field(s->fields, m4);
+
+ if (es > ES_128) {
+ gen_program_exception(s, PGM_SPECIFICATION);
+ return DISAS_NORETURN;
+ } else if (es == ES_128) {
+ gen_gvec128_3_i64(tcg_gen_sub2_i64, get_field(s->fields, v1),
+ get_field(s->fields, v2), get_field(s->fields, v3));
+ return DISAS_NEXT;
+ }
+ gen_gvec_fn_3(sub, es, get_field(s->fields, v1), get_field(s->fields, v2),
+ get_field(s->fields, v3));
+ return DISAS_NEXT;
+}
--
2.20.1
- [qemu-s390x] [PULL 28/54] s390x/tcg: Implement VECTOR OR, (continued)
- [qemu-s390x] [PULL 28/54] s390x/tcg: Implement VECTOR OR, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 29/54] s390x/tcg: Implement VECTOR OR WITH COMPLEMENT, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 30/54] s390x/tcg: Implement VECTOR POPULATION COUNT, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 31/54] s390x/tcg: Implement VECTOR ELEMENT ROTATE LEFT LOGICAL, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 32/54] s390x/tcg: Implement VECTOR ELEMENT ROTATE AND INSERT UNDER MASK, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 33/54] s390x/tcg: Implement VECTOR ELEMENT SHIFT, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 34/54] s390x/tcg: Implement VECTOR SHIFT LEFT (BY BYTE), Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 35/54] s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 36/54] s390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 37/54] s390x/tcg: Implement VECTOR SHIFT RIGHT LOGICAL *, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 38/54] s390x/tcg: Implement VECTOR SUBTRACT,
Cornelia Huck <=
- [qemu-s390x] [PULL 39/54] s390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW INDICATION, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 40/54] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDICATION, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 42/54] s390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 41/54] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 44/54] s390x/tcg: Implement VECTOR SUM ACROSS WORD, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 43/54] s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 45/54] s390x/tcg: Implement VECTOR TEST UNDER MASK, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 47/54] s390x/cpumodel: ignore csske for expansion, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 46/54] linux headers: update against Linux 5.2-rc1, Cornelia Huck, 2019/05/20
- [qemu-s390x] [PULL 48/54] s390x/cpumodel: Miscellaneous-Instruction-Extensions Facility 3, Cornelia Huck, 2019/05/20