From patchwork Wed Nov 2 16:57:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13028622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 557B5C4332F for ; Wed, 2 Nov 2022 16:58:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqH3f-0005rV-NR; Wed, 02 Nov 2022 12:57:43 -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 1oqH3d-0005pP-TW for qemu-devel@nongnu.org; Wed, 02 Nov 2022 12:57:41 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqH3T-0001Ao-FW for qemu-devel@nongnu.org; Wed, 02 Nov 2022 12:57:41 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0575A3200991; Wed, 2 Nov 2022 12:57:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 02 Nov 2022 12:57:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1667408246; x=1667494646; bh=2TFWLOI6i7agU1fdXiC24iUiZ oKJ0/+UvyNk8H7h+8w=; b=TgwQ0FeNvaaQJ6BoOmL76e9fzxfsC85SD1O87nruS GzUHO2C8UoA9j+/YnI7IOT2ViqJXyTWSCoANACcfXG5fkuaJdR8l1pfm0GKylR5b sqCoKMzjO9LIRTHfD4HXMMXSGRlAdloL9e48qRtw9rwLt7Rn5UXmEE+oE+CLgcT9 awPGd6O8CrPB7tlM3gsClGNldKvWQXmWtsh2rdserUsJYQmOpswFFJ9h1v3GXn5E fIQVSbSxgR1pzc1p2VeIA2cy4aOV66KDeSSdDUfF6LX9WKw1oMRqyUomQMPT7iwM rQr1rhhj4UWj+CeAy6Qurm8nopR4MEqS9fzRqN1vo3IeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1667408246; x=1667494646; bh=2TFWLOI6i7agU1fdXiC24iUiZoKJ0/+UvyN k8H7h+8w=; b=LBqWN1xbMVW5yIwZSF0PMKXGbXy5bUVAGdsqg9EKyAiyspdiw/6 aQeUIHIomh0G9rSURJ+LpXe2oqRbrqpXlAvxE27ZKoRnLDOayxCvA7rvPRyPWoYR M9O1sSsCOEXr5crQQrwL7QBdaSn8DWSAsf4IoIIkwVg4AVK8FpYK3ZoHD7Qx7jVi viBmLmVK0oSI0txRnUvoF7+zjAGM9GDcdpL0rmv3yi6O8rhx9Zlx42fhRCIvw8hx bJwAnh/cDk9rNjnVNLe9odriMSKdwS+/u6+5zBGKcPyocQcSXfcPaaTgsY80xsFM 2KehkwxLWFwuz/30EV+Mqs00LaXDMt2zzdw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudejgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekredtre dttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpefhtedutdduveeileejjeetff ehueejudehgfffjeduhfeuleeludfffefgffevkeenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorg htrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Nov 2022 12:57:25 -0400 (EDT) From: Jiaxun Yang To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, Jiaxun Yang Subject: [PATCH 1/2] target/mips: Don't check COP1X for 64 bit FP mode Date: Wed, 2 Nov 2022 16:57:18 +0000 Message-Id: <20221102165719.190378-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.24; envelope-from=jiaxun.yang@flygoat.com; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some implementations (i.e. Loongson-2F) may decide to implement a 64 bit FPU without implmenting COP1X instructions. As the eligibility of 64 bit FP instructions is already determined by CP0St_FR, there is no need to check for COP1X again. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé --- target/mips/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 2f2d707a12..e49d2a25a8 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1545,7 +1545,7 @@ void check_cop1x(DisasContext *ctx) */ void check_cp1_64bitmode(DisasContext *ctx) { - if (unlikely(~ctx->hflags & (MIPS_HFLAG_F64 | MIPS_HFLAG_COP1X))) { + if (unlikely(~ctx->hflags & MIPS_HFLAG_F64) { gen_reserved_instruction(ctx); } } From patchwork Wed Nov 2 16:57:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13028621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D241C43217 for ; Wed, 2 Nov 2022 16:58:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqH3k-0005u8-EV; Wed, 02 Nov 2022 12:57:48 -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 1oqH3h-0005tH-HI for qemu-devel@nongnu.org; Wed, 02 Nov 2022 12:57:45 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqH3T-0001BD-9h for qemu-devel@nongnu.org; Wed, 02 Nov 2022 12:57:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C019C3200988; Wed, 2 Nov 2022 12:57:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 02 Nov 2022 12:57:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1667408248; x=1667494648; bh=4T V9nMwaXoflOXBxNVUiz+XysdCPoEiWWWBv9VRamHo=; b=otqDBQKe1b5EQ26qCK V/MlCmTb9mU4CynCWjK+CB3ig9ZeYZxndHfOa7PW/qI6WQg+GA+GsD2d3+SOlg/L 2HHao80cctzdGccphSPAXGEJ8h9efdRDFnKDcuV+WcGzr2309EAgacJh8ImBAQL+ Vhs94ZW+LkqAUmuhQWEgx7iScBgVejCH0BjJUTC3bPbMoA7AEAS8QqEOrWZf3YhM LY5mNxZo2dDxFN66v8smr1AqewtTzbhcs4YEzgOGdF2JBAf8csXfW33G4lDF8FL5 bPX7NfrIb/WZbJFukPVihzESVwZNhklprEaw7dqRvX4S+669RlhYfzGSpit0ODwO 34Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667408248; x=1667494648; bh=4TV9nMwaXoflO XBxNVUiz+XysdCPoEiWWWBv9VRamHo=; b=h2cds6yNtCsWgGHZVoMhTNMOmwHQn 6tXYIDM89VrHPrgaxKcNziHai69sgyZjNO8gLpaKJPYCFWx5RbWsJOTc1KhSYDga sE4yxBJj7t3fkXIWExsvLNYni7/n/PdcjoBEkEHWjBwGaEhCeNoVVWmLf12sqrXL VCiTqQ5fDZbDh53uU2LbjQAg5l9ku/lNbw9w4rv6edB+cULgrZrTz9BPwqqdA7ag aPyeGV9n/EO6mkoQ+ZleOYKpOg2l0QlkfooI9OhObuqueT22LVswIHQr2P58JgXc c3+GBNBECCxMK2UMJ0+N+MDav3k12uGOsqUJcqGXIu9jHike3UDdS0y0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudejgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvuedvvd egkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihgh horghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Nov 2022 12:57:27 -0400 (EDT) From: Jiaxun Yang To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, Jiaxun Yang Subject: [PATCH 2/2] target/mips: Correct check for CABS instructions Date: Wed, 2 Nov 2022 16:57:19 +0000 Message-Id: <20221102165719.190378-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221102165719.190378-1-jiaxun.yang@flygoat.com> References: <20221102165719.190378-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.24; envelope-from=jiaxun.yang@flygoat.com; helo=wout1-smtp.messagingengine.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, SPF_HELO_PASS=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Accroading to "MIPS Architecture for Programmers Volume IV-c: The MIPS-3D Application-Specific Extension to the MIPS64 Architecture" (MD00099). CABS.cond.fmt belongs to MIPS-3D ASE, and it has nothing to do with COP1X opcode. Remove all unnecessary COP1X checks and check for MIPS3D availability in decoding code path. Signed-off-by: Jiaxun Yang --- target/mips/tcg/translate.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index e49d2a25a8..23e575ad95 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1788,16 +1788,8 @@ static inline void gen_cmp ## type ## _ ## fmt(DisasContext *ctx, int n, \ check_ps(ctx); \ break; \ case FMT_D: \ - if (abs) { \ - check_cop1x(ctx); \ - } \ check_cp1_registers(ctx, fs | ft); \ break; \ - case FMT_S: \ - if (abs) { \ - check_cop1x(ctx); \ - } \ - break; \ } \ gen_ldcmp_fpr##bits(ctx, fp0, fs); \ gen_ldcmp_fpr##bits(ctx, fp1, ft); \ @@ -10424,6 +10416,7 @@ static void gen_farith(DisasContext *ctx, enum fopcode op1, case OPC_CMP_NGT_S: check_insn_opc_removed(ctx, ISA_MIPS_R6); if (ctx->opcode & (1 << 6)) { + check_insn(ctx, ASE_MIPS3D); gen_cmpabs_s(ctx, func - 48, ft, fs, cc); } else { gen_cmp_s(ctx, func - 48, ft, fs, cc);