From patchwork Wed Oct 25 07:27:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737853 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp150505wrq; Wed, 25 Oct 2023 00:33:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGPtUoQLaZl47s8lX0WAzEQr9k8z9LdrikAElBJUkat7fG0wAGPQlRslWW/505JdaOqDV7 X-Received: by 2002:ac8:4e4c:0:b0:417:fa13:a8f7 with SMTP id e12-20020ac84e4c000000b00417fa13a8f7mr21190414qtw.4.1698219192376; Wed, 25 Oct 2023 00:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698219192; cv=none; d=google.com; s=arc-20160816; b=q005KR7mVAssGmcyKJEb5FvWDpP3mWpFFDX4Z9QkFZ3PkKvOTbsaXu0S3E20LtLH+I csyAojol7Gki1LgXdWlrz67kJov5uPhhAndQGcm4mmshixiG90xsOWnEgcAInSsFCFrC 4KOS+pqF1V6rIJHc4PXQCBue7v75b7HsRJ1/JA+nFXdiiy/6M2MD4uNmVZHUgCdQbLhM OfDb8BsJd/uCGERH2QJakldr8PnC4X8Xsznqmxe39SvDm7cEP8UTT4RaiS+sRUteOJ4r zZsnwj+AlNonV7IDJiVvQrI6P/ibBsxqsNfvmS4Iz6hdIdG5DjEYrkQfocnNPIlyEX2T OlZg== 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=Qt73rqnYlScESAX1GLvymJtn101eThzhHh8tymn5hTE=; fh=ycigHkwOPieh2u5PmcA89sNk/qPD1ZkdDlL8Mchfvw8=; b=W4wRlO6J0ZKux/Xl9zSskiYiSx4BsyhuvxUV2HJnsqhO3WNjAtLLpoHm64qczwUBCf U6F0EHHIbLew2nveUZBxV1AoFxclJrTfN1OVf2aiw9uPM3fOHeOWqW1mrzp4K4mgmy/B hwbcE9Kwf8NcTC4yPPfeMX/1OmKRxsF8MNsH9WTtFpnvdkZS4JwKgtt1agsLhh1nkioP 49im5lTInu24Z4US8uqu4tEY53tcWG3DKqcGNkw2qhalHVOtSIPp8Cv2D1GB5fe4gR6C N5P/kOl18QKSIJQQeoHF9xnEeKKMoeUaLyqHHJdSWT8ODbrymW/BnAwYcuoA3ynYbufz gUDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hb4jLOBz; 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 f2-20020ac85d02000000b0041815201c4bsi8730141qtx.12.2023.10.25.00.33.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 00:33:12 -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=Hb4jLOBz; 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 1qvYIq-0000NU-Lq; Wed, 25 Oct 2023 03:27:44 -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 1qvYIk-0000Le-J4 for qemu-devel@nongnu.org; Wed, 25 Oct 2023 03:27:38 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvYIi-0004kI-Ny for qemu-devel@nongnu.org; Wed, 25 Oct 2023 03:27:38 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c9e06f058bso4510035ad.0 for ; Wed, 25 Oct 2023 00:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698218854; x=1698823654; 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=Qt73rqnYlScESAX1GLvymJtn101eThzhHh8tymn5hTE=; b=Hb4jLOBz30hzHe3ZFXddh2sY2D6LBB5S3omHCM24cWV476HesfPk2tyUuaXiA0PtjF tf6LBATI2Wlk972HMgF4Xpc19cqbGASOqp1oS/Tui5WJJTCCRFu02V6l+BHrz5wUV//B AMq7h27GxPVhTTSn2GAuK2jM2W/xCfIxQY93hKrt854O8KHqHZuYOPknqv/v+NPc/wVO uacDpx/+tBS7Vv2cZZcL2IRQWfKwItLIvVdqwRqWjAslrB2Tc6n1B5Sy+grGwjBVjM3K DEhYdz3eWN7egVHuNi2LSQ0hKiDtyDCIOWpLbi854htcImJhC2M/DgJpDpNi6xeQnf0j VXtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698218854; x=1698823654; 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=Qt73rqnYlScESAX1GLvymJtn101eThzhHh8tymn5hTE=; b=VSom4q+B7itsdYGXTeIhpK24tpiMwGpuBc5YbXqSJ5qSm1EC76Qxdig8OnoTSzdktb YMs8sakyeFrevWCyuGoclyIjw1qF6O+gAKZpmWBijGQ/39FIdyvQmxsCD0Vm3nqZZU/h LRt76kFhJ0SnfEIEnd3FMf4r9x2i/127fEkKz25mjx8H4Zsfuu0W1MwQOx/J4ONYWjPi mTeaFim39XVQsKjlOFccu1OlaezOrPgu5laDhdOUlz6U1CT1xdUoO+ukB71bV/c/mAs3 wMMneizTLMven+cTCASIM8Gu1O/sfKlGNBb9pL8xCGmq0W2QRmgUqUQ9TiiaTxM+RHab Ihww== X-Gm-Message-State: AOJu0YxmeOQX6dxZm7fhsRh7PDKRc5/sae/aX3+RQkbuc4oOf7Na1cd7 DuXjlgPRLz9AZwTjiZyPgVAvV3yqV8U3oD95rck= X-Received: by 2002:a17:902:c949:b0:1c5:7d49:570e with SMTP id i9-20020a170902c94900b001c57d49570emr9002725pla.29.1698218854481; Wed, 25 Oct 2023 00:27:34 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ji5-20020a170903324500b001b06c106844sm8578661plb.151.2023.10.25.00.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 00:27:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 27/29] target/alpha: Use TCG_COND_TST{EQ,NE} for BLB{C,S} Date: Wed, 25 Oct 2023 00:27:05 -0700 Message-Id: <20231025072707.833943-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231025072707.833943-1-richard.henderson@linaro.org> References: <20231025072707.833943-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Signed-off-by: Richard Henderson --- target/alpha/translate.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 32333081d8..49e6a7b62d 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,27 +472,20 @@ 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; } } static DisasJumpType gen_bcond(DisasContext *ctx, TCGCond cond, int ra, - int32_t disp, int mask) + int32_t disp) { - 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), + is_tst_cond(cond), 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; } @@ -2827,35 +2820,35 @@ static DisasJumpType translate_one(DisasContext *ctx, uint32_t insn) break; case 0x38: /* BLBC */ - ret = gen_bcond(ctx, TCG_COND_EQ, ra, disp21, 1); + ret = gen_bcond(ctx, TCG_COND_TSTEQ, ra, disp21); break; case 0x39: /* BEQ */ - ret = gen_bcond(ctx, TCG_COND_EQ, ra, disp21, 0); + ret = gen_bcond(ctx, TCG_COND_EQ, ra, disp21); break; case 0x3A: /* BLT */ - ret = gen_bcond(ctx, TCG_COND_LT, ra, disp21, 0); + ret = gen_bcond(ctx, TCG_COND_LT, ra, disp21); break; case 0x3B: /* BLE */ - ret = gen_bcond(ctx, TCG_COND_LE, ra, disp21, 0); + ret = gen_bcond(ctx, TCG_COND_LE, ra, disp21); break; case 0x3C: /* BLBS */ - ret = gen_bcond(ctx, TCG_COND_NE, ra, disp21, 1); + ret = gen_bcond(ctx, TCG_COND_TSTNE, ra, disp21); break; case 0x3D: /* BNE */ - ret = gen_bcond(ctx, TCG_COND_NE, ra, disp21, 0); + ret = gen_bcond(ctx, TCG_COND_NE, ra, disp21); break; case 0x3E: /* BGE */ - ret = gen_bcond(ctx, TCG_COND_GE, ra, disp21, 0); + ret = gen_bcond(ctx, TCG_COND_GE, ra, disp21); break; case 0x3F: /* BGT */ - ret = gen_bcond(ctx, TCG_COND_GT, ra, disp21, 0); + ret = gen_bcond(ctx, TCG_COND_GT, ra, disp21); break; invalid_opc: ret = gen_invalid(ctx);