From patchwork Thu Apr 13 20:31:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 672842 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp1082600wrx; Thu, 13 Apr 2023 13:38:36 -0700 (PDT) X-Google-Smtp-Source: AKy350ZUtxhc4kXe+k8rGndCfZPtkFm2+rudXBkJuwGFZ+D71KzYiQspo7rGDRrK8oETbQk0t0Z3 X-Received: by 2002:ad4:5749:0:b0:5b1:a698:43c6 with SMTP id q9-20020ad45749000000b005b1a69843c6mr5677842qvx.18.1681418315931; Thu, 13 Apr 2023 13:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681418315; cv=none; d=google.com; s=arc-20160816; b=0k2OSdAQixYzTkPH7RvWI5GSeRljPlQArgjyAix9XaZAZMyNFsxDz8v6+TNYyqxRQP uV7Pk0vzuXPE6Q8ktafxO6rykaWHwy1/IfhW4KRAcmPYWLmGJndBWj4NiucS4MQHwsDO jeHLzzMGjLI3sOuFinz1utHNY4Y6OVH8ZLmkK4powBfcx7j7XVz179hORE16vYm3rFDt t1LbU/Ag5CMA3uvn2boZU8GXHME9UvDjZ++VmfhfFcAhGeWyeWZ9PYBUCCV5moFHDeKg FDhuSZfHbjQki3Mtd1TjVAd8gTtA/AoszmGbAVvuQiNm+rQv0vN0rWROIxzFGwDlbIKu hOBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Kkt6YoU5LK9nyBJn79PnmjsMW4TAK91NH/i08vXuB9c=; b=skcXtcnw2aWiARQxKwEfK5nlSokqZ7H/eT5yNGRGgNHtxKVGRiWR/d3kqsbJnt+Yau FAK1tXr5KqLV0YCprDm3CFrAtn2xF68YnUCrNGL0BiuqkDaglj8RDjjSKvTG2CTmds6/ YX31hZeui8PfSTo7yu/uZCMsYsvYjMyo6Ftz2wrqrw1gMOTgR+IDTDyQ2KwoiGOS6bKF LkRlaed67/dstcAlrNDWNey+wL8WhswQPj++cnxHkM6QKiBU0X7rnBr2P4eVmDe+OuzF +Isu0HvvMnKc6zN3PFAD1QrUwzexCYy1yQKB6pxvAlcXDFXxQA49a8DFA/GNfP6Knwd5 KyEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jz15-20020a0562140e6f00b0056ec0727a45si1458464qvb.285.2023.04.13.13.38.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Apr 2023 13:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pn3c6-0003mu-8m; Thu, 13 Apr 2023 16:32:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pn3bv-0003gc-Ld; Thu, 13 Apr 2023 16:32:05 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pn3bs-0003jh-Ix; Thu, 13 Apr 2023 16:32:03 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B882840132; Thu, 13 Apr 2023 23:31:55 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 5047795; Thu, 13 Apr 2023 23:31:54 +0300 (MSK) Received: (nullmailer pid 2344343 invoked by uid 1000); Thu, 13 Apr 2023 20:31:54 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [PATCH 07/21] target/s390x: Split out gen_ri2 Date: Thu, 13 Apr 2023 23:31:19 +0300 Message-Id: <20230413203143.2344250-7-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230413203051.2344192-1-mjt@tls.msk.ru> References: <20230413203051.2344192-1-mjt@tls.msk.ru> MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Use tcg_constant_i64. Adjust in2_mri2_* to allocate a new temporary for the output, using gen_ri2 for the address. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit bdbc87e323ee417735141ed2b11dab0091b57593) Signed-off-by: Michael Tokarev --- target/s390x/tcg/translate.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 9c3ee5ed72..ab60b51e31 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -5962,9 +5962,14 @@ static void in2_a2(DisasContext *s, DisasOps *o) } #define SPEC_in2_a2 0 +static TCGv gen_ri2(DisasContext *s) +{ + return tcg_constant_i64(s->base.pc_next + (int64_t)get_field(s, i2) * 2); +} + static void in2_ri2(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64(s->base.pc_next + (int64_t)get_field(s, i2) * 2); + o->in2 = gen_ri2(s); } #define SPEC_in2_ri2 0 @@ -6059,29 +6064,29 @@ static void in2_mri2_16s(DisasContext *s, DisasOps *o) static void in2_mri2_16u(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld16u(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld16u(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_16u 0 static void in2_mri2_32s(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld32s(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld32s(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_32s 0 static void in2_mri2_32u(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld32u(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld32u(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_32u 0 static void in2_mri2_64(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld64(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld64(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_64 0