From nobody Sun Nov 9 14:51:28 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 15510963477800.403395182868735; Mon, 25 Feb 2019 04:05:47 -0800 (PST) Received: from localhost ([127.0.0.1]:35892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF0v-0002WY-OO for importer@patchew.org; Mon, 25 Feb 2019 07:05:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyEzO-0001oV-Dh for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:04:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyEzI-0003ZG-U0 for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:04:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38212) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyEzE-0003Mf-Qz; Mon, 25 Feb 2019 07:03:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7CCE3308624A; Mon, 25 Feb 2019 11:56:00 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 284085C21E; Mon, 25 Feb 2019 11:55:59 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:46 +0100 Message-Id: <20190225115552.7534-2-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 25 Feb 2019 11:56:00 +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 1/7] s390x/tcg: RXE has an optional M3 field 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" Will be needed, so add it to the format description. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- target/s390x/insn-format.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/insn-format.def b/target/s390x/insn-format.def index a412d90fb7..4297ff4165 100644 --- a/target/s390x/insn-format.def +++ b/target/s390x/insn-format.def @@ -36,7 +36,7 @@ F3(RSY_a, R(1, 8), BDL(2), R(3,12)) F3(RSY_b, R(1, 8), BDL(2), M(3,12)) F2(RX_a, R(1, 8), BXD(2)) F2(RX_b, M(1, 8), BXD(2)) -F2(RXE, R(1, 8), BXD(2)) +F3(RXE, R(1, 8), BXD(2), M(3,32)) F3(RXF, R(1,32), BXD(2), R(3, 8)) F2(RXY_a, R(1, 8), BXDL(2)) F2(RXY_b, M(1, 8), BXDL(2)) --=20 2.17.2 From nobody Sun Nov 9 14:51:28 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 15510965501163.5449821532291708; Mon, 25 Feb 2019 04:09:10 -0800 (PST) Received: from localhost ([127.0.0.1]:35947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF4E-0004yp-SP for importer@patchew.org; Mon, 25 Feb 2019 07:09:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF1F-00036w-Qa for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:06:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyF10-0005Zc-8z for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:05:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58346) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyF0x-0005Oc-P1; Mon, 25 Feb 2019 07:05:43 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2579E30842B1; Mon, 25 Feb 2019 11:56:02 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6A0C5C21E; Mon, 25 Feb 2019 11:56:00 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:47 +0100 Message-Id: <20190225115552.7534-3-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 25 Feb 2019 11:56:02 +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 2/7] s390x/tcg: Simplify disassembler operands initialization 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" Let's simply initialization to 0. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- target/s390x/translate.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 19072efec6..c646e50eb3 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -6091,7 +6091,7 @@ static DisasJumpType translate_one(CPUS390XState *env= , DisasContext *s) const DisasInsn *insn; DisasJumpType ret =3D DISAS_NEXT; DisasFields f; - DisasOps o; + DisasOps o =3D {}; =20 /* Search for the insn in the table. */ insn =3D extract_insn(env, s, &f); @@ -6161,12 +6161,6 @@ static DisasJumpType translate_one(CPUS390XState *en= v, DisasContext *s) /* Set up the strutures we use to communicate with the helpers. */ s->insn =3D insn; s->fields =3D &f; - o.g_out =3D o.g_out2 =3D o.g_in1 =3D o.g_in2 =3D false; - o.out =3D NULL; - o.out2 =3D NULL; - o.in1 =3D NULL; - o.in2 =3D NULL; - o.addr1 =3D NULL; =20 /* Implement the instruction. */ if (insn->help_in1) { --=20 2.17.2 From nobody Sun Nov 9 14:51:28 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 1551096457412319.3576141671074; Mon, 25 Feb 2019 04:07:37 -0800 (PST) Received: from localhost ([127.0.0.1]:35918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF2k-0003vG-EG for importer@patchew.org; Mon, 25 Feb 2019 07:07:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF04-0002Fd-OH for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:04:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyEzv-0004Iu-Cu for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:04:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyEzu-0004Fc-LC for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:04:38 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C507585360; Mon, 25 Feb 2019 11:56:03 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FA105C21E; Mon, 25 Feb 2019 11:56:02 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:48 +0100 Message-Id: <20190225115552.7534-4-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 25 Feb 2019 11:56:03 +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 3/7] s390x/tcg: Clarify terminology in vec_reg_offset() 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" We will use s390x speak "Element Size" (es) for MO_8 =3D=3D 0, MO_16 =3D=3D= 1 ... Simple rename of variables. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- target/s390x/translate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index c646e50eb3..916508b567 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -145,10 +145,10 @@ void s390x_translate_init(void) } } =20 -static inline int vec_reg_offset(uint8_t reg, uint8_t enr, TCGMemOp size) +static inline int vec_reg_offset(uint8_t reg, uint8_t enr, TCGMemOp es) { - const uint8_t es =3D 1 << size; - int offs =3D enr * es; + const uint8_t bytes =3D 1 << es; + int offs =3D enr * bytes; =20 g_assert(reg < 32); /* @@ -173,9 +173,9 @@ static inline int vec_reg_offset(uint8_t reg, uint8_t e= nr, TCGMemOp size) * the two 8 byte elements have to be loaded separately. Let's force a= ll * 16 byte operations to handle it in a special way. */ - g_assert(size <=3D MO_64); + g_assert(es <=3D MO_64); #ifndef HOST_WORDS_BIGENDIAN - offs ^=3D (8 - es); + offs ^=3D (8 - bytes); #endif return offs + offsetof(CPUS390XState, vregs[reg][0].d); } --=20 2.17.2 From nobody Sun Nov 9 14:51:28 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 1551096433045272.1772266593491; Mon, 25 Feb 2019 04:07:13 -0800 (PST) Received: from localhost ([127.0.0.1]:35916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF2K-0003eN-Tz for importer@patchew.org; Mon, 25 Feb 2019 07:07:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyF12-0002y1-9x for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:05:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyF10-0005aH-Ev for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:05:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58354) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyF0x-0005Oi-Rk for qemu-devel@nongnu.org; Mon, 25 Feb 2019 07:05:45 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C9F130058D4; Mon, 25 Feb 2019 11:56:07 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 184F45C221; Mon, 25 Feb 2019 11:56:03 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:49 +0100 Message-Id: <20190225115552.7534-5-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 25 Feb 2019 11:56:07 +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 4/7] s390x/tcg: Factor out vec_full_reg_offset() 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" We'll use that a lot along with gvec helpers, to calculate the start address of a vector. Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth --- target/s390x/translate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 916508b567..f8c285a685 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -145,12 +145,17 @@ void s390x_translate_init(void) } } =20 +static inline int vec_full_reg_offset(uint8_t reg) +{ + g_assert(reg < 32); + return offsetof(CPUS390XState, vregs[reg][0].d); +} + static inline int vec_reg_offset(uint8_t reg, uint8_t enr, TCGMemOp es) { const uint8_t bytes =3D 1 << es; int offs =3D enr * bytes; =20 - g_assert(reg < 32); /* * vregs[n][0] is the lowest 8 byte and vregs[n][1] the highest 8 byte * of the 16 byte vector, on both, little and big endian systems. @@ -177,7 +182,7 @@ static inline int vec_reg_offset(uint8_t reg, uint8_t e= nr, TCGMemOp es) #ifndef HOST_WORDS_BIGENDIAN offs ^=3D (8 - bytes); #endif - return offs + offsetof(CPUS390XState, vregs[reg][0].d); + return offs + vec_full_reg_offset(reg); } =20 static inline int freg64_offset(uint8_t reg) --=20 2.17.2 From nobody Sun Nov 9 14:51:28 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 155109590270077.93610220628432; Mon, 25 Feb 2019 03:58:22 -0800 (PST) Received: from localhost ([127.0.0.1]:35765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyEtm-00079X-KQ for importer@patchew.org; Mon, 25 Feb 2019 06:58:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyErt-0006Bo-Rp for qemu-devel@nongnu.org; Mon, 25 Feb 2019 06:56:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyErs-0005no-VY for qemu-devel@nongnu.org; Mon, 25 Feb 2019 06:56:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34880) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyErm-0005e2-HG; Mon, 25 Feb 2019 06:56:18 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD76C3082E20; Mon, 25 Feb 2019 11:56:08 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66EB75C221; Mon, 25 Feb 2019 11:56:07 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:50 +0100 Message-Id: <20190225115552.7534-6-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 25 Feb 2019 11:56:08 +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 5/7] s390x/tcg: Factor out gen_addi_and_wrap_i64() from get_address() 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" Also properly wrap in 24bit mode. While at it, convert the comment (and drop the comment about fundamental TCG optimizations). Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/translate.c | 41 +++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index f8c285a685..322fbbdf81 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -381,32 +381,43 @@ static inline void gen_trap(DisasContext *s) gen_data_exception(0xff); } =20 +static inline void gen_addi_and_wrap_i64(DisasContext *s, TCGv_i64 dst, + TCGv_i64 src, int64_t imm) +{ + tcg_gen_addi_i64(dst, src, imm); + if (!(s->base.tb->flags & FLAG_MASK_64)) { + if (s->base.tb->flags & FLAG_MASK_32) { + tcg_gen_andi_i64(dst, dst, 0x7fffffff); + } else { + tcg_gen_andi_i64(dst, dst, 0x00ffffff); + } + } +} + static TCGv_i64 get_address(DisasContext *s, int x2, int b2, int d2) { TCGv_i64 tmp =3D tcg_temp_new_i64(); - bool need_31 =3D !(s->base.tb->flags & FLAG_MASK_64); - - /* Note that d2 is limited to 20 bits, signed. If we crop negative - displacements early we create larger immedate addends. */ =20 - /* Note that addi optimizes the imm=3D=3D0 case. */ + /* + * Note that d2 is limited to 20 bits, signed. If we crop negative + * displacements early we create larger immedate addends. + */ if (b2 && x2) { tcg_gen_add_i64(tmp, regs[b2], regs[x2]); - tcg_gen_addi_i64(tmp, tmp, d2); + gen_addi_and_wrap_i64(s, tmp, tmp, d2); } else if (b2) { - tcg_gen_addi_i64(tmp, regs[b2], d2); + gen_addi_and_wrap_i64(s, tmp, regs[b2], d2); } else if (x2) { - tcg_gen_addi_i64(tmp, regs[x2], d2); - } else { - if (need_31) { - d2 &=3D 0x7fffffff; - need_31 =3D false; + gen_addi_and_wrap_i64(s, tmp, regs[x2], d2); + } else if (!(s->base.tb->flags & FLAG_MASK_64)) { + if (s->base.tb->flags & FLAG_MASK_32) { + tcg_gen_movi_i64(tmp, d2 & 0x7fffffff); + } else { + tcg_gen_movi_i64(tmp, d2 & 0x00ffffff); } + } else { tcg_gen_movi_i64(tmp, d2); } - if (need_31) { - tcg_gen_andi_i64(tmp, tmp, 0x7fffffff); - } =20 return tmp; } --=20 2.17.2 From nobody Sun Nov 9 14:51:28 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 1551096017386941.6917428942435; Mon, 25 Feb 2019 04:00:17 -0800 (PST) Received: from localhost ([127.0.0.1]:35787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyEve-0008T8-Cj for importer@patchew.org; Mon, 25 Feb 2019 07:00:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyEsC-0006O0-8J for qemu-devel@nongnu.org; Mon, 25 Feb 2019 06:56:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyEry-0005ro-Vt for qemu-devel@nongnu.org; Mon, 25 Feb 2019 06:56:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48070) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyErt-0005fD-Si; Mon, 25 Feb 2019 06:56:23 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 639153082E58; Mon, 25 Feb 2019 11:56:10 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 113745C21E; Mon, 25 Feb 2019 11:56:08 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:51 +0100 Message-Id: <20190225115552.7534-7-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 25 Feb 2019 11:56:10 +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 6/7] s390x/tcg: Implement LOAD LENGTHENED short HFP to long HFP 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" Nice trick to load a 32 bit value into vector element 0 (32 bit element size) from memory, zeroing out element1. The short HFP to long HFP conversion really only is a shift. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/insn-data.def | 2 ++ target/s390x/translate.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 61582372ab..fb6ee18650 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -598,6 +598,8 @@ F(0xed04, LDEB, RXE, Z, 0, m2_32u, new, f1, ldeb, 0, IF_BFP) F(0xed05, LXDB, RXE, Z, 0, m2_64, new_P, x1, lxdb, 0, IF_BFP) F(0xed06, LXEB, RXE, Z, 0, m2_32u, new_P, x1, lxeb, 0, IF_BFP) + F(0xb324, LDER, RXE, Z, 0, e2, new, f1, lde, 0, IF_AFP1) + F(0xed24, LDE, RXE, Z, 0, m2_32u, new, f1, lde, 0, IF_AFP1) /* LOAD ROUNDED */ F(0xb344, LEDBR, RRE, Z, 0, f2, new, e1, ledb, 0, IF_BFP) F(0xb345, LDXBR, RRE, Z, x2h, x2l, new, f1, ldxb, 0, IF_BFP) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 322fbbdf81..34799a8704 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -2724,6 +2724,12 @@ static DisasJumpType op_lxeb(DisasContext *s, DisasO= ps *o) return DISAS_NEXT; } =20 +static DisasJumpType op_lde(DisasContext *s, DisasOps *o) +{ + tcg_gen_shli_i64(o->out, o->in2, 32); + return DISAS_NEXT; +} + static DisasJumpType op_llgt(DisasContext *s, DisasOps *o) { tcg_gen_andi_i64(o->out, o->in2, 0x7fffffff); --=20 2.17.2 From nobody Sun Nov 9 14:51:28 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 1551095888031353.44808499437056; Mon, 25 Feb 2019 03:58:08 -0800 (PST) Received: from localhost ([127.0.0.1]:35763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyEtS-0006wM-Fq for importer@patchew.org; Mon, 25 Feb 2019 06:57:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyEs4-0006H6-Gj for qemu-devel@nongnu.org; Mon, 25 Feb 2019 06:56:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyErx-0005qz-NC for qemu-devel@nongnu.org; Mon, 25 Feb 2019 06:56:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44414) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyErt-0005kc-QE; Mon, 25 Feb 2019 06:56:22 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E5005944B; Mon, 25 Feb 2019 11:56:14 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD25C5C21E; Mon, 25 Feb 2019 11:56:10 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 12:55:52 +0100 Message-Id: <20190225115552.7534-8-david@redhat.com> In-Reply-To: <20190225115552.7534-1-david@redhat.com> References: <20190225115552.7534-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 25 Feb 2019 11:56:14 +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 7/7] s390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY 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" Use a new CC helper to calculate the CC lazily if needed. While the PoP mentions that "A 32-bit unsigned binary integer" is placed into the first operand, there is no word telling that the other 32 bits (high part) are left untouched. Maybe the other 32-bit are unpredictable. So store 64 bit for now. Signed-off-by: David Hildenbrand --- target/s390x/cc_helper.c | 8 ++++++++ target/s390x/helper.c | 1 + target/s390x/helper.h | 1 + target/s390x/insn-data.def | 2 ++ target/s390x/internal.h | 1 + target/s390x/mem_helper.c | 12 ++++++++++++ target/s390x/translate.c | 18 ++++++++++++++++++ 7 files changed, 43 insertions(+) diff --git a/target/s390x/cc_helper.c b/target/s390x/cc_helper.c index 307ad61aee..0e467bf2b6 100644 --- a/target/s390x/cc_helper.c +++ b/target/s390x/cc_helper.c @@ -397,6 +397,11 @@ static uint32_t cc_calc_flogr(uint64_t dst) return dst ? 2 : 0; } =20 +static uint32_t cc_calc_lcbb(uint64_t dst) +{ + return dst =3D=3D 16 ? 0 : 3; +} + static uint32_t do_calc_cc(CPUS390XState *env, uint32_t cc_op, uint64_t src, uint64_t dst, uint64_t vr) { @@ -506,6 +511,9 @@ static uint32_t do_calc_cc(CPUS390XState *env, uint32_t= cc_op, case CC_OP_FLOGR: r =3D cc_calc_flogr(dst); break; + case CC_OP_LCBB: + r =3D cc_calc_lcbb(dst); + break; =20 case CC_OP_NZ_F32: r =3D set_cc_nz_f32(dst); diff --git a/target/s390x/helper.c b/target/s390x/helper.c index a7edd5df7d..8e9573221c 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -417,6 +417,7 @@ const char *cc_name(enum cc_op cc_op) [CC_OP_SLA_32] =3D "CC_OP_SLA_32", [CC_OP_SLA_64] =3D "CC_OP_SLA_64", [CC_OP_FLOGR] =3D "CC_OP_FLOGR", + [CC_OP_LCBB] =3D "CC_OP_LCBB", }; =20 return cc_names[cc_op]; diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 6260b50496..a2f8f96aae 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -122,6 +122,7 @@ DEF_HELPER_4(cu42, i32, env, i32, i32, i32) DEF_HELPER_5(msa, i32, env, i32, i32, i32, i32) DEF_HELPER_FLAGS_1(stpt, TCG_CALL_NO_RWG, i64, env) DEF_HELPER_FLAGS_1(stck, TCG_CALL_NO_RWG_SE, i64, env) +DEF_HELPER_FLAGS_2(lcbb, TCG_CALL_NO_RWG_SE, i64, i64, i32) =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 fb6ee18650..f4f1d63ab4 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -479,6 +479,8 @@ F(0xb313, LCDBR, RRE, Z, 0, f2, new, f1, negf64, f64, IF_BFP) F(0xb343, LCXBR, RRE, Z, x2h, x2l, new_P, x1, negf128, f128, IF_= BFP) F(0xb373, LCDFR, RRE, FPSSH, 0, f2, new, f1, negf64, 0, IF_AFP1 | = IF_AFP2) +/* LOAD COUNT TO BLOCK BOUNDARY */ + C(0xe727, LCBB, RXE, V, la2, 0, r1, 0, lcbb, 0) /* LOAD HALFWORD */ C(0xb927, LHR, RRE, EI, 0, r2_16s, 0, r1_32, mov2, 0) C(0xb907, LGHR, RRE, EI, 0, r2_16s, 0, r1, mov2, 0) diff --git a/target/s390x/internal.h b/target/s390x/internal.h index b2966a3adc..9d0a45d1fe 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -236,6 +236,7 @@ enum cc_op { CC_OP_SLA_32, /* Calculate shift left signed (32bit) */ CC_OP_SLA_64, /* Calculate shift left signed (64bit) */ CC_OP_FLOGR, /* find leftmost one */ + CC_OP_LCBB, /* load count to block boundary */ CC_OP_MAX }; =20 diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index a506d9ef99..7bca848cda 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -2623,3 +2623,15 @@ uint32_t HELPER(cu42)(CPUS390XState *env, uint32_t r= 1, uint32_t r2, uint32_t m3) return convert_unicode(env, r1, r2, m3, GETPC(), decode_utf32, encode_utf16); } + +uint64_t HELPER(lcbb)(uint64_t addr, uint32_t m3) +{ + const uint32_t block_size =3D 1ul << (m3 + 6); + const uint64_t rounded_addr =3D ROUND_UP(addr, block_size); + uint32_t to_load =3D 16; + + if (rounded_addr !=3D addr) { + to_load =3D MIN(rounded_addr - addr, to_load); + } + return to_load; +} diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 34799a8704..fd08ae6a5d 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -556,6 +556,7 @@ static void gen_op_calc_cc(DisasContext *s) case CC_OP_NZ_F32: case CC_OP_NZ_F64: case CC_OP_FLOGR: + case CC_OP_LCBB: /* 1 argument */ gen_helper_calc_cc(cc_op, cpu_env, local_cc_op, dummy, cc_dst, dum= my); break; @@ -3141,6 +3142,22 @@ static DisasJumpType op_lzrb(DisasContext *s, DisasO= ps *o) return DISAS_NEXT; } =20 +static DisasJumpType op_lcbb(DisasContext *s, DisasOps *o) +{ + TCGv_i32 m3; + + if (get_field(s->fields, m3) > 6) { + gen_program_exception(s, PGM_SPECIFICATION); + return DISAS_NORETURN; + } + + m3 =3D tcg_const_i32(get_field(s->fields, m3)); + gen_helper_lcbb(o->out, o->addr1, m3); + tcg_temp_free_i32(m3); + gen_op_update1_cc_i64(s, CC_OP_LCBB, o->out); + return DISAS_NEXT; +} + static DisasJumpType op_mov2(DisasContext *s, DisasOps *o) { o->out =3D o->in2; @@ -5930,6 +5947,7 @@ enum DisasInsnEnum { #define FAC_ECT S390_FEAT_EXTRACT_CPU_TIME #define FAC_PCI S390_FEAT_ZPCI /* z/PCI facility */ #define FAC_AIS S390_FEAT_ADAPTER_INT_SUPPRESSION +#define FAC_V S390_FEAT_VECTOR /* vector facility */ =20 static const DisasInsn insn_info[] =3D { #include "insn-data.def" --=20 2.17.2