From patchwork Mon Feb 20 18:40:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655114 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1552021wrc; Mon, 20 Feb 2023 10:44:22 -0800 (PST) X-Google-Smtp-Source: AK7set+6ykfQ4PhuhZdrJVceBbbCYftbAhZ83IsZOXCz/wCB3pv4ATHobgpY4TbxpfPewzW8sawi X-Received: by 2002:ac8:7d89:0:b0:3b2:365c:9a9e with SMTP id c9-20020ac87d89000000b003b2365c9a9emr2831875qtd.61.1676918661916; Mon, 20 Feb 2023 10:44:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676918661; cv=none; d=google.com; s=arc-20160816; b=f2O9tuTaJpN8OKuxWs7P8qBBYNu7GavOFtRY4tAHJl+Vnhjov1wXpaaCBOrotxhPlO jyTVJAenCXcv7jpXfAsQG42Ub24ZGpyT5Z7zEVW4DBh66v2NdiGIcbRE9DdGR/CVy6EI 1aTJwONR/EZMw/6mLZzKEUyg71Mr6dop3qSYCqV/GWXLEqBwXWXqrymC4cy+miYjuT34 0vvQmNbbYaRQlJIJAaIq4rXG75kSQ83KV5uECSYYru4i8fvPtV0CN1fxPK9A5re3I6wf nCknWbIzxpiYmCtqh2/gPcP/yHEI6IE0Ztj7IndqWGJNTLgK19UbxX3ExsEPVDJQZfg3 MFjA== 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:dkim-signature; bh=+Gcs847vjJc3xC2UOWHkazgkIaAtl/2Q94u6UiZ63QI=; b=BwvezOEnnUG618dYTJ+kwJSLrlAI6I/TQLKAtCo1CQyx4tS9iEPpvWabnQcF1wRE6T xZ3/1DgSNyNCC5laxlyR3kqjHSDlU+UMYVc63zfefPpcaWTCj0OT2//VIvFwRVao1/9y 4H90lpTXYqeRQGgbKQwcvLZE+EEAA8085i46Itggf7FzgJmeOyFaCkM1LzrKWo7mJYAU 1vnSVUPVFFA4ALe8UyQWUPY9ngoIC4z9c422EV+mctofFaoex4QPuYp2fWUL9IgTYFSu p+X+V63kvw9CdI2+n4IYrMgraDH8i1XASLsNEL1tg2EbIWFg1q//tbGvpIPMfqkgF3J1 VZBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qXoF6sn6; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h10-20020a05620a400a00b0073baa9c86c7si8843344qko.745.2023.02.20.10.44.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 10:44:21 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=qXoF6sn6; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUB8a-0007nA-HH; Mon, 20 Feb 2023 13:43:44 -0500 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 1pUB6c-0004dJ-3m for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:47 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUB6W-0004CC-10 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:40 -0500 Received: by mail-pl1-x62c.google.com with SMTP id z2so2651815plf.12 for ; Mon, 20 Feb 2023 10:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+Gcs847vjJc3xC2UOWHkazgkIaAtl/2Q94u6UiZ63QI=; b=qXoF6sn60KHuqW07X9lDJSLj+rGUWa94GIASrnNxPi4V4w+DjVVRE6oN71BjEPqsGZ 3qP6Emx7RRwW6Wck7AEfP04ABMb8zywhvTK5IWcX0XGl0bxJSw5IQtZoODo+d455MPxr 8V7eOUXt2pmUfymdouVgQdZaSCZ81w+RC09WHtrFPLhkLR7s0y/mS7VOJL3NW5ub/h4N /grFONatbyO8jIvEO7zZW8tNaBzDHdy5o9w1yUUuAZ0IOuZRxfOh5V9mBQ8tX6uWGDz0 V5ok+r9raB8R2eIqyjvZxRy6O06jmgwDlclyx1EBP5c//V+FpQZGLc2kHzReKjmZPU32 d2uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Gcs847vjJc3xC2UOWHkazgkIaAtl/2Q94u6UiZ63QI=; b=pYSQyxov0hjzPDf/vLO0WjbiL64wf54AifN4Nwbaiy8/F9Lj/5oMmEIxsskjPNckIq EJCbARZUH9/Jx+itRNOLbs5M/fvuJURCHoaQ++fLpCj8wau4NnNIvB2abf/xcE5bY/58 tVKAnegGV1ZWXT4JLS4KQUUGjbF2S9dfZUT0hSxP70138ZdOLUiSYVzTDv6u3BKiy+fD b2GE91tJ4Go3+rI3f8zk1ZCnGfJk3t/b4JyWSsHFcJhFVY7dexp6P9wiqTaz31aI2FC/ RWJq4NAhaLO6PawTLwtL1tAdOOlYOPN3ahHvuQ4q98hiRFpGU8QBLIhF590xdwoCx4un kD4g== X-Gm-Message-State: AO0yUKW8YgkqDU6aGhiRLgMS5qRDiTfNVplwBGzhY5OIjtJc7vaonfoG adqETB4KPJS8mpAdCjgUmu+dd7vv9jBP0UmAEV8= X-Received: by 2002:a17:902:e5cc:b0:19a:b754:4053 with SMTP id u12-20020a170902e5cc00b0019ab7544053mr3552864plf.26.1676918490562; Mon, 20 Feb 2023 10:41:30 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id jk20-20020a170903331400b0019258bcf3ffsm1911676plb.56.2023.02.20.10.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 10:41:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v4 19/27] target/s390x: Introduce help_goto_indirect Date: Mon, 20 Feb 2023 08:40:44 -1000 Message-Id: <20230220184052.163465-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230220184052.163465-1-richard.henderson@linaro.org> References: <20230220184052.163465-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 Add a small helper to handle unconditional indirect jumps. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 6757a0f44f..afa5f56fc4 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1205,6 +1205,13 @@ static DisasJumpType help_goto_direct(DisasContext *s, int64_t disp) } } +static DisasJumpType help_goto_indirect(DisasContext *s, TCGv_i64 dest) +{ + tcg_gen_mov_i64(psw_addr, dest); + per_branch(s, false); + return DISAS_PC_UPDATED; +} + static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, bool is_imm, int imm, TCGv_i64 cdest) { @@ -1235,9 +1242,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, goto egress; } if (c->cond == TCG_COND_ALWAYS) { - tcg_gen_mov_i64(psw_addr, cdest); - per_branch(s, false); - ret = DISAS_PC_UPDATED; + ret = help_goto_indirect(s, cdest); goto egress; } } @@ -1560,9 +1565,7 @@ static DisasJumpType op_bas(DisasContext *s, DisasOps *o) { pc_to_link_info(o->out, s); if (o->in2) { - tcg_gen_mov_i64(psw_addr, o->in2); - per_branch(s, false); - return DISAS_PC_UPDATED; + return help_goto_indirect(s, o->in2); } else { return DISAS_NEXT; } @@ -1595,9 +1598,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps *o) { save_link_info(s, o); if (o->in2) { - tcg_gen_mov_i64(psw_addr, o->in2); - per_branch(s, false); - return DISAS_PC_UPDATED; + return help_goto_indirect(s, o->in2); } else { return DISAS_NEXT; }