From patchwork Sun Feb 4 21:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 769867 Delivered-To: patch@linaro.org Received: by 2002:adf:9bca:0:b0:33a:e5bd:fedd with SMTP id e10csp1842464wrc; Sun, 4 Feb 2024 13:44:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2hm/bej+pcNc6Y/5NhvtwdvfByS8yFHK+xAjIIgziQYC8o4OMpxDXLwA9oxAzLW62/fDr X-Received: by 2002:a0c:e0ca:0:b0:681:7bab:be38 with SMTP id x10-20020a0ce0ca000000b006817babbe38mr6017854qvk.13.1707083052342; Sun, 04 Feb 2024 13:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707083052; cv=none; d=google.com; s=arc-20160816; b=BakoMpokkp3z4Pk6Tp9DuviNuf1N5lXgrmL0f0KhdWD0GTZnDHmGUEvXxLQOothSxV 8pr2wGbP6wwGH0sevtLIoohas1/alOHLl0gDbp8NEr5MjhqpgM5HYrTNf3E5+O1sMSyr 1x7YYY67jrItwS7VJQmm2vyactSsmCzbETNc1jsyTiYdWxKx1Gtf7d6mgut+WZ8mRy5i c+MhrtsCXgPt+dpY4jSpA7sQCbgCNOZMpc0uQ22UTRWN401msmJqedoo6VcaRCQq4fB/ /1oPXYQ1HQEPx5Nb5VU0rO8vGGWy4VYzYqV5oZVvJR0JCFyTq6aDYHUvDZDpXdjmsJoy e3cQ== 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=PdjLaL1s4T12GYUYF4WyCqbK9Vrp5G+xso0HVv7zwQk=; fh=C+g5t+++EdwIPkhnYLUSvWWbt42UnJdyo2wn3BggdAI=; b=F+hl2plyLekl8SVfgJxonkMo5ANy/8bpO9o6XGUV0xN3+TrdiDMwEYXPE3BP2M5FOM oy+A7E+ejVq0NSCL0CSDaIBy0O2JhBjH2Ze+H4nPxTUgm9bvluDb0ODc6R+sqbJOJ6bk aYcha+i268mdY8EX8Kp39Rgmj1P8zpe9DUCbHJ5aS5Qpare8etIl0PoQ2N9ZeojmJuEn Xtv4Zzhh51YkaJatTUKp6v5wlTFago4lyVeBrELdB3UFIgRUNCXFSK6SFQz+LbTgcITD oz4PLNV//oy0t9ngiVEQ68kJOZ0Yj+hGA6jecklt+02vbaesZZzSKN/s4dsazCtv6rV2 mgFg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hbTtkZbJ; 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 X-Forwarded-Encrypted: i=0; AJvYcCWGwyVNFagSDjKzvouc6OROV4ry7wxKe9HTskLrIczioxQ4OANd6JAxYy5yTBhXL/smxgJKke8Y82pcciOuOwxG Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k17-20020a0cf591000000b0068c4088317dsi7001861qvm.49.2024.02.04.13.44.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Feb 2024 13:44:12 -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=hbTtkZbJ; 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 1rWkEs-000245-EO; Sun, 04 Feb 2024 16:41:22 -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 1rWkEm-00022x-BV for qemu-devel@nongnu.org; Sun, 04 Feb 2024 16:41:16 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rWkEk-0003Vr-Qr for qemu-devel@nongnu.org; Sun, 04 Feb 2024 16:41:16 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1d7393de183so27249295ad.3 for ; Sun, 04 Feb 2024 13:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707082873; x=1707687673; 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=PdjLaL1s4T12GYUYF4WyCqbK9Vrp5G+xso0HVv7zwQk=; b=hbTtkZbJlo2GsjUFzTHMv99axI2dUFEC5QQPagb4+c8SQtYtZTRASAPmcDJA8gLvjW /+Ygst5/5etzA5/IxHGbApVc4b2BQoVtiX8xy0h/90YdpeCJCizg0MCvDRo1TJ/mmGJw HB4F+yGZTj9MTPrTGEm2tX93gJUfrH2CPc+Gx2H36YUQQRHbSDOF1ncbHg1na4PieHso EuACX5qsmDMPpaxGcqyVMoAO+YN6uSRpt2UG5DhLSzNTYRCImKNRRYAoPIkAzkOEEqSG OouCFwglgZEjwuKD7ZS3jVtuBaUA5te2nubWzjxhuWLWiPKTpC9cZkWdCJT0azhAthUt fM8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707082873; x=1707687673; 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=PdjLaL1s4T12GYUYF4WyCqbK9Vrp5G+xso0HVv7zwQk=; b=JeHZtZah5WIRoCYT+Pm0J2FKmA0Vman/L8L/p+d+3Z3s2wg1JPPVdl8XddaFQuMg9k CJq3JKddgr0rse2TUwhxEkw6O7IXIRnNXgDwYkg4nLe3cE/zsWwbolOX6qPQGhEWWUno g1CjC9rtt0IhzG8fxSW4GmUTwOjJp2RVK5AhWDh9ond1CqLjm3rQPjy+xpU2yW2+fCfv RwR65OaFmPnvVLYdVyS3BQZnQPR+to+sf5n14thK47oFhtChlKtgOM92PI5DNmn5P7W1 8c83jfl7dThF3gLyNDIDayAz0Cjc8fK/u7a/GT3GpZ5X86LJ6M8J4Vi1CdnyqENv3J6u ixvQ== X-Gm-Message-State: AOJu0Ywa2sq/ISdfkL1/J5BEnQvUNWSENV6QO23LQSYns0PL2KQ2CtWM KFHyHwPBjXNweAjC1ELHNLrRKfPvtXWfxrsgWOhGTACPTMGDFuLbgdimzW5AMH3p8Nq60NEnKWd si7Q= X-Received: by 2002:a17:902:6503:b0:1d9:50ca:c4e4 with SMTP id b3-20020a170902650300b001d950cac4e4mr10052932plk.27.1707082873451; Sun, 04 Feb 2024 13:41:13 -0800 (PST) Received: from stoup.. ([43.252.112.156]) by smtp.gmail.com with ESMTPSA id mf11-20020a170902fc8b00b001d8f5560503sm4953670plb.222.2024.02.04.13.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 13:41:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 08/39] target/alpha: Pass immediate value to gen_bcond_internal() Date: Mon, 5 Feb 2024 07:40:21 +1000 Message-Id: <20240204214052.5639-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240204214052.5639-1-richard.henderson@linaro.org> References: <20240204214052.5639-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Simplify gen_bcond() by passing an immediate value. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20231028194522.245170-33-richard.henderson@linaro.org> [PMD: Split from bigger patch, part 1/2] Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231108205247.83234-1-philmd@linaro.org> --- target/alpha/translate.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 4b464f8651..e9cb623277 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -453,13 +453,13 @@ static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp) } static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, - TCGv cmp, int32_t disp) + TCGv cmp, uint64_t imm, int32_t disp) { uint64_t dest = ctx->base.pc_next + (disp << 2); TCGLabel *lab_true = gen_new_label(); if (use_goto_tb(ctx, dest)) { - tcg_gen_brcondi_i64(cond, cmp, 0, lab_true); + tcg_gen_brcondi_i64(cond, cmp, imm, lab_true); tcg_gen_goto_tb(0); tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); @@ -472,11 +472,11 @@ static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, return DISAS_NORETURN; } else { - TCGv_i64 z = load_zero(ctx); + TCGv_i64 i = tcg_constant_i64(imm); TCGv_i64 d = tcg_constant_i64(dest); TCGv_i64 p = tcg_constant_i64(ctx->base.pc_next); - tcg_gen_movcond_i64(cond, cpu_pc, cmp, z, d, p); + tcg_gen_movcond_i64(cond, cpu_pc, cmp, i, d, p); return DISAS_PC_UPDATED; } } @@ -484,15 +484,8 @@ static DisasJumpType gen_bcond_internal(DisasContext *ctx, TCGCond cond, static DisasJumpType gen_bcond(DisasContext *ctx, TCGCond cond, int ra, int32_t disp, int mask) { - if (mask) { - TCGv tmp = tcg_temp_new(); - DisasJumpType ret; - - tcg_gen_andi_i64(tmp, load_gpr(ctx, ra), 1); - ret = gen_bcond_internal(ctx, cond, tmp, disp); - return ret; - } - return gen_bcond_internal(ctx, cond, load_gpr(ctx, ra), disp); + return gen_bcond_internal(ctx, cond, load_gpr(ctx, ra), + mask, disp); } /* Fold -0.0 for comparison with COND. */ @@ -533,7 +526,7 @@ static DisasJumpType gen_fbcond(DisasContext *ctx, TCGCond cond, int ra, DisasJumpType ret; gen_fold_mzero(cond, cmp_tmp, load_fpr(ctx, ra)); - ret = gen_bcond_internal(ctx, cond, cmp_tmp, disp); + ret = gen_bcond_internal(ctx, cond, cmp_tmp, 0, disp); return ret; }