From patchwork Mon Jan 9 20:08:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 640692 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2340041pvb; Mon, 9 Jan 2023 12:22:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXue4oymomvd7QJ762g5af77Lp8Kzqbh1LzTG3AbReLcKWDKn9q2r6qCizTr2mg1XRqscPet X-Received: by 2002:ad4:4e09:0:b0:51f:f4f4:e4f8 with SMTP id dl9-20020ad44e09000000b0051ff4f4e4f8mr79903044qvb.25.1673295725253; Mon, 09 Jan 2023 12:22:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673295725; cv=none; d=google.com; s=arc-20160816; b=FTbrSEOt2SG1HnWs//n1G03xsXmzNcdxvrJd6gbatInDr8yUnCrxhg8aO6uB3ekalD n5PNfRgnjkk6BCR9v3lfm1eL3oQ7dWHVq93/dOrk9bvPXGlA+eoxthYB0+yAOLfVvRF0 FjCv9MtLIlFvVITwv8xcJMpQ//CejXcH0cSvRBo1inszKlrCUB+3pJkgs8cCdIxsnJ7K ngRdaf6srX2Sp2PUH/k85u0/0xPOS5+wwh7enX3bE2odpymfiPDvehK4LIkRih3QmrhE W6wBoDZ9RxZFdTIjToQVubmgMa6whazGkUbyNJK2G7Xx/rPiPGXper5KIoZUYLEzBMjK dFdg== 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=rOafY3nfVG5SzehtqB5mgOADFoO+3I8xljC1PBVfEGM=; b=MzXuhy//DDuJiUkSrN8r/8YaDTRyuawlluTVCbLrQe0GlEiuWEzQmfgsT4WRt5Uu5B OAdlKYrev8PUI3eCwQ230+y0MdIVguPVrGAEY654gm2pxUwT1vZOwbqIlmZEXlAglId4 DuGJHyg0WmRjXHz84xRn0BvshpuczxQ+i0fe00TrvE9XDpkppFdItfZxRMFTQE7lsgSk 4NAL4Z2+d2S3e/TZuOs0lV6UfV7yF9rBCeJeu5Ufk8EBBVPVmZvvYd1d8J2DbQKYpQev BQjOcgm5nsiyxnYPpjcTqNXfxW00Xm8kyxdVImMh+iV4urQiKAsQNUffRIJmRwZsihJ9 E2hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="X/WHElWW"; 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 12-20020a0562140dcc00b005214fb62a03si5051078qvt.65.2023.01.09.12.22.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 12:22:05 -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="X/WHElWW"; 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 1pEyRr-0003FE-HN; Mon, 09 Jan 2023 15:08:47 -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 1pEyRp-0003B9-FV for qemu-devel@nongnu.org; Mon, 09 Jan 2023 15:08:45 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEyRn-0007Nu-RI for qemu-devel@nongnu.org; Mon, 09 Jan 2023 15:08:45 -0500 Received: by mail-pj1-x1035.google.com with SMTP id o13so6437785pjg.2 for ; Mon, 09 Jan 2023 12:08:43 -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=rOafY3nfVG5SzehtqB5mgOADFoO+3I8xljC1PBVfEGM=; b=X/WHElWW0z5JUcfQA9eS+iXba3b/lEZyjEvW2KxB5jH5WewlaSR9vQEif3ppXktJSQ YNvcEL+annpH5TqL50XO5zvGekbpljq96T2NKvkWLaMTmOUFWMThVfU/clBEEt2oFc1D LddLAiUWCCuuTPq8lXTpBpXpsNGYcVn0+lV/DUGtmkRl9I6l3UbYAsbKyXK0U8CGFxNh ck5FGpc1MVySH4fNdJTKattMMBPi7m7p6xSVTr7DreE5N/cnReRLp/CNNi9ptywHaNBC gn76+/BwQFq+4rwupCowP49JcYu1Jn1ltwIfPx6XOzv52WkepVwmCmB4JHPvqDgWPI77 /vJA== 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=rOafY3nfVG5SzehtqB5mgOADFoO+3I8xljC1PBVfEGM=; b=sINPn6wrNiA8nSfIaxfIlEAUeNqUH5O7vzLwcgqPRHATOdBw4ojEmsSGkwMl2mAblk HaQG1r+CFt2pUK/jtdWU91E2udvHblEieW7VVDbDldZBOMcqTYmQc3csuzttWiLw48cN JujbWasyjacB7RsXy4cSpu6kH4IDVvFPDjHZG17uUVcs00U+h9nS4oDBv44iFjh3XRSP 3AoWQaXQX0MiGHcZCFApGtvHWY71q0wImLAiP+PLkfM7a2ut7EyDw4g1U8N49Nl8alHy XZWdG04ZfyTJKey0+ho1pe3321oZzxZ0Ayb2wX6EXaRywH5hePs2yDiTp6X8rUJ9yDFN AUbA== X-Gm-Message-State: AFqh2kogwNiZ5g48SCKXr6A1S6NTPGpDQZFAREhPFEgnI3GZUnaIV82R KcwvYKbpz2MSfGjpJJ2FM2UVDrTSl5jGD6x/ X-Received: by 2002:a17:90a:2e17:b0:227:7f5:9fdb with SMTP id q23-20020a17090a2e1700b0022707f59fdbmr5987951pjd.23.1673294922962; Mon, 09 Jan 2023 12:08:42 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:158e:facf:7a46:ba9f]) by smtp.gmail.com with ESMTPSA id l2-20020a17090a384200b0022727d4af8dsm577574pjf.48.2023.01.09.12.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 12:08:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v3 19/27] target/s390x: Introduce help_goto_indirect Date: Mon, 9 Jan 2023 12:08:11 -0800 Message-Id: <20230109200819.3916395-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230109200819.3916395-1-richard.henderson@linaro.org> References: <20230109200819.3916395-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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=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 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 bbe39dd083..dd3bd9531b 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1189,6 +1189,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) { @@ -1219,9 +1226,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; } } @@ -1545,9 +1550,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; } @@ -1580,9 +1583,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; }