From mboxrd@z Thu Jan 1 00:00:00 1970 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 35396C4332F for ; Wed, 4 Jan 2023 13:46:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pD45p-0000hN-Sx; Wed, 04 Jan 2023 08:46:09 -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 1pD45o-0000gb-E4 for qemu-devel@nongnu.org; Wed, 04 Jan 2023 08:46:08 -0500 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pD45k-0005ir-5s for qemu-devel@nongnu.org; Wed, 04 Jan 2023 08:46:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: Message-Id:Date:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ewFD019AUpcCsLhO2iyJEDvsBJxVuBMhsosnAEJNNfE=; b=zv/S+RnQnmvVAKJESu+QraayVC CP+I1RGmhmxo4N+/vbYaeaFkg8Veyvp04tqk1FWooxJkoqNVb4bTidKqN++hvrDRXqdIO5rLZMmlv KEZWUmkPN/Qkzkw9m9c/PqiUSvZIbRXyBBZwpvfiwdnrzx2EhQi8/fC4HXZDGAk6ttNzV7OZQ1nCq MtqdjaXUZA/nP/23Qlb1/JkvbF7F017tmmRjQI/t1vXAv93UnoGqTpjrVSrX/IeeJvX5s/e50sGv6 hgyNjPu+EVB+4LtUOAgnIDFU2CNkaIfzbQLFmLdKGasR6z9FViMEYy/cMGwDTpWHrlOTMk29V2lxm IRyDGBNnaiS5KcdadivoFDgpyJVfC4ublkz+w8Bdl4WRX8vD/VuU14TQARDGa+oJpGr7DB8O22bG4 2OG0anktKOj2zvHripl6NJRmJRXrgYfzCQZvivREbipSAnolTqvSSmEeHGKzSowvI3WqXT63RLgWM +gYwA60xhiw8hJTka8PyKHp6JuopdJLWmPCqRWlTZlEnmG8jqArNxR8gi2MKT9cpgr28k3+TAfY3c wED55I3MfseTcWQyWvwSsxoj5FGoRISGnu4xH0ocoX/Zm8v3vJ4phCsifwC5WaXL6N+KOT+TGHqIs QKZ06GZEbbTJ7F0yV/4s6bvAOSxCdfDQ5RgE++ZEY=; Received: from [2a00:23c4:8baa:1d00:e655:fde:753f:696a] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pD45K-00099q-MX; Wed, 04 Jan 2023 13:45:42 +0000 From: Mark Cave-Ayland To: laurent@vivier.eu, qemu-devel@nongnu.org Date: Wed, 4 Jan 2023 13:45:50 +0000 Message-Id: <20230104134554.138012-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a00:23c4:8baa:1d00:e655:fde:753f:696a X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 0/4] target/m68k: fix FPSR quotient byte for fmod and frem X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk 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_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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This series is taken from my MacOS branch and fixes setting the FPSR quotient byte for the fmod and frem instructions which was causing the MacOS _Pack5 SANE trancendentals implementation to return incorrect values for sin() and cos(). The first 2 patches update make_quotient() to take separate sign and value parameters so that it can be used for both floatx80_modrem() and a manual division calculation, whilst the last 2 patches fix the value of the quotient byte for both the fmod and frem instructions. This series has been validated against the fmod and frem results using a custom test program which has been run on a real 68040 Mac. Many thanks to the mac68k folk for their help debugging this, in particular SolraBizna for narrowing down the issue to the transcendentals and writing the custom test program, and also treellama and Cat7 for running the test program on real hardware and uploading the generated results file for further analysis. Signed-off-by: Mark Cave-Ayland v2: - Add Laurent's R-B tags to patches 1, 3 and 4 - Rework patch 2 as suggested by Richard Mark Cave-Ayland (4): target/m68k: pass quotient directly into make_quotient() target/m68k: pass sign directly into make_quotient() target/m68k: fix FPSR quotient byte for fmod instruction target/m68k: fix FPSR quotient byte for frem instruction target/m68k/fpu_helper.c | 46 +++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 17 deletions(-) -- 2.30.2