From patchwork Mon Feb 20 18:40:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655128 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1553784wrc; Mon, 20 Feb 2023 10:49:23 -0800 (PST) X-Google-Smtp-Source: AK7set/2/36ldoR6JoZyhoVazNA48i9azAhs02lIZXUzRkmUltNpYlDaXl8QeJtpx2/J/t5vqJhI X-Received: by 2002:ad4:5942:0:b0:56e:aeb3:52be with SMTP id eo2-20020ad45942000000b0056eaeb352bemr4485164qvb.8.1676918963394; Mon, 20 Feb 2023 10:49:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676918963; cv=none; d=google.com; s=arc-20160816; b=DACkidJ0NmI8m51dmsSHyTOH6uAiJXcMWXvb7i5iyg7viQM8XjVhy+8FW3uTQr1Grv uc+KZPT2TAH5/2qXbAL4d9QuuwKHJ+3LNaStLvFBEkzJvnaJxV/eUpcWZg9J1yaCz1bk EvUS2Gtz0aBChj1rm7iTC+9deABJHyHbsgMvwad6FDctvWtRBVL0gyi4u6dHQpec12Yv 45J9zQ7mMYvnpXryagnFX+cDZcK8UNSyfoAX/ltjO8ED41gbNPwWOFsITk8xo7JSEZxn r7SFRPCBJtls+JFjmAzwGdoKXs/khW1Ryfz1cSvgmu1toHkXFf6oFBzRH5GRwdFV+aEW 36MA== 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=WCjjPlh2Wg57tPbIo2qksXSfr4SotDLh83V8udd4S54=; b=sSyzm36Sn2d0alw4z6uuREYL5O7iPPDuDxCCsjzvBPQU/YHjLjAEEstLhWlM9QLc27 rgXJ/5HWc8qV3UjPICvOCDH6xtqwlYmkcJvTHVitDfgGdmy+b89jCEYB55MOENWQ1JR6 qO17YY5i/NUB8dxH/plgOegifC8hNL/PA1KCu/dd7v5wR+J8lzfqCh4aFBliKN59o9nY 0XsZ0AVlswnfpOBEAX2LTsiL1j7cOMoacReRDdc/AM7Dgu165T8LF39hDieynBREYnyy K46BjiE3y8+CBYNzsoDzyB8yaXKtZH/v0OCKHlM4ogfyFnBO8prbx1EtFk55CXubq8bu OGlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jI7oWeaJ; 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 z18-20020a0c8f12000000b0057109661a1csi3369311qvd.378.2023.02.20.10.49.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 10:49:23 -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=jI7oWeaJ; 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 1pUB8e-0008HS-Ab; Mon, 20 Feb 2023 13:43:48 -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 1pUB6b-0004d0-K9 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:47 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUB6R-0004BE-Rs for qemu-devel@nongnu.org; Mon, 20 Feb 2023 13:41:38 -0500 Received: by mail-pj1-x1036.google.com with SMTP id i1-20020a17090ad34100b00234463de251so2214007pjx.3 for ; Mon, 20 Feb 2023 10:41:29 -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=WCjjPlh2Wg57tPbIo2qksXSfr4SotDLh83V8udd4S54=; b=jI7oWeaJbeSTa9/qxMhgY52PL15v4f2JA58VUNez8w3p0TumAfvpqK8oX2UiwUEl0b Yi691zWRjvSri9ITEkwgIzqDNo9OyN0aXMbrtV8KPEje3aS84gZGKZjRr0uujms2Wf+i NvW46xXBqusPluBLf+RX43ZlfyihQN0IYyKQcH4wQmX3BzKPrFNX7CLktwGMRl8pYaze 0/CjGJFJpcLN9aqtwpISJ207BeyYrpgDWOWBLIuroy3+qJKgzN5reXI112eFmA5hgtjA MeO5j4NxdhrqXox0PaF/0/qbEx9tnvzmJTk9ob/IMtCvlax14DM5fyo8Q79aqFcIeBie mPfg== 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=WCjjPlh2Wg57tPbIo2qksXSfr4SotDLh83V8udd4S54=; b=d4SImgjiFNLC7FQpwFMcew326MUNd80SisuVSpwlssCruK450Ms/R25y2yEU1Vc0e6 5K0OjjwJFgXc+W3mit2ZCCbvF5zdI6tYDxF/Wvjw+lwzXZ4gZnEhxTskDJtQyQgTfoYS 2YsjXEiefTHNfkCUx6rrJIcY8T7fS9p1i7RMIxidU2T78Q1Mh8HQsVfL8GIn2daD5CWX SHPZOXiHxxbdGFt5yCSgHsc804so1rM6FyTsAc1zSLmeUzkbhdaiZpM1/CKzLzQ7hck0 5GCfdCacOJzeQTquA3/VGdm8BmRezIVsCfg5SP0o2tlYoXzWxEsQos5l5WSTmCdtl8PI vl7g== X-Gm-Message-State: AO0yUKUyXEHGKHpwWSxKI4eLSki2mQXoHM4HdKYE6cySorBS6HrAwZTj 35Y2tH7KcIl8s7Lx1n3HGr28yduKbfvifc4LHlQ= X-Received: by 2002:a17:903:283:b0:19a:a2e7:64c3 with SMTP id j3-20020a170903028300b0019aa2e764c3mr3816882plr.68.1676918488720; Mon, 20 Feb 2023 10:41:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 10:41:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PATCH v4 18/27] target/s390x: Disable conditional branch-to-next for PER Date: Mon, 20 Feb 2023 08:40:43 -1000 Message-Id: <20230220184052.163465-19-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::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 For PER, we require a conditional call to helper_per_branch for the conditional branch. Fold the remaining optimization into a call to helper_goto_direct, which will take care of the remaining gbea adjustment. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 433703b4c9..6757a0f44f 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1219,13 +1219,12 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, goto egress; } if (is_imm) { - if (disp == s->ilen) { - /* Branch to next. */ - per_branch(s, true); - ret = DISAS_NEXT; - goto egress; - } - if (c->cond == TCG_COND_ALWAYS) { + /* + * Do not optimize a conditional branch if PER enabled, because we + * still need a conditional call to helper_per_branch. + */ + if (c->cond == TCG_COND_ALWAYS + || (disp == s->ilen && !per_enabled(s))) { ret = help_goto_direct(s, disp); goto egress; }