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=-1.0 required=3.0 tests=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 0F82AC49ED6 for ; Wed, 11 Sep 2019 22:21:32 +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 D22B22085B for ; Wed, 11 Sep 2019 22:21:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D22B22085B 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]:56764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8AzT-0007zn-0U for qemu-devel@archiver.kernel.org; Wed, 11 Sep 2019 18:21:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39367) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8Ayf-0007Xd-43 for qemu-devel@nongnu.org; Wed, 11 Sep 2019 18:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8Ayd-0001KE-Hd for qemu-devel@nongnu.org; Wed, 11 Sep 2019 18:20:40 -0400 Received: from indium.canonical.com ([91.189.90.7]:41006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8Ayd-0001Ie-Bq for qemu-devel@nongnu.org; Wed, 11 Sep 2019 18:20:39 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1i8Ayb-0004aa-ON for ; Wed, 11 Sep 2019 22:20:37 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id AE2A62E80C3 for ; Wed, 11 Sep 2019 22:20:37 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 11 Sep 2019 22:09:20 -0000 From: Pierre Muller <1843651@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=New; importance=Undecided; assignee=None; X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: pierre-freepascal X-Launchpad-Bug-Reporter: Pierre Muller (pierre-freepascal) X-Launchpad-Bug-Modifier: Pierre Muller (pierre-freepascal) Message-Id: <156823976031.17462.13699805496038510440.malonedeb@gac.canonical.com> 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="19044"; Instance="production-secrets-lazr.conf" X-Launchpad-Hash: c9e3e0b75a90112512c5dbb2593d244b87487ba3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 91.189.90.7 Subject: [Qemu-devel] [Bug 1843651] [NEW] m68k fpu bug 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" Public bug reported: 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_M68K) gnu/qemu/qemu-4.1.0/fpu/softfloat-specialize.h-215-#define floatx80_infinit= y_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_infinit= y_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/qem= u-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 7FFFFFFFFF= FFFFFF ** Affects: qemu Importance: Undecided Status: New -- = 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: New 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