[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 09/40] s390x/tcg: Implement VECTOR ELEMENT COMPAR
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v3 09/40] s390x/tcg: Implement VECTOR ELEMENT COMPARE * |
Date: |
Thu, 2 May 2019 16:09:48 +0200 |
Fairly easy to implement, we can make use of the existing CC helpers
cmps64 and cmpu64 - we siply have to sign extend the elements.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/insn-data.def | 4 ++++
target/s390x/translate_vx.inc.c | 20 ++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index 64459465c5..52e398f515 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -1074,6 +1074,10 @@
F(0xe7f0, VAVGL, VRR_c, V, 0, 0, 0, 0, vavgl, 0, IF_VEC)
/* VECTOR CHECKSUM */
F(0xe766, VCKSM, VRR_c, V, 0, 0, 0, 0, vcksm, 0, IF_VEC)
+/* VECTOR ELEMENT COMPARE */
+ F(0xe7db, VEC, VRR_a, V, 0, 0, 0, 0, vec, cmps64, IF_VEC)
+/* VECTOR ELEMENT COMPARE LOGICAL */
+ F(0xe7d9, VECL, VRR_a, V, 0, 0, 0, 0, vec, cmpu64, 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 0f90f981b6..3f29d3b67a 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -1365,3 +1365,23 @@ static DisasJumpType op_vcksm(DisasContext *s, DisasOps
*o)
tcg_temp_free_i32(sum);
return DISAS_NEXT;
}
+
+static DisasJumpType op_vec(DisasContext *s, DisasOps *o)
+{
+ uint8_t es = get_field(s->fields, m3);
+ const uint8_t enr = NUM_VEC_ELEMENTS(es) / 2 - 1;
+
+ if (es > ES_64) {
+ gen_program_exception(s, PGM_SPECIFICATION);
+ return DISAS_NORETURN;
+ }
+ if (s->fields->op2 == 0xdb) {
+ es |= MO_SIGN;
+ }
+
+ o->in1 = tcg_temp_new_i64();
+ o->in2 = tcg_temp_new_i64();
+ read_vec_element_i64(o->in1, get_field(s->fields, v1), enr, es);
+ read_vec_element_i64(o->in2, get_field(s->fields, v2), enr, es);
+ return DISAS_NEXT;
+}
--
2.20.1
- [Qemu-devel] [PATCH v3 02/40] s390x/tcg: Implement VECTOR ADD COMPUTE CARRY, (continued)
- [Qemu-devel] [PATCH v3 02/40] s390x/tcg: Implement VECTOR ADD COMPUTE CARRY, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 03/40] s390x/tcg: Implement VECTOR ADD WITH CARRY, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 04/40] s390x/tcg: Implement VECTOR ADD WITH CARRY COMPUTE CARRY, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 05/40] s390x/tcg: Implement VECTOR AND (WITH COMPLEMENT), David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 06/40] s390x/tcg: Implement VECTOR AVERAGE, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 07/40] s390x/tcg: Implement VECTOR AVERAGE LOGICAL, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 08/40] s390x/tcg: Implement VECTOR CHECKSUM, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 09/40] s390x/tcg: Implement VECTOR ELEMENT COMPARE *,
David Hildenbrand <=
- [Qemu-devel] [PATCH v3 10/40] s390x/tcg: Implement VECTOR COMPARE *, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 11/40] s390x/tcg: Implement VECTOR COUNT LEADING ZEROS, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 12/40] s390x/tcg: Implement VECTOR COUNT TRAILING ZEROS, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 14/40] s390x/tcg: Implement VECTOR GALOIS FIELD MULTIPLY SUM (AND ACCUMULATE), David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 13/40] s390x/tcg: Implement VECTOR EXCLUSIVE OR, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 15/40] s390x/tcg: Implement VECTOR LOAD COMPLEMENT, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 16/40] s390x/tcg: Implement VECTOR LOAD POSITIVE, David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 17/40] s390x/tcg: Implement VECTOR (MAXIMUM|MINIMUM) (LOGICAL), David Hildenbrand, 2019/05/02
- [Qemu-devel] [PATCH v3 18/40] s390x/tcg: Implement VECTOR MULTIPLY AND ADD *, David Hildenbrand, 2019/05/02