From patchwork Fri Mar 8 01:58:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159943 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp8145668jad; Thu, 7 Mar 2019 17:59:02 -0800 (PST) X-Google-Smtp-Source: APXvYqyeAXAMroXiofUD1K1SYsywZQiASBkhFkr6PiqGZDHX2ggZ+iLjCdheo47X3bVeqajtwnYT X-Received: by 2002:a81:538a:: with SMTP id h132mr12653622ywb.383.1552010342243; Thu, 07 Mar 2019 17:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552010342; cv=none; d=google.com; s=arc-20160816; b=AYFOWLm9fuhyotYMDmDfbzJU+uCZ22+yMponU9CCvXcfxM/olZ8/6BXbpp5gfS6vnh cd7C8NjY5tjLJ9TIbSmx9m5Lk0G5gul0kI8jfxDM1p2jKZOKD86ZfTgNFH1KFBmwG91w 8yjsu2D2s7xW/GTj36TXEN4j/z1YJMITggJjy3NjhoAdUY/nq1PeuCnLcWD8M4rFd/V6 ySto4CjhlzUv/9FSl2JP5oBfXA3V0cYzJJhsV3EbJXb5NOXDU0TtLUgIqsgHYNJoDK0Y r7iHILXsgBcDk/aPWHbgaPciaBjy8CsY/FNkwVLDzzTZI7GwmrNm4rTERbp09Gjsu04I ABcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=bcf2IQqo75AMjcdI4rvvJF4BoU4PKjmYFCofFsd1Jww=; b=q1HrO2QJSf9GuMgkcJLh35XsYpnh1L27+X+59AdlHkUwQLSMIA1zvyHjoqVrnzRAtZ 6pjYVz64VWe0kpW+M+XZnVsLywb3drwFDW/Km0bbd6RQF1+M1NOtwy6bE31xMZLEGhs3 3pROiAMReMIVU3JCzJ21kz0fjzmIfxtUpQbwRxSY4hzZzKU/56LNclx5pnZBbZNFOdxS GmPri7Ghx0+oukwkbW6mV4duYkp0TgIRkrH1AYlFv4rB62M8JAiqIgBpdpO8iaY6RyJ1 UlE4HbQ/sPZyOWSNRodTMxWT5pAy5HwD+RgUZ3oB4FxOuzcn04PyNu4WxyckFIKAJ+DX 44Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z4IVclac; 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=fail (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 f89si4263189ybi.198.2019.03.07.17.59.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 17:59:02 -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=fail header.i=@linaro.org header.s=google header.b=Z4IVclac; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:35448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h24mr-0006WX-Q0 for patch@linaro.org; Thu, 07 Mar 2019 20:59:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h24md-0006WB-Eg for qemu-devel@nongnu.org; Thu, 07 Mar 2019 20:58:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h24mZ-0007du-5P for qemu-devel@nongnu.org; Thu, 07 Mar 2019 20:58:45 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:36856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h24mU-0007Vw-N2 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 20:58:39 -0500 Received: by mail-pg1-x535.google.com with SMTP id r124so12795041pgr.3 for ; Thu, 07 Mar 2019 17:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bcf2IQqo75AMjcdI4rvvJF4BoU4PKjmYFCofFsd1Jww=; b=Z4IVclacA9jWScjsGXCaWZzOdIHvpzCiFetM0UZRKXk/FvSvKubEcQcgLodO1Rj7QS 3Ifj2AihkeiwQ14QUdbWLAygd0Kry1BUkRQvs7kzEN++oljVlUymC9OXiNZdf1yjPcQ0 R/UAAiIRy/VmibQSxW4k1gYAYztTQthW4ipwn6eOUhBtocp2pbCulCdiriLVviL0SMIq e1tntskOiLxqmOf/QD9InvKrbHfSKEnhQyZK9CE5pQbtTvmBvf5a3pn5DJlQ0uixz5Bw f6Sry/TnOlaokyqsIBi/xdLARP4IrEdRVRbWDYi9KWu80hQFgMoM2d7uI9AKs9NsaEGW 5XsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bcf2IQqo75AMjcdI4rvvJF4BoU4PKjmYFCofFsd1Jww=; b=uQCV1Wdk1AT6Ht9ykQBeBJLYyi+4TNis+bNtvixudVNkYz9CzglWhjB5/rhTzJqt0h 8mzX2npELYUpmhy4uFXgmnFsxWdguVvtBfa6vAfiNu49++LUPg1l2EJOdPAsIV87ef6V GpTQQhAJlQWmheSvSLsG3KwDIjBcLEdKazok5PT6/Mv2KeEdhypDrQaHKjKm3ELV9BTo SPKiSFDR5Gq/6KjeYVTNFpleZW1slbGbqmMcHjeh4/4O3ob9RlXq7KNt8mwNrLiGY4i8 QFFneNeAVOuncvJkrEGzC/wKnNwK6eXFdCxapmAceZyA5Qijb/ixf5l9f7XsMisXBriZ L4FA== X-Gm-Message-State: APjAAAWQjVohoBTZizYo93Tq4SIFsX2CCJJEJSUBFSZE1szEZXBeL8r/ cdH3GIIE7JjoYyxDraS3ShP0jX5C5gg= X-Received: by 2002:a17:902:a702:: with SMTP id w2mr16285343plq.341.1552010315770; Thu, 07 Mar 2019 17:58:35 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id f193sm8863465pgc.3.2019.03.07.17.58.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 17:58:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 17:58:30 -0800 Message-Id: <20190308015830.10980-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190308015830.10980-1-richard.henderson@linaro.org> References: <20190308015830.10980-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::535 Subject: [Qemu-devel] [PULL 2/2] target/hppa: Optimize blr r0,rn 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We can eliminate an extra TB in this case, which merely loads a "return address" into rn. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index dad8ce563c..dc5636fe94 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3488,12 +3488,16 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a) static bool trans_blr(DisasContext *ctx, arg_blr *a) { - TCGv_reg tmp = get_temp(ctx); - - tcg_gen_shli_reg(tmp, load_gpr(ctx, a->x), 3); - tcg_gen_addi_reg(tmp, tmp, ctx->iaoq_f + 8); - /* The computation here never changes privilege level. */ - return do_ibranch(ctx, tmp, a->l, a->n); + if (a->x) { + TCGv_reg tmp = get_temp(ctx); + tcg_gen_shli_reg(tmp, load_gpr(ctx, a->x), 3); + tcg_gen_addi_reg(tmp, tmp, ctx->iaoq_f + 8); + /* The computation here never changes privilege level. */ + return do_ibranch(ctx, tmp, a->l, a->n); + } else { + /* BLR R0,RX is a good way to load PC+8 into RX. */ + return do_dbranch(ctx, ctx->iaoq_f + 8, a->l, a->n); + } } static bool trans_bv(DisasContext *ctx, arg_bv *a)