[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 36/40] s390x/tcg: Implement VECTOR SUBTRACT WITH
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v3 36/40] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION |
Date: |
Thu, 2 May 2019 16:10:15 +0200 |
Mostly courtesy of Richard H.
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/insn-data.def | 2 ++
target/s390x/translate_vx.inc.c | 34 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index a60d8531dc..a8d90517f6 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -1180,6 +1180,8 @@
F(0xe7f5, VSCBI, VRR_c, V, 0, 0, 0, 0, vscbi, 0, IF_VEC)
/* VECTOR SUBTRACT WITH BORROW INDICATION */
F(0xe7bf, VSBI, VRR_d, V, 0, 0, 0, 0, vsbi, 0, IF_VEC)
+/* VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION */
+ F(0xe7bd, VSBCBI, VRR_d, V, 0, 0, 0, 0, vsbcbi, 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 6e9cbe4c1a..b0b4d3640e 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -2214,3 +2214,37 @@ static DisasJumpType op_vsbi(DisasContext *s, DisasOps
*o)
get_field(s->fields, v4));
return DISAS_NEXT;
}
+
+static void gen_sbcbi2_i64(TCGv_i64 dl, TCGv_i64 dh, TCGv_i64 al, TCGv_i64 ah,
+ TCGv_i64 bl, TCGv_i64 bh, TCGv_i64 cl, TCGv_i64 ch)
+{
+ TCGv_i64 th = tcg_temp_new_i64();
+ TCGv_i64 tl = tcg_temp_new_i64();
+ TCGv_i64 zero = tcg_const_i64(0);
+
+ tcg_gen_andi_i64(tl, cl, 1);
+ tcg_gen_sub2_i64(tl, th, al, zero, tl, zero);
+ tcg_gen_sub2_i64(tl, th, tl, th, bl, zero);
+ tcg_gen_andi_i64(th, th, 1);
+ tcg_gen_sub2_i64(tl, th, ah, zero, th, zero);
+ tcg_gen_sub2_i64(tl, th, tl, th, bh, zero);
+ tcg_gen_andi_i64(dl, th, 1);
+ tcg_gen_mov_i64(dh, zero);
+
+ tcg_temp_free_i64(tl);
+ tcg_temp_free_i64(th);
+ tcg_temp_free_i64(zero);
+}
+
+static DisasJumpType op_vsbcbi(DisasContext *s, DisasOps *o)
+{
+ if (get_field(s->fields, m5) != ES_128) {
+ gen_program_exception(s, PGM_SPECIFICATION);
+ return DISAS_NORETURN;
+ }
+
+ gen_gvec128_4_i64(gen_sbcbi2_i64, get_field(s->fields, v1),
+ get_field(s->fields, v2), get_field(s->fields, v3),
+ get_field(s->fields, v4));
+ return DISAS_NEXT;
+}
--
2.20.1
- [qemu-s390x] [PATCH v3 28/40] s390x/tcg: Implement VECTOR ELEMENT SHIFT, (continued)
- [qemu-s390x] [PATCH v3 28/40] s390x/tcg: Implement VECTOR ELEMENT SHIFT, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 29/40] s390x/tcg: Implement VECTOR SHIFT LEFT (BY BYTE), David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 31/40] s390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 30/40] s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 32/40] s390x/tcg: Implement VECTOR SHIFT RIGHT LOGICAL *, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 33/40] s390x/tcg: Implement VECTOR SUBTRACT, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 34/40] s390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW INDICATION, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 35/40] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDICATION, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 36/40] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION,
David Hildenbrand <=
- [qemu-s390x] [PATCH v3 37/40] s390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 38/40] s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 39/40] s390x/tcg: Implement VECTOR SUM ACROSS WORD, David Hildenbrand, 2019/05/02
- [qemu-s390x] [PATCH v3 40/40] s390x/tcg: Implement VECTOR TEST UNDER MASK, David Hildenbrand, 2019/05/02