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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEA38C433ED for ; Fri, 23 Apr 2021 14:47:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 52B286144A for ; Fri, 23 Apr 2021 14:47:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52B286144A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bugs.launchpad.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZx5j-0007XR-AR for qemu-devel@archiver.kernel.org; Fri, 23 Apr 2021 10:47:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZx4f-0006yX-9y for qemu-devel@nongnu.org; Fri, 23 Apr 2021 10:46:29 -0400 Received: from indium.canonical.com ([91.189.90.7]:33320) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZx4U-000558-QD for qemu-devel@nongnu.org; Fri, 23 Apr 2021 10:46:29 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1lZx4S-0001SY-3g for ; Fri, 23 Apr 2021 14:46:16 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id D0A162E8169 for ; Fri, 23 Apr 2021 14:46:15 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Apr 2021 14:40:12 -0000 From: Pierre Muller <1843651@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=Fix Released; importance=Undecided; assignee=None; X-Launchpad-Bug-Tags: fpu m68k X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: pierre-freepascal pierre-muller th-huth X-Launchpad-Bug-Reporter: Pierre Muller (pierre-freepascal) X-Launchpad-Bug-Modifier: Pierre Muller (pierre-muller) References: <156823976031.17462.13699805496038510440.malonedeb@gac.canonical.com> Message-Id: <161918881280.10422.430374703699203513.malone@soybean.canonical.com> Subject: [Bug 1843651] Re: m68k fpu bug X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="f9f562f07f129de414c16be22a405ff0964e0018"; Instance="production" X-Launchpad-Hash: 37ecdda44e116836a908a6ed1043c8ecedcfd825 Received-SPF: none client-ip=91.189.90.7; envelope-from=bounces@canonical.com; helo=indium.canonical.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1843651 <1843651@bugs.launchpad.net> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" I tested, in release 5.2.0, this issue is fixed. Thanks ** Changed in: qemu Status: Incomplete =3D> Fix Released -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1843651 Title: m68k fpu bug Status in QEMU: Fix Released Bug description: On gcc123 cfarm machine, I was testing m68k executables generated by Free Pascal Compiler. muller@gcc123:~/pas/check$ cat inf.pp function get_double(x : double):double; begin get_double:=3Dx; end; = var y : double; py : pbyte; i : byte; begin y:=3D1.0/0.0; py:=3D@y; {$ifdef ENDIAN_LITTLE} write('little endian y=3D'); for i:=3D7 downto 0 do {$else not ENDIAN_LITTLE} write('big endian y=3D'); for i:=3D0 to 7 do {$endif} write(hexstr(py[i],2)); writeln; y:=3Dget_double(y)+1; {$ifdef ENDIAN_LITTLE} write('little endian y=3D'); for i:=3D7 downto 0 do {$else not ENDIAN_LITTLE} write('big endian y=3D'); for i:=3D0 to 7 do {$endif} write(hexstr(py[i],2)); writeln; end. muller@gcc123:~/pas/check$ ppc68k inf Free Pascal Compiler version 3.3.1-r20:42973M [2019/09/11] for m68k Copyright (c) 1993-2019 by Florian Klaempfl and others Target OS: Linux for m68k Compiling inf.pp Assembling program Linking inf 33 lines compiled, 0.1 sec muller@gcc123:~/pas/check$ ./inf big endian y=3D7FF0000000000000 big endian y=3D7FFFFFFFFFFFFFFF muller@gcc123:~/pas/check$ qemu-m68k ./inf big endian y=3D7FF0000000000000 big endian y=3D7FFFFFFFFFFFFFFF muller@gcc123:~/pas/check$ ~/sys-root/bin/qemu-m68k ./inf qemu-m68k qemu-m68k-fixed muller@gcc123:~/pas/check$ ~/sys-root/bin/qemu-m68k-fixed ./inf big endian y=3D7FF0000000000000 big endian y=3D7FF0000000000000 ~/sys-root/bin/qemu-m68k is 4.1.0 release, ~/sys-root/bin/qemu-m68k-fixed is the same source with a unique change: gnu/qemu/qemu-4.1.0/fpu/softfloat-specialize.h:214:#if defined(TARGET_M68= K) gnu/qemu/qemu-4.1.0/fpu/softfloat-specialize.h-215-#define floatx80_infin= ity_low LIT64(0x0000000000000000) gnu/qemu/qemu-4.1.0/fpu/softfloat-specialize.h-216-#else gnu/qemu/qemu-4.1.0/fpu/softfloat-specialize.h-217-#define floatx80_infin= ity_low LIT64(0x8000000000000000) gnu/qemu/qemu-4.1.0/fpu/softfloat-specialize.h-218-#endif the M68K branch value is set to the same value as the other branch. The problem of the M68K specific floatx86_infinity_low values is that is enters in conflict with muller@gcc123:~/pas/check$ grep -nA6 invalid_enc /home/muller/gnu/qemu/q= emu-4.1.0/include/fpu/softfloat.h 752:static inline bool floatx80_invalid_encoding(floatx80 a) 753-{ 754- return (a.low & (1ULL << 63)) =3D=3D 0 && (a.high & 0x7FFF) !=3D = 0; 755-} And thus the m68k variant of floatx80 representing +Infinity is considered as an invalid encoding, and thus converted into a NaN 7FFFFFFF= FFFFFFFF To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1843651/+subscriptions