From nobody Sun Nov 9 16:20:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551182814819146.74894417157395; Tue, 26 Feb 2019 04:06:54 -0800 (PST) Received: from localhost ([127.0.0.1]:53826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gybVZ-0007z2-M5 for importer@patchew.org; Tue, 26 Feb 2019 07:06:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyb6I-0005UD-W4 for qemu-devel@nongnu.org; Tue, 26 Feb 2019 06:40:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyb6G-0007XZ-HI for qemu-devel@nongnu.org; Tue, 26 Feb 2019 06:40:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42416) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyb6G-0007Uq-5z; Tue, 26 Feb 2019 06:40:40 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3FFF316E91E; Tue, 26 Feb 2019 11:40:36 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-93.ams2.redhat.com [10.36.117.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AB1F600C0; Tue, 26 Feb 2019 11:40:32 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Tue, 26 Feb 2019 12:39:14 +0100 Message-Id: <20190226113915.20150-33-david@redhat.com> In-Reply-To: <20190226113915.20150-1-david@redhat.com> References: <20190226113915.20150-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 26 Feb 2019 11:40:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 32/33] s390x/tcg: Implement VECTOR STORE WITH LENGTH X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, Cornelia Huck , David Hildenbrand , Thomas Huth , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Very similar to VECTOR LOAD WITH LENGTH, just the opposite direction. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 1 + target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 13 +++++++++++++ target/s390x/vec_helper.c | 15 +++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 969b124f6a..df449f4c53 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -133,6 +133,7 @@ DEF_HELPER_5(gvec_vpkls16, void, ptr, cptr, cptr, env, = i32) DEF_HELPER_5(gvec_vpkls32, void, ptr, cptr, cptr, env, i32) DEF_HELPER_5(gvec_vpkls64, void, ptr, cptr, cptr, env, i32) DEF_HELPER_FLAGS_5(gvec_vperm, TCG_CALL_NO_RWG, void, ptr, cptr, cptr, cpt= r, i32) +DEF_HELPER_FLAGS_4(vstl, TCG_CALL_NO_WG, void, env, cptr, i64, i64) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 60e4895f60..5d4d2ecc7e 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1044,6 +1044,8 @@ E(0xe70a, VSTEG, VRX, V, la2, 0, 0, 0, vste, 0, MO_64, IF_VEC) /* VECTOR STORE MULTIPLE */ F(0xe73e, VSTM, VRS_a, V, la2, 0, 0, 0, vstm, 0, IF_VEC) +/* VECTOR STORE WITH LENGTH */ + F(0xe73f, VSTL, VRS_b, V, la2, r3_32u, 0, 0, vstl, 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.in= c.c index 7e7c96c974..d87f5bafcf 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -829,3 +829,16 @@ static DisasJumpType op_vstm(DisasContext *s, DisasOps= *o) } return DISAS_NEXT; } + +static DisasJumpType op_vstl(DisasContext *s, DisasOps *o) +{ + const int v1_offs =3D vec_full_reg_offset(get_field(s->fields, v1)); + TCGv_ptr a0 =3D tcg_temp_new_ptr(); + + /* convert highest index into an actual length */ + tcg_gen_addi_i64(o->in2, o->in2, 1); + tcg_gen_addi_ptr(a0, cpu_env, v1_offs); + gen_helper_vstl(cpu_env, a0, o->addr1, o->in2); + tcg_temp_free_ptr(a0); + return DISAS_NEXT; +} diff --git a/target/s390x/vec_helper.c b/target/s390x/vec_helper.c index bf8a91cdfa..eddc925101 100644 --- a/target/s390x/vec_helper.c +++ b/target/s390x/vec_helper.c @@ -203,3 +203,18 @@ void HELPER(gvec_vperm)(void *v1, const void *v2, cons= t void *v3, } *(S390Vector *)v1 =3D tmp; } + +void HELPER(vstl)(CPUS390XState *env, const void *v1, uint64_t addr, + uint64_t bytes) +{ + int i; + + /* FIXME: On exceptions we must not modify any memory. */ + bytes =3D MIN(bytes, 16); + for (i =3D 0; i < bytes; i++) { + const uint8_t byte =3D s390_vec_read_element8(v1, i); + + cpu_stb_data_ra(env, addr, byte, GETPC()); + addr =3D wrap_address(env, addr + 1); + } +} --=20 2.17.2