From patchwork Thu Oct 26 00:14:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738228 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp555135wrq; Wed, 25 Oct 2023 17:26:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDx/px8LziUpx+P0Y8ZLYhV74umyMna6DDkPmp9SR4+9+N4OApFXblmdk6KF1dkiSWgkNF X-Received: by 2002:a05:600c:4f01:b0:405:3cc5:1105 with SMTP id l1-20020a05600c4f0100b004053cc51105mr13287521wmq.8.1698279983344; Wed, 25 Oct 2023 17:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698279983; cv=none; d=google.com; s=arc-20160816; b=gqF32986UFfFhr2C5iVpXZt6+M1TCDHcZtcC2CRPZY/RuhJ52u6eGJBIgnHkdklnLN 0K1FOMMErDYtvXtqmWM63lp64tofx4qN21qWQh2Ql675nu8zJO03uDqaBEeOcNuxaKRJ FFs5yXU/zoBAXaMN/JaPBH1Vh/pUJifmhNPXnlc/fDP7093JMeG9bK+5SQqBj5aIGH0H MUtrtmtVnPMaNFDOz/zDAXYv9RemokmhtcpEeqDQ2JyiAxzEXB9aC+E+Qgf/cwWBYBl2 5c5VvObFX7Nk09Y3ekbywaShqgpTbVhK1zOYF2gMC7pyPjKcTXUyGOgRM0267L85kcqK LNdQ== 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:to:from :dkim-signature; bh=Qt73rqnYlScESAX1GLvymJtn101eThzhHh8tymn5hTE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Whov5f+dgzJiR4KK4a72JfVfWA6SKcHoQFzZWG0A/2yFvJgmSi3z82OFgHBYI0BH3x Ys1uX8JyqWtwIfH60Skuvec24qnk1lDv28HOoIYPU/TTyROSJSbresmTfnL7dAQlJo2R JeyCFiistHzz2h+tWiGPtjtXsSeNHBOFWiYgJcc2/1VN2/CmACUm7wiSjnRsoIhQ/BwE ClqpCMWJSx3sk6O5q875Ea/If5YK4kgqcaqTQGfcOiuV2xJCs3LN6moaB9UTIrbbyhIE pwrh84EQ8KTcGqYP1JVU3E6wR/fUsDiXPBnphSghfyiDCfOsuYf1Y0pDzlzX8pbPMrDg xyYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DULBObys; 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 y4-20020a5d6144000000b003216429c97dsi8254675wrt.515.2023.10.25.17.26.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:26:23 -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=DULBObys; 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 1qvo6j-0002Cm-Fa; Wed, 25 Oct 2023 20:20:17 -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 1qvo6B-0000z0-NN for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:44 -0400 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 1qvo5x-0006cE-6s for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:42 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1caad0bcc95so2218955ad.0 for ; Wed, 25 Oct 2023 17:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279568; x=1698884368; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Qt73rqnYlScESAX1GLvymJtn101eThzhHh8tymn5hTE=; b=DULBObys5g8APW5N3EyCjBIjqk38rVMbS3j/IPPe4p/LVP851+zrv/EzwxX5+aWlXX 9pkZdH60R0AF5V4RL0oKXe3CJ8F3bIQYsiiHgVCczc5IEOmEeHSf+n2/4BgxuIjiPJsj vk4fEtBk4ewHiSO12Y61y2seKoZvFFqeRzUPWgPY9CLz77koPT0iiBfWPj4BNIHaXg9Y VSrIEKHuxI7snLaPW3NFU+2ERlkqgB64MYQQJQpCC51lOycUMrAqUsYSLJMOSsuXpC9K ++XAKvVhckZMPl93aEb3ehT8DUl9EgmxG1oGqcUVujQW0rEOvLrr2ONlH/SO255L8mqL QyNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279568; x=1698884368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qt73rqnYlScESAX1GLvymJtn101eThzhHh8tymn5hTE=; b=HqOwYxAfn9MoxxxDNXupFM/bIHqdRCDfJbMROFNvLGn70Gu2K3BuM9rXfKVk22Wu8k 3hyHElRVlE2svprDR2RobWPwNP2Ji2Yxcd9ggSrVs8DaQM6t+W5YOKXOETuFSfTD+B5Z 0dfbpcdIf7DcuWbC5TqZ4cigP8znCp29UtR0/J9iUr34bYGycD+SxtkPKwK+h5SigRWB xu79DUI0m0zOfc5V9NAJBgk4Nysr59tR91e00llkupizrN7MS8YIgJGxqriwUZokbzmJ O726FA+QyGW0FqqOqKgdVNMkr0dvJh4R0+yoPTZDyphO6VU7TFpgCg2okpWunSSCuMiv MhdQ== X-Gm-Message-State: AOJu0Yy86dXGuycUmu9A1kZ8hW21d3m/fT6BbIIxmYXbohwZWxsJmWOW VKc8T2BH0jgrsB0/d6XVnS5qTyBZaNCjCvJIwYw= X-Received: by 2002:a17:902:fa87:b0:1c9:de48:fc78 with SMTP id lc7-20020a170902fa8700b001c9de48fc78mr14022761plb.7.1698279567902; Wed, 25 Oct 2023 17:19:27 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jh1-20020a170903328100b001c5fc291ef9sm9754655plb.209.2023.10.25.17.19.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:19:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 27/29] target/alpha: Use TCG_COND_TST{EQ,NE} for BLB{C,S} Date: Wed, 25 Oct 2023 17:14:32 -0700 Message-Id: <20231026001542.1141412-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-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 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);