From patchwork Fri Mar 8 01:58:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159944 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp8145751jad; Thu, 7 Mar 2019 17:59:08 -0800 (PST) X-Google-Smtp-Source: APXvYqw0l6B3Jq0T+C+TDHZr5YIAvFqMBKOqdLk0wLfQIA9CHPueI+sKfhzFzXD8XZ0h2jl2lEM+ X-Received: by 2002:a25:4e09:: with SMTP id c9mr7656253ybb.167.1552010348824; Thu, 07 Mar 2019 17:59:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552010348; cv=none; d=google.com; s=arc-20160816; b=oHsCbZ1w2bc0KQHz/nL81VxVfp0DkBTcyPcEG6DYygHZtzRBlXGZ6uL50zFT/g4YSg 1fqycIhBbOGfh67LOYrjeJ3bjbmEK08C/WDMYenlc5tKwh+CjWv1ojdeyCAYnAdTggsz Q6hEB1o1DgYxZcP5eJw2oikp7JK+e164srIJ3KN7fVTf6UtgoMoknEA6WzICAy1mjjPv Zhb8HbXV+G3PaocfrrXyUOBnl5eXjE/zZ37IL/PxOQV8ED59bNvUpSGpIME5BdMvye+Z D/z8IqSOgB+sQwdVCongXIDsctRmi2u66/SoGZo/jl6j3H57PwEtBViHiV3e4NgsB+QT ukHw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=QPLXCI+8BY5c2CvH0KId1U45WqAPMrrIg+PmlwbydN4=; b=VM6Aq/TSTGhJdCprYbcBfyrYMBLp4EgWcwj5J12IFq62rbHYk4zGU0+OvjWv0Rsk/L N7HplpyscNdq0OF8zfUdaxOHamkDbtYtm5PLI2oX+v0rcD6CEezw907jaiLCZnVouLaV 7fN8O1K15hXdMLBU9ryRwDdNLOEzyPsXYg/ERpxddJzn/03r4eVVZyMaeW7CZMg9ODtf PPxA2rJOzmlmRsxpBEMR6oJuWlJlkHS2O+JzaY3dtBGJn24IiWNZ1x9EePDqyaA7yOau NHef7LBFtweOzmU0YoZ590brfpf1EJzKQsHa04cnohfXDx4nvROHc4ycxyPDiu5FI7n8 FIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nUKZW3x9; 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 204si3530220ybp.12.2019.03.07.17.59.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 17:59:08 -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=nUKZW3x9; 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]:35458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h24my-0006Zc-CD for patch@linaro.org; Thu, 07 Mar 2019 20:59:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h24mg-0006Wp-3g for qemu-devel@nongnu.org; Thu, 07 Mar 2019 20:58:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h24md-0007gh-4E for qemu-devel@nongnu.org; Thu, 07 Mar 2019 20:58:48 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:37173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h24mZ-0007SG-6U for qemu-devel@nongnu.org; Thu, 07 Mar 2019 20:58:43 -0500 Received: by mail-pg1-x535.google.com with SMTP id q206so12794441pgq.4 for ; Thu, 07 Mar 2019 17:58:35 -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 :mime-version:content-transfer-encoding; bh=QPLXCI+8BY5c2CvH0KId1U45WqAPMrrIg+PmlwbydN4=; b=nUKZW3x9Na6+eAlWJvlUBj0tUuc5WG33miAYJSnyX7GfkYYLlk4Zu6+HlYmBsksPF/ 3YINvUgelNAQ7A3RL5HRR+JClDHzaipwJ1fv0VJJvWppVdTqQ8IKD4lQgwXGXMYbyiQV c/IouztUq4zgXZWR/TQb/rhly7t1Kk0vn2I7Ub5QTRSd4Gf9Sco4FIPZDz58NBynf6qb j9BCIQ49MRsbBFFKlX9+uf9Co/S6kwjwM+GIjAOIVYISmaEgTvCdQXR6HMSqQf1xSdAl uqIzvuFV7yJ8lKRICFYY+fwrRCUWQoHpH1U8Xvjim4stkiSlidKh43X46ONUyuawvSFd Hsmg== 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:mime-version:content-transfer-encoding; bh=QPLXCI+8BY5c2CvH0KId1U45WqAPMrrIg+PmlwbydN4=; b=hG6UyE8IotiZmgGq7uHWjFIkU1f22BK2RSNwwnrVD98XtVnD16uo3MpzrXC2Tq23Qb xt9ObIh4OYQzt4B7rAAI2qjCRsKupUBkvTqd0yf7uWxz51rH2APCLdxAIiiEcuVoWxFF ksDi+0rCCdI3lxlXbWLWWj4ngv0COwmokns/Hwz7S/UcFAKdBsHMQTRfF/Nly8vBjskc t/SmcciboPheKi7e7CeoPuZjea1HAAyLK7rDJtr800d5raRz9HdJOOHjrn+65nhr0+Wv 0kURW0vRQc8bDhZqHoso0L7YRjzPYoBxbgbO6w84ehybi3xK9QNG128p9EM9RlBKpjHW MZcg== X-Gm-Message-State: APjAAAVwl+J6b8hNfeYgVQhV+FEIlQrmj/X4fFoKjXH1TJfiX8ixlR1v H0qEn2HYmYayVhBr+uGtFtnL8x1J5HQ= X-Received: by 2002:a17:902:968b:: with SMTP id n11mr16120058plp.316.1552010314196; Thu, 07 Mar 2019 17:58:34 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 17:58:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 17:58:29 -0800 Message-Id: <20190308015830.10980-2-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> MIME-Version: 1.0 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 1/2] target/hppa: Do not return freed temporary 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" For priv levels 1 & 2, we were doing so from do_ibranch_priv. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.2 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index b4fd307b77..dad8ce563c 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2007,16 +2007,15 @@ static TCGv_reg do_ibranch_priv(DisasContext *ctx, TCGv_reg offset) /* Privilege 0 is maximum and is allowed to decrease. */ return offset; case 3: - /* Privilege 3 is minimum and is never allowed increase. */ + /* Privilege 3 is minimum and is never allowed to increase. */ dest = get_temp(ctx); tcg_gen_ori_reg(dest, offset, 3); break; default: - dest = tcg_temp_new(); + dest = get_temp(ctx); tcg_gen_andi_reg(dest, offset, -4); tcg_gen_ori_reg(dest, dest, ctx->privilege); tcg_gen_movcond_reg(TCG_COND_GTU, dest, dest, offset, dest, offset); - tcg_temp_free(dest); break; } return dest; 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)