From patchwork Thu Nov 2 01:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740341 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp593514wrv; Wed, 1 Nov 2023 18:32:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSrz6RtErniODXPBerEL4zokB5oR50ccRQQiUpedkyU/OMg1HSrHO55GIpVH7OoahUb/8K X-Received: by 2002:a05:6830:a:b0:6bd:1059:8212 with SMTP id c10-20020a056830000a00b006bd10598212mr17372297otp.26.1698888722104; Wed, 01 Nov 2023 18:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698888722; cv=none; d=google.com; s=arc-20160816; b=luoNEwD0JMjayVfRITzleelyHlWpirUfRGSIZ/DIIItIXaKRKUe7jO1Cwvb9YhoGPm UUc/N4oc1wB+AvqsoHSmcttv0BYRdhDMBpIruJMExA1DZVN6gtyxHN4eQ8aKKQBH+oEI TbcCBqccAeep8TucJw7rdGJnuEXkzYJ5m1BcQAwmQMppkNk/wKXyBX0Ae6rfiWEiDygW UKBBzMry5FBjLGhBW9dRyUfhk/DS/iYg7v0LsJkLyGcGp6ldpW/4bF4bhBYA9/pKO4VU 7NCzDeJbTPJMgTClA+MohGB9uSz4sICbyPAMbnNlKrLdSDHcnHWNLMu5Q37ILWOsvaGo aV/A== 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=AzeAcdP3m8QbCrR9JX5pAsbSbmsQq+UaJF2pdbgiiNs=; b=f/4NKFpeos+rdpvFZfp2D27x8toG2iFrCLjW+Xd+MojrQIynfdVriJ0C+S380Re2CD G/JhHXwxqwLtxvR6lk6DXO8RrbiEAPv06N+VNB5KDpFCwwAO6i/A/GhSY7YNwpgtRjn2 Oh1vF7ojB6vINzCKInL5Xuac0iUcuDdqW76B0/MqGPMzYhre8z9n0vyYEE1RgOXC6WG0 AYszVOroJnetlz8YXQ7Ptd1bAUmmeTdwGbVaX+GWfPD/AVrG2C6axQBjBcjL3gXCyRsZ oC0ut1SGiHfB2jJLcYzi/vCvWneIOUoJJHU97CUum38okCL8aB53OIMtrHSDQau+CpHK X4oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rRMwf5ej; 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 c17-20020ac85a91000000b004197e89b6e1si3544627qtc.474.2023.11.01.18.32.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:32:02 -0700 (PDT) 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=rRMwf5ej; 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 1qyMYJ-0005pH-F0; Wed, 01 Nov 2023 21:31:19 -0400 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 1qyMXe-0005cH-Gr for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:38 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMXa-0001Xh-22 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:30:35 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso493616b3a.0 for ; Wed, 01 Nov 2023 18:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698888632; x=1699493432; 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=rRMwf5eji0NArohWASGJVPPLJVSOj0tGJvxFYPqAg8VA+dDWUOr57+pXbZBRwhRgYk NxX9gu9oCjM+iOKLqiwFng/MlsktA30IaXm+wsbUStQkOtG2Z5biHXfYjMxWVXptQhWB RZsXYbgMUstHdyE9Mz/Yo5gtKDorQzI18rZ1qgG1BjHHvP/drLhEg7cDyy5++IKRpU+M mLYYWJGYCdaa3V0YRsKtcSVN6dnvhAbiU0isFgSa3ZCTQA7v58imEnNVKDoZf3gDuwlR vYrn0r+lv252x51REgOsxq0VgIqXFeg17O+9o5WevGIpdhiOwhOryAikuNcMn2H1sALU 4W6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698888632; x=1699493432; 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=OUpH4eLiYMU7SinHQm6aqy5YDwKTMYbMe0sCBrEYb+wsXmKn7aTgd6s6zVxk/Pr/MC wkeoMI/dfn1qTlbQs52z1n+YdcmFEZ8HFOT7dEEwmEVWPTY4mRJ3EPmw/IxIbO3Tp6LB JzMx9ifs3sF6GIgcrhOA3IOlBZWe/XfOzsfFdXmN41yHA+PrjSRAaPB3a0rFudNymXiB X/8GCu2GTz8MpSR4cqp23JZLpnhn2R7JVjjjjhB0glxE0GzGsk8vgIbppk322qEdohYw lhMQpnZX0pN666hykrUNOK1vc5aQARpDlIHtio/Et0yu3tJxqTCeRIAX7FL8cEJvXrl1 471A== X-Gm-Message-State: AOJu0YyTH59F9wmgDDjP8AXUfwldrOpJarCzpUpMXjLYi0J4DTzeUQKu WYzDs7X8lLZtyzoUhC5psjj/hzJx7c1+41xlCj8= X-Received: by 2002:a05:6a00:2e28:b0:68e:41e9:10be with SMTP id fc40-20020a056a002e2800b0068e41e910bemr17533565pfb.20.1698888627393; Wed, 01 Nov 2023 18:30:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id r23-20020aa78457000000b006979f70fdd5sm1784191pfn.219.2023.11.01.18.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:30:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 11/88] target/hppa: Remove load_const Date: Wed, 1 Nov 2023 18:28:59 -0700 Message-Id: <20231102013016.369010-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 {