From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFxLx-0005wE-QK for qemu-devel@nongnu.org; Wed, 13 Mar 2013 21:53:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFxLw-00041t-KR for qemu-devel@nongnu.org; Wed, 13 Mar 2013 21:53:09 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:43887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFxLw-00041o-Dc for qemu-devel@nongnu.org; Wed, 13 Mar 2013 21:53:08 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Mar 2013 19:53:07 -0600 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 7F845C90050 for ; Wed, 13 Mar 2013 21:53:04 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2E1r4eX290382 for ; Wed, 13 Mar 2013 21:53:04 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2E1r3km027012 for ; Wed, 13 Mar 2013 22:53:03 -0300 Message-ID: <51412D7F.1070405@linux.vnet.ibm.com> Date: Wed, 13 Mar 2013 21:53:03 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1363144182-1016-1-git-send-email-jschopp@linux.vnet.ibm.com> <1363144182-1016-8-git-send-email-jschopp@linux.vnet.ibm.com> <5140E6D4.3010600@redhat.com> <5140EDB2.2090009@linux.vnet.ibm.com> <51412664.3080404@linux.vnet.ibm.com> In-Reply-To: <51412664.3080404@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/9] asn1_input-visitor.diff List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Joel Schopp Cc: qemu-devel@nongnu.org, Michael Tsirkin On 03/13/2013 09:22 PM, Joel Schopp wrote: > >>>> + case 0x41: >>>> + case 0x40: >>>> + num.mpn.sign = ((number.first & 0x1) != 0); >>>> + num.mpn.biased_exponent = ~0; >>>> + num.mpn.mantissa_low = 0; >>>> + num.mpn.mantissa_high = 0; >>>> + *obj = num.v_double; >>> Is this really portable enough? In other words, do we really require >>> that qemu only compiles on platforms where double is in IEEE format? >>> >> Good question. I don't know in what format the other platforms are, >> though. I know it's used on i386, x86_64, ppc, ppc64. My guess is that >> it would have to be a really exotic CPU to not use this standard. >> >> I hope this applies to ARM in general... >> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0067d/Cihgejjg.html >> >> > > There are chips without hardware floating point, for example the ppc > 404. However, these use software emulation of IEE floating point when > doing floating point math. What we are looking for is a platform that > has floating point that isn't IEEE. > > Cell SPE comes to mind, though I don't think qemu emulates it and it > is a dead architecture (RIP). It also has an IEEE mode that makes its > non-standard floating point compliant. Even in non-compliant mode the > code above would work, it's more rounding that might be off. > > In summary I can't think of a platform we run on or emulate that has a > floating point mode the above would not work on. If somebody can > think of one please let me know so we can #ifdef a special case for > it. Otherwise let's assume the above works for all the platforms we > care about. One other choice could be string-encoding as also suggested by the standard with possible loss of precision. Though I think that any exotic processor could be dealt with a #ifdef around the code pressing its format into 2 bytes of exponent and 8 bytes of mantissa. Stefan