From nobody Sun Nov 9 11:37:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550816658741338.912745527409; Thu, 21 Feb 2019 22:24:18 -0800 (PST) Received: from localhost ([127.0.0.1]:44971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx4Fr-0006Jl-NM for importer@patchew.org; Fri, 22 Feb 2019 01:24:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx4Aq-0002zB-RD for qemu-devel@nongnu.org; Fri, 22 Feb 2019 01:19:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gx3xs-0003H2-7m for qemu-devel@nongnu.org; Fri, 22 Feb 2019 01:05:40 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:46009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gx3xr-00030H-St for qemu-devel@nongnu.org; Fri, 22 Feb 2019 01:05:40 -0500 Received: by mail-pl1-x641.google.com with SMTP id r14so580125pls.12 for ; Thu, 21 Feb 2019 22:05:09 -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 f67sm1452522pfc.141.2019.02.21.22.05.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Feb 2019 22:05:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=1flVDEQCS0M6/uS6G96UIV9P7m5civ+pa52oxRwu3L0=; b=JVmcuZmW4H8YZO42q6SHDUquYl3VMB3zvjlBomUqDHUV7c+pxVpaWeXMoVyZD3Fl/c 1HQGhWYopMLNFhuBpWC5G0AD98pP/9REql+Nv2tA584mKTt4ZhhoMVm2fnUfTFo4Z70E u0EEipKExex8pkQaxtK2WtxQx8dyv1R69voY+JgT5KAMv+K+/xQ7AGjMA3F0q42JI0gQ 4O/vmW8hVY/HthrX8Q63L3KXBM1Fi0Ct1LGHPb4zbJE5GmGkJU7HXzfocgrk9LISEiVf kG+xKW0Tv9XaWYlR3HL9gpAq/dlNXyRBjzXtZtT3ysdYePknYC0uScY6WJOZpsW74cHT HLTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=1flVDEQCS0M6/uS6G96UIV9P7m5civ+pa52oxRwu3L0=; b=lSBBkMMrDMheXBJ/CvvxGfK00gdQB0B8C37FyvPk3yzQlpp515cZ8o3WK2W5rvujql cKI1M5sAk6UX/aeEdweKZyraMcF5+18vBta0ZSbnMZFuoVMA3Vke/obqe38bQzuHlJyx YHYkIWKCc9UdG2qH9V8HuiflyiMUuh0815hYpD0nTsmtG12EGS8G+TOWk5B5j7pEHLzb i0hwRYojEvmCJmRuJqwjMsv7ScDJlSpcTobtzCOEgfF5hOZ84BAh809gXd5VvGg0EHIm dEF/lsKyBUtRziNw1Y+af/yvASYNwFMtQb1S3j1i6gY855HKCWoJPITSculPfVGGFqsO RsRg== X-Gm-Message-State: AHQUAuZKod9/zc1ggbkTR7wzO4xk8UnyO/0/36xHr9dcPIMrDffx9m+y tYfMHE6VSwsHQR+1HpLd8MgDrnmng2Q= X-Google-Smtp-Source: AHgI3IbKH+jI+nguKBn2GeiuTm/Cf1OZ/IwHXq2sfkvEag/AUnZV5xwxrjvv/vul3i0WKUGJoHtdOQ== X-Received: by 2002:a17:902:2aaa:: with SMTP id j39mr2546073plb.335.1550815507888; Thu, 21 Feb 2019 22:05:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 21 Feb 2019 22:05:03 -0800 Message-Id: <20190222060504.17715-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190222060504.17715-1-richard.henderson@linaro.org> References: <20190222060504.17715-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::641 Subject: [Qemu-devel] [PATCH 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For priv levels 1 & 2, we were doing so from do_ibranch_priv. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/hppa/translate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 =3D get_temp(ctx); tcg_gen_ori_reg(dest, offset, 3); break; default: - dest =3D tcg_temp_new(); + dest =3D 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; --=20 2.17.2 From nobody Sun Nov 9 11:37:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550816441603916.8474160074741; Thu, 21 Feb 2019 22:20:41 -0800 (PST) Received: from localhost ([127.0.0.1]:44927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx4CG-0003eD-A5 for importer@patchew.org; Fri, 22 Feb 2019 01:20:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx4Ap-0002zB-T0 for qemu-devel@nongnu.org; Fri, 22 Feb 2019 01:19:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gx3xt-0003Ie-Ab for qemu-devel@nongnu.org; Fri, 22 Feb 2019 01:05:42 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:32983) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gx3xt-00031b-1Q for qemu-devel@nongnu.org; Fri, 22 Feb 2019 01:05:41 -0500 Received: by mail-pg1-x536.google.com with SMTP id h11so634340pgl.0 for ; Thu, 21 Feb 2019 22:05:10 -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 f67sm1452522pfc.141.2019.02.21.22.05.07 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Feb 2019 22:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=bcf2IQqo75AMjcdI4rvvJF4BoU4PKjmYFCofFsd1Jww=; b=GGHEg5e+fgpMcgNo52Qi1W4ZWdn6oH17+0pxBmE9tkA4ui0sGng6dqseuwlt4fx3mg WqUfkO6ojZfQ0gEJH097ak3T30qiIVIYsEqYFGqD8QFW8h0AoeUxn/yBabz7V3wqEbMp yi5DFBIjcz13QivIi6KZyz9eVriiqMLPFevi0oiHKAXyMm5h6apyWm8aO0GvyIw/PqSv Tt/upNKRTGi7S3DW1zfaI8OlBJ15U5VwHlVxyp3JVnx3krknrxGo/eUEDMuEqtZcQB/o Vgo1KJ7bA1wBjcNOR3MpWS3iSjmCnYmeyUG+0uE7G86nuZp47264fabOPYcFo/P+vLUL dbxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=bcf2IQqo75AMjcdI4rvvJF4BoU4PKjmYFCofFsd1Jww=; b=ZsXgOqgScs89/Qzz5zZEMID+JtuUc8y9iX9IOKhTTDUKPrsNnLN0RLMay7kxkOi8Nq amzRhFNkY4vpe58rUwl2yTBUQiPGJ/WwgayDASum6uZetiiJsoYMQziY7etvTPC4FFQm IPTie/rb8X9Ef1JKhKaSOpBMy9TDGdZU8uiVnVYfrALHiXz8uc2xhALUA0vzzrLAESx6 cKOjp9QOELtPPbTGFkKmMxeiQx/4D0s+ttkg4CpMGkYw8RDde2LTuM8A2Si3n/BnKp4r 9e9mdXhq0JZ4r6Nk0DJkL85DL5Ibq62npjNDJ2lE5r1Jqa1u3sG/Q8kyoc4YSbijTW3u rKsg== X-Gm-Message-State: AHQUAuY90W1O6IubhPuOfsZuvSGWiPwSzIXb6F+QvnTnHF/kncoutMz5 Boxyj/rhl5IkBl823pMEHJDA/qYGtGY= X-Google-Smtp-Source: AHgI3IatFl54gfSAmq7GBLjjNoxUhiK75iwadWbu/1wKDbuWIkvoHOjNrxmX5tQNMNMJt1AjZD4ZKw== X-Received: by 2002:a63:6a47:: with SMTP id f68mr2398141pgc.82.1550815508977; Thu, 21 Feb 2019 22:05:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 21 Feb 2019 22:05:04 -0800 Message-Id: <20190222060504.17715-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190222060504.17715-1-richard.henderson@linaro.org> References: <20190222060504.17715-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::536 Subject: [Qemu-devel] [PATCH 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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_g= ate *a) =20 static bool trans_blr(DisasContext *ctx, arg_blr *a) { - TCGv_reg tmp =3D 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 =3D 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); + } } =20 static bool trans_bv(DisasContext *ctx, arg_bv *a) --=20 2.17.2