From patchwork Fri Oct 20 20:43:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736345 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp503684wrl; Fri, 20 Oct 2023 13:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBwZr/+yBaBaj5X3KGphYZ5zAKHTmxX7xDDus32IxdRM/Vqu6fC9juFmp0ibu5KjAcFy3c X-Received: by 2002:a1f:1dcf:0:b0:49a:7a5b:dab2 with SMTP id d198-20020a1f1dcf000000b0049a7a5bdab2mr2762274vkd.16.1697835268650; Fri, 20 Oct 2023 13:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697835268; cv=none; d=google.com; s=arc-20160816; b=GlkE4X3ae0w+XuN4H0JPdoXQgtMRTtBgvUpZEuayqoVtopENznhw+d8mN1JB0lBl0p 9COu6M4tnru8OgyZbGqLxQ2H9OcGSgqWDxpb8VO4enY+4RMlYLzBt4sgMi10zmza5whw 8aSev/AYw3NPOeUbLWe8NxuLhSfx0Z4G/RQO84CMyQCN2G8R2gTEOoCkWFcX21qf0nYq 2vpRt3apcmpylIs22QfPzYVQxd0HPDYq/+Er3X0SUY/O/xQ4x2tjmkYvr6E+d/rcb9ot 5/aKqQXwsHDMGlehL6lhUlTltT3ephXSPgmXfZrqnYgBEg3MG/k2LCXvwTMn8g7pQVVR MXXw== 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=V27FJvCyTyLJjGiSkXiFejIZCBYVGBoOukmrhWxyTiU=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=bgfTQVus2yL2hUnyBl4qGonyzF+JbDEsKQ4pvBWng6fBXyEhxAjWj0D73c+xU5lOeh P05TgVRdKetVnjhOrXNFtQFto7fyDx8a6nswngkS3sp+hRfA9OU5q3S/8k7h/BbVL33r Y+vxqMBzBkZyBNWNuGRxTRQAw2mRqWSwVVegl1/8mKQR5cSyD5yd2UdVD/sw4CqaL5A2 vpA1pbHWJnWyS730lyYgd5lHv+gSpJak6BDwbph/7HJMIXOb04SLLcLxlNh6yeT9rZ2g CX7kgQiNkit6T7gj6/gIpk5Ni7pHS1pdO0ayDCe1HmtCAIbybHd5sNidVcekMyji7DNp Doew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vrxX/vsx"; 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 m17-20020a05622a055100b004180387dcc0si1938864qtx.605.2023.10.20.13.54.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 13:54:28 -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="vrxX/vsx"; 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 1qtwOx-0001tW-MX; Fri, 20 Oct 2023 16:47:23 -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 1qtwOw-0001pD-5s for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:22 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwOs-0001BM-Bp for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:47:21 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso1114366b3a.2 for ; Fri, 20 Oct 2023 13:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834837; x=1698439637; 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=V27FJvCyTyLJjGiSkXiFejIZCBYVGBoOukmrhWxyTiU=; b=vrxX/vsxWXZe1a3JJfHObxma8tiIJIsdTWBhPPc0sAd7Et0qffMcKxU32cuCZxs7Lr pSkSOPjsr4h+10ymw04HNKBcqlZojFvyQdxnwnKMXA6T9LwE7c7AXymorhct82+8hoSQ HH2kuXUDPD5bR5sbfCmJTv40wDHdZkDyB7jdI3vFFvEgqcskPyirtSxsXP78q7Tx4T+C 5AUm2R8Co1bkhidzsKo6y+uBX/6TNaZkN6UQiZ1hGik+6QLjRWjnDhZ4/GqlOm3MQ/qP XjdtIfuzg86mFYRUMVO32Dtt7xfTIjQBwjSdQObXniioTCp8XTg7vpcUwzsCKtYoQ3Ly KXSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834837; x=1698439637; 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=V27FJvCyTyLJjGiSkXiFejIZCBYVGBoOukmrhWxyTiU=; b=mQuxHE4E3gw0pfLnfkeWpRzBdDOB5aDDNwYoLFv8sSfkNGpglBQyRiLi4BysE64gee c/SFah6DgHnpvHkqvjeyfDYQKRFicBBxFDIvXxG3M0atG2SXifCn0jfQP3hkcSEIkeSS q5qdtDmbPQ8es0VipAfMxkzmwGdLtwtCf2T425RTk6xivhDDWI63ZfP6PkY6F93LCJCw ZrfbRti2h8pPureGUjHsw69XS4v4Pd3NSMgTmBE7oAuC3z0gSdF9r2zj3IvgenLfn3iG PXEVSDVW4GMqAk62+edT0RjMNj6Mpg/gQb1WTh8DBAworlFccITd4D03Ld8fkI+nT6yH Yk8g== X-Gm-Message-State: AOJu0Yw9497EstPnHJaozlQzp/+L54KaDqoOX7wlJgpVduYnRXzR2oxv ZO5TO1dGc20hAY7NqT0+H+yUDVQtKOhFeMgXUBY= X-Received: by 2002:a05:6a00:1913:b0:6be:26c1:be48 with SMTP id y19-20020a056a00191300b006be26c1be48mr3170962pfi.33.1697834836903; Fri, 20 Oct 2023 13:47:16 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u7-20020aa78487000000b00694fee1011asm1946775pfn.208.2023.10.20.13.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:47:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 49/65] target/hppa: Remove remaining TARGET_REGISTER_BITS redirections Date: Fri, 20 Oct 2023 13:43:15 -0700 Message-Id: <20231020204331.139847-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 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 The conversions to/from i64 can be eliminated entirely, folding computation into adjacent operations. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 46 ++++++++++++----------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 1a57ccc49b..95de007c69 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -33,15 +33,6 @@ #undef HELPER_H -/* Since we have a distinction between register size and address size, - we need to redefine all of these. */ - -#define tcg_gen_extu_reg_tl tcg_gen_mov_i64 -#define tcg_gen_trunc_i64_reg tcg_gen_mov_i64 -#define tcg_gen_extu_reg_i64 tcg_gen_mov_i64 -#define tcg_gen_ext_reg_i64 tcg_gen_mov_i64 - - typedef struct DisasCond { TCGCond c; TCGv_i64 a0, a1; @@ -1332,8 +1323,7 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, *pofs = ofs; *pgva = addr = tcg_temp_new_i64(); - tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base); - tcg_gen_andi_tl(addr, addr, gva_offset_mask(ctx)); + tcg_gen_andi_tl(addr, modify <= 0 ? ofs : base, gva_offset_mask(ctx)); #ifndef CONFIG_USER_ONLY if (!is_phys) { tcg_gen_or_tl(addr, addr, space_select(ctx, sp, base)); @@ -1945,13 +1935,11 @@ static bool trans_mfsp(DisasContext *ctx, arg_mfsp *a) unsigned rt = a->t; unsigned rs = a->sp; TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_i64 t1 = tcg_temp_new(); load_spr(ctx, t0, rs); tcg_gen_shri_i64(t0, t0, 32); - tcg_gen_trunc_i64_reg(t1, t0); - save_gpr(ctx, rt, t1); + save_gpr(ctx, rt, t0); cond_free(&ctx->null_cond); return true; @@ -2008,22 +1996,21 @@ static bool trans_mtsp(DisasContext *ctx, arg_mtsp *a) { unsigned rr = a->r; unsigned rs = a->sp; - TCGv_i64 t64; + TCGv_i64 tmp; if (rs >= 5) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_REG); } nullify_over(ctx); - t64 = tcg_temp_new_i64(); - tcg_gen_extu_reg_i64(t64, load_gpr(ctx, rr)); - tcg_gen_shli_i64(t64, t64, 32); + tmp = tcg_temp_new_i64(); + tcg_gen_shli_i64(tmp, load_gpr(ctx, rr), 32); if (rs >= 4) { - tcg_gen_st_i64(t64, tcg_env, offsetof(CPUHPPAState, sr[rs])); + tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUHPPAState, sr[rs])); ctx->tb_flags &= ~TB_FLAG_SR_SAME; } else { - tcg_gen_mov_i64(cpu_sr[rs], t64); + tcg_gen_mov_i64(cpu_sr[rs], tmp); } return nullify_end(ctx); @@ -2114,11 +2101,8 @@ static bool trans_ldsid(DisasContext *ctx, arg_ldsid *a) /* We don't implement space registers in user mode. */ tcg_gen_movi_i64(dest, 0); #else - TCGv_i64 t0 = tcg_temp_new_i64(); - - tcg_gen_mov_i64(t0, space_select(ctx, a->sp, load_gpr(ctx, a->b))); - tcg_gen_shri_i64(t0, t0, 32); - tcg_gen_trunc_i64_reg(dest, t0); + tcg_gen_mov_i64(dest, space_select(ctx, a->sp, load_gpr(ctx, a->b))); + tcg_gen_shri_i64(dest, dest, 32); #endif save_gpr(ctx, a->t, dest); @@ -3152,10 +3136,8 @@ static bool trans_shrp_sar(DisasContext *ctx, arg_shrp_sar *a) TCGv_i64 s = tcg_temp_new_i64(); tcg_gen_concat32_i64(t, load_gpr(ctx, a->r2), load_gpr(ctx, a->r1)); - tcg_gen_extu_reg_i64(s, cpu_sar); - tcg_gen_andi_i64(s, s, 31); - tcg_gen_shr_i64(t, t, s); - tcg_gen_trunc_i64_reg(dest, t); + tcg_gen_andi_i64(s, cpu_sar, 31); + tcg_gen_shr_i64(dest, t, s); } save_gpr(ctx, a->t, dest); @@ -3196,10 +3178,8 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shrp_imm *a) tcg_gen_rotri_i32(t32, t32, sa); tcg_gen_extu_i32_i64(dest, t32); } else { - TCGv_i64 t64 = tcg_temp_new_i64(); - tcg_gen_concat32_i64(t64, t2, cpu_gr[a->r1]); - tcg_gen_shri_i64(t64, t64, sa); - tcg_gen_trunc_i64_reg(dest, t64); + tcg_gen_concat32_i64(dest, t2, cpu_gr[a->r1]); + tcg_gen_extract_i64(dest, dest, sa, 32); } } save_gpr(ctx, a->t, dest);