Received: from eggs.gnu.org ([209.51.188.92]:54481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGTD4-0004hx-9h for qemu-devel@nongnu.org; Tue, 16 Apr 2019 14:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGTD3-0004hY-2c for qemu-devel@nongnu.org; Tue, 16 Apr 2019 14:53:34 -0400 From: David Hildenbrand Date: Tue, 16 Apr 2019 20:52:30 +0200 Message-Id: <20190416185301.25344-11-david@redhat.com> In-Reply-To: <20190416185301.25344-1-david@redhat.com> References: <20190416185301.25344-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 10/41] s390x/tcg: Implement VECTOR ELEMENT COMPARE * List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Cornelia Huck , Richard Henderson , David Hildenbrand , Richard Henderson 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 Signed-off-by: David Hildenbrand --- 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) =20 #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, Dis= asOps *o) tcg_temp_free_i32(sum); return DISAS_NEXT; } + +static DisasJumpType op_vec(DisasContext *s, DisasOps *o) +{ + uint8_t es =3D get_field(s->fields, m3); + const uint8_t enr =3D NUM_VEC_ELEMENTS(es) / 2 - 1; + + if (es > ES_64) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + if (s->fields->op2 =3D=3D 0xdb) { + es |=3D MO_SIGN; + } + + o->in1 =3D tcg_temp_new_i64(); + o->in2 =3D 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; +} --=20 2.20.1