From patchwork Tue Nov 7 03:02:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741834 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1421776wrr; Mon, 6 Nov 2023 19:14:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcFWqm123c1zY6S2rL5BURzjH9wwf8s4jx/+n5TaGhl1K25GzHhyKxuOThyOe1MB20tHmL X-Received: by 2002:a05:622a:547:b0:41c:dbdb:7ff5 with SMTP id m7-20020a05622a054700b0041cdbdb7ff5mr37662815qtx.33.1699326865877; Mon, 06 Nov 2023 19:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699326865; cv=none; d=google.com; s=arc-20160816; b=uatK3ON/AuB+Ge4XxDvAsDlOCEXEM+l8OTM7FVIxHFai6y4y0gwAr+85PECwT7ERlU uV6g0FsE3g9HIt7m3fJy9i0o/7uTRpK+tvUKLZJ0X82T7AxzNc2jonhtpDK7v/SJTAgw evvEpSD/HEMDtjdoI4UyeNvrPmUF7Km3N35mUOv6oFdrZ3SnKz7i8sjXWDQMavb0zGlr 89RHEsFAwPPoYUDgUqXQRmWuQJ/knEoZL0ZFjE2WrNQVurRAuHaFuT2tMRjjW6ouiG8+ B0YaAW0eIPqiKWyAhPc/gvfDbO7sKTccnhYlWjyD6mt5+IIZExof/2qSDYKcEdZ9bPq4 rtEQ== 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=BJWPaMmS7HS/DrXXKR0DYhMSrnqFI+qqQylX9ZBFipk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=cb6MtQ9cw8rbTf9iTgu71ZjvExDK/4EG7xQTyb6qcHGHIjxiTuHBmsI8wTZxzZMrPF R9lI7HSTZSWpf9/FZzWzH7QmQ3Oupa2BpKTJVucAEiDjmInKDbf+OsE5G15UyFKuHedN ISnsPlyRvvUrMZTb6/zja2CLqCU3+JcBeT2ZGW7lUy978Fce4hfhFPdkMMVRnsTyh4bW kmeGGoSMS+YxacG0FwEY59toIMmgwBoGnVBoxK1gWu2OHp5UWuRl4uJLBtHrDJKyib3K k82HwZ9Ntr/m638/hnhErPLZjSvK6JdUYPTVJwg/2eTeQErH7UlR4k+7kNubMpzBIyzQ M/sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EK1TbhzW; 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 j9-20020ac85c49000000b0041cbafcc5a6si6751938qtj.16.2023.11.06.19.14.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 19:14:25 -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=EK1TbhzW; 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 1r0COb-0007Hn-Fy; Mon, 06 Nov 2023 22:04:53 -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 1r0CO4-0006Lw-Vb for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:04:22 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0CO1-0000du-SI for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:04:20 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1cc3216b2a1so42166095ad.2 for ; Mon, 06 Nov 2023 19:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699326255; x=1699931055; darn=nongnu.org; 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=BJWPaMmS7HS/DrXXKR0DYhMSrnqFI+qqQylX9ZBFipk=; b=EK1TbhzWSE631avqyy5D6jX8aI8kSvp/1VuJPtwXI/ZqiM5ciFC+HjGRkacWXkSxKt cfm/40r/xwMqLBugsjlE3FNVdaK/jqPuCWtVJbzFrjHUmjHzYjlCwvf7l+p0ycbtTY7B 42TgzgFBuOITo6Zc1MLGHPFUZUdzZTAYmViHZMfOvo3bYqfjLVFHHhhfwHz85+omlt6/ rultKC77RywXUJ5akxz6otfVkyWwj7b1PbFEGHHkBMJB40HzRLUtzDmhAPxsxcAGL2y8 vfXpuJQ8cPrTTB127RSVBDoQXIXhE71SFEdjCD7TYaw5GvvsV8yWjX1xOAgCK3bYaeAO ogKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326255; x=1699931055; 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=BJWPaMmS7HS/DrXXKR0DYhMSrnqFI+qqQylX9ZBFipk=; b=hspBEPTQbFt+NxkVtiwo7PguJzZ07265KOicEdFqFQ5agxZUPXrO0qfNKswFr0sZTH LZWIOIqYosakEjVaXPgQ8kXm3bMfhkdpmG2Uz67a9jA2DE90uQhF+hdLnoKbH7sPjnAC +enCrKvr1d8DyA2p5CL0nC22qCrYnmTogonJgO2M5tFjpV1AdLOIg6+IkcwbsjBjRvIf 78yJuMFlZvBd2kxFe+10J/vhZZsy/VojwK/yj7+zt0t6WY1P6sb8JNhi7/atW7Ey9BVx np/ah7Nat/1W8mZZTWynWoX/eibRANWGf7dPLhUTTfjGGVV2GrAV1TpXFU0n5wieQ0Bh 5i2Q== X-Gm-Message-State: AOJu0Ywt0SvM352o+OTHUkr/RCroVCBYRxTXTEznuepUI4sU1JNyaMve ssZSgRjNsWNEpirVFiqUVXDnkmleaNxfjZIHR0Y= X-Received: by 2002:a17:902:f551:b0:1cc:5b2a:2f33 with SMTP id h17-20020a170902f55100b001cc5b2a2f33mr21998388plf.43.1699326255417; Mon, 06 Nov 2023 19:04:15 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u9-20020a17090282c900b001c72d5e16acsm6518012plz.57.2023.11.06.19.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:04:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 09/85] target/hppa: Remove load_const Date: Mon, 6 Nov 2023 19:02:51 -0800 Message-Id: <20231107030407.8979-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231107030407.8979-1-richard.henderson@linaro.org> References: <20231107030407.8979-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Replace with tcg_constant_reg. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3c4a759628..c8384fccd9 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -488,13 +488,6 @@ static void cond_free(DisasCond *cond) } } -static TCGv_reg load_const(DisasContext *ctx, target_sreg v) -{ - TCGv_reg t = tcg_temp_new(); - tcg_gen_movi_reg(t, v); - return t; -} - static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg) { if (reg == 0) { @@ -1164,7 +1157,7 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a, if (a->cf) { nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf); return nullify_end(ctx); @@ -1253,7 +1246,7 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a, bool is_tsv) if (a->cf) { nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf); return nullify_end(ctx); @@ -2808,7 +2801,7 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf *a) nullify_over(ctx); } - tcg_im = load_const(ctx, a->i); + tcg_im = tcg_constant_reg(a->i); tcg_r2 = load_gpr(ctx, a->r); do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf); @@ -2994,7 +2987,7 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a) static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a) { nullify_over(ctx); - return do_cmpb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n, a->disp); + return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); } static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1, @@ -3033,7 +3026,7 @@ static bool trans_addb(DisasContext *ctx, arg_addb *a) static bool trans_addbi(DisasContext *ctx, arg_addbi *a) { nullify_over(ctx); - return do_addb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n, a->disp); + return do_addb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n, a->disp); } static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a) @@ -3345,7 +3338,7 @@ static bool trans_depwi_sar(DisasContext *ctx, arg_depwi_sar *a) if (a->c) { nullify_over(ctx); } - return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, load_const(ctx, a->i)); + return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, tcg_constant_reg(a->i)); } static bool trans_be(DisasContext *ctx, arg_be *a) @@ -3852,7 +3845,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a) return true; } if (inv) { - TCGv_reg c = load_const(ctx, mask); + TCGv_reg c = tcg_constant_reg(mask); tcg_gen_or_reg(t, t, c); ctx->null_cond = cond_make(TCG_COND_EQ, t, c); } else {