Received: from eggs.gnu.org ([209.51.188.92]:39091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMCR3-0000n0-2O for qemu-devel@nongnu.org; Thu, 02 May 2019 10:11:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMCR2-0007Un-2y for qemu-devel@nongnu.org; Thu, 02 May 2019 10:11:41 -0400 From: David Hildenbrand Date: Thu, 2 May 2019 16:10:12 +0200 Message-Id: <20190502141019.6385-34-david@redhat.com> In-Reply-To: <20190502141019.6385-1-david@redhat.com> References: <20190502141019.6385-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 33/40] s390x/tcg: Implement VECTOR SUBTRACT 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 We can use tcg_gen_sub2_i64() to do 128-bit subtraction and otherwise existing gvec helpers. Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand --- 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 f3bf9edfca..58a61f41ef 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) =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 2359ba2f7f..88ddc6ae97 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2119,3 +2119,20 @@ static DisasJumpType op_vsrl(DisasContext *s, Disa= sOps *o) tcg_temp_free_i64(shift); return DISAS_NEXT; } + +static DisasJumpType op_vs(DisasContext *s, DisasOps *o) +{ + const uint8_t es =3D get_field(s->fields, m4); + + if (es > ES_128) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } else if (es =3D=3D 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; +} --=20 2.20.1