From nobody Wed Nov 27 14:34:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698279743; cv=none; d=zohomail.com; s=zohoarc; b=CYqBT5vdooIYARiINORmaH6VJk9jWHKrFcUYQgbggLFyQ9EHfYXPXVocyoQwppHuL1+3Llt7wosxg8uNJw88rtUfSOJiAUaLqF8dYRHgSwbKRlZ0oMTST39M1b0spueCiy79tLHQe4PwOzuP5Sd7MVorWdT8qvKsIkNdQ25l7pU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698279743; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=jVGlwsfbm4sLINQJ1C25FK0LHbR26UwjjqtCg2xAyg8=; b=Z8X3kH92DOfgB+TMgsxcaFzO4jgKbyCPnXNlNMElTh8EdHtd43ve3vBhSPi0WpVNzrH/0l1s/bhT/rYuaTCu/uWo6cS7nDReQt4Tvhw0aV08xkYI04PGcf+zwv/zwDstoMbjikb9eQLJMUSf0R6b88jefAmLdyAqHUeZt/StcJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698279743637533.6106033725025; Wed, 25 Oct 2023 17:22:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvo6G-0001Dg-VP; Wed, 25 Oct 2023 20:19:50 -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-0000yz-Mx for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:44 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo61-0006d3-KB for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:43 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1cbf47fa563so2294255ad.2 for ; Wed, 25 Oct 2023 17:19:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jh1-20020a170903328100b001c5fc291ef9sm9754655plb.209.2023.10.25.17.19.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279571; x=1698884371; 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=jVGlwsfbm4sLINQJ1C25FK0LHbR26UwjjqtCg2xAyg8=; b=FeJMXiYGlpWU+R4zX53zg7iprgSjuBBAFS2uUI1P3LyrWoauPOkKSrgBHCvad3MUt4 sBFqjzRKA0tVeUtj03z2HFky4k/cfibXmLhVcu2s4eFr9UFz6H0Qkl/Rv8zbo2cHWYF1 FzxhPpoAwSlWmulFv5YpcRXNK2w2v0I5liK2hhZle1LBkrP8nTBm/FiFW23o3hM6o8mP Mgae4Valtq4JM6SxIeupEIw8raWsbEwQ4/ZXGz00kltWXyfbMwlkmChBh7uilo4eNLsu CS/kz6qQwqTjBrdHvmNCTl3i654XuwUjNnaYq3zYKOsLotKNFw009a3RCN6aLyobbTnR 7/4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279571; x=1698884371; 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=jVGlwsfbm4sLINQJ1C25FK0LHbR26UwjjqtCg2xAyg8=; b=XO8Jw/JnvlIjQwitRoDjNG3RY6Yw4IR0MyGRjcSOm7ANPdIPZK2aXmq6euh6l4YkOe vKcN0IJdsn44XeIGjG1izpZuYqRwXZCLQdtRnOZYVJMxrhokBxlE9ypzEvsudKQ8rT8B Rf51XE77iJENOgzQsEK0easc6fFbDRfZwV6Q2lH2P2k2DpwYCQGAmo7MqFLfA2/0t5tg TXXKW1zn3HPxvk8E3Kn/XY33Y6jiG1VnrTU7ouHcTsOGpATJRCm62geSTZBUQbamPmdk Y4NkhmuCJoR26NkkckN0nqvGNE7jBNLTVAY4UbBRxShXXe6z4iRadXlqzYXgbz9z/+Pb JOtQ== X-Gm-Message-State: AOJu0YyPXuHkcx8ruKseCJ+S0h1HZbZuDVDQBu6f9FlRMlavTZYJmY67 10HJpHpD+unvlcyeC0hM1sF6I1v6Vun0U66ZWwU= X-Google-Smtp-Source: AGHT+IEoe4rqU7bXUwPqYyYLqfs7FC5egsca0B+Yx7z+rfU2XtPuaErBwvkcUbkDs2f1JftVsc2O6g== X-Received: by 2002:a17:902:d2c1:b0:1c7:495c:87df with SMTP id n1-20020a170902d2c100b001c7495c87dfmr17741585plc.53.1698279571171; Wed, 25 Oct 2023 17:19:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 29/29] target/alpha: Use TCG_COND_TSTNE for gen_fold_mzero Date: Wed, 25 Oct 2023 17:14:36 -0700 Message-Id: <20231026001542.1141412-58-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698279744226100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/alpha/translate.c | 49 +++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index c7daf46de7..c68c2bcd21 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -490,56 +490,53 @@ static DisasJumpType gen_bcond(DisasContext *ctx, TCG= Cond cond, int ra, =20 /* Fold -0.0 for comparison with COND. */ =20 -static void gen_fold_mzero(TCGCond cond, TCGv dest, TCGv src) +static TCGv_i64 gen_fold_mzero(TCGCond *pcond, uint64_t *pimm, TCGv_i64 sr= c) { - uint64_t mzero =3D 1ull << 63; + TCGv_i64 tmp; =20 - switch (cond) { + *pimm =3D 0; + switch (*pcond) { case TCG_COND_LE: case TCG_COND_GT: /* For <=3D or >, the -0.0 value directly compares the way we want= . */ - tcg_gen_mov_i64(dest, src); - break; + return src; =20 case TCG_COND_EQ: case TCG_COND_NE: - /* For =3D=3D or !=3D, we can simply mask off the sign bit and com= pare. */ - tcg_gen_andi_i64(dest, src, mzero - 1); - break; + /* For =3D=3D or !=3D, we can compare without the sign bit. */ + *pcond =3D *pcond =3D=3D TCG_COND_EQ ? TCG_COND_TSTEQ : TCG_COND_T= STNE; + *pimm =3D INT64_MAX; + return src; =20 case TCG_COND_GE: case TCG_COND_LT: /* For >=3D or <, map -0.0 to +0.0. */ - tcg_gen_movcond_i64(TCG_COND_NE, dest, src, tcg_constant_i64(mzero= ), - src, tcg_constant_i64(0)); - break; + tmp =3D tcg_temp_new_i64(); + tcg_gen_movcond_i64(TCG_COND_EQ, tmp, + src, tcg_constant_i64(INT64_MIN), + tcg_constant_i64(0), src); + return tmp; =20 default: - abort(); + g_assert_not_reached(); } } =20 static DisasJumpType gen_fbcond(DisasContext *ctx, TCGCond cond, int ra, int32_t disp) { - TCGv cmp_tmp =3D tcg_temp_new(); - DisasJumpType ret; - - gen_fold_mzero(cond, cmp_tmp, load_fpr(ctx, ra)); - ret =3D gen_bcond_internal(ctx, cond, cmp_tmp, 0, disp); - return ret; + uint64_t imm; + TCGv_i64 tmp =3D gen_fold_mzero(&cond, &imm, load_fpr(ctx, ra)); + return gen_bcond_internal(ctx, cond, tmp, imm, disp); } =20 static void gen_fcmov(DisasContext *ctx, TCGCond cond, int ra, int rb, int= rc) { - TCGv_i64 va, vb, z; - - z =3D load_zero(ctx); - vb =3D load_fpr(ctx, rb); - va =3D tcg_temp_new(); - gen_fold_mzero(cond, va, load_fpr(ctx, ra)); - - tcg_gen_movcond_i64(cond, dest_fpr(ctx, rc), va, z, vb, load_fpr(ctx, = rc)); + uint64_t imm; + TCGv_i64 tmp =3D gen_fold_mzero(&cond, &imm, load_fpr(ctx, ra)); + tcg_gen_movcond_i64(cond, dest_fpr(ctx, rc), + tmp, tcg_constant_i64(imm), + load_fpr(ctx, rb), load_fpr(ctx, rc)); } =20 #define QUAL_RM_N 0x080 /* Round mode nearest even */ --=20 2.34.1