From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C60791A1E03 for ; Fri, 12 Aug 2016 09:01:42 -0700 (PDT) Received: by mail-wm0-x235.google.com with SMTP id q128so36112352wma.1 for ; Fri, 12 Aug 2016 09:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iiTc3HHE8A8TcHms5csjy4dO++PXnj4zsuGh8Oc0OTI=; b=J1gx8Ho3i+bItD2d1QhxOlN/UtmDAAtzxTOlHF2qS9XPRGjL/6fscJ9q69ei5TAo7U kTNGtlZk0d/O1OwIOXcWZjvRN9vtmmCa8eC/buTRqbsfS9qdb9m8C5Zfw8mKZV+oYhun HCfHoTUNvvFbewucmpWexPIXX2hVTHKdrZm1MD+yqldx2V44UTy7N4DtKfgmLGISOguW RLJ1xZEeq6JxcfySVRAIm+T6tOeWrzpTB26zVop+kSa/n6p6AxQyQuz0OPPVEwVI/ed8 jDRWBeQYSvsOa1SDsSeaDYtRBwi0mOJWAOeExnVYK0WgfHrV/5yvLDYng6xClIp+zq71 hxLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iiTc3HHE8A8TcHms5csjy4dO++PXnj4zsuGh8Oc0OTI=; b=AqmmI4Cikj1ir2GGXSTvvL7PORIgFikaAa/k2cWf7vidp1/rEe6ngU9oz3e3zIVhPN I+mWGI+SYqESXcLSaWpN+WUXeCBNW/Ug3825ztNla0pht/ncEpdES2JGD6ZiGGDX9jRL SBxcKtaWDFvD/8J8ZXbE5QAoGtTo5IVZ/308crnsQfH84Q+ZSucY892oec/G+DD0rjJx UdfkGLY/g6rkX10qAk5qQGpm12tVvYTHB+Op2uaqXsuO/ofoiH4b4BylX4n42knpMBbX gzRjcqSbVlzSbszYvhPlbjAqizTPuiZ+QBQKOFai0xVAiBpb8qwwUlj0tuydSWPZkWuW +mjQ== X-Gm-Message-State: AEkooutEimVIf3Ps6+FT4dTwFhh5XjFb7oMmuyTqMKzK73MAIGzXS2wZjugX7IkUEfPhkdvWzq/YNXE63KRy3g== X-Received: by 10.28.214.130 with SMTP id n124mr3681472wmg.37.1471017701205; Fri, 12 Aug 2016 09:01:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.238.198 with HTTP; Fri, 12 Aug 2016 09:01:40 -0700 (PDT) In-Reply-To: <1080543071.17349738.1449595724215.JavaMail.yahoo@mail.yahoo.com> References: <000501d12fbc$673d6910$35b83b30$@notabs.org> <1080543071.17349738.1449595724215.JavaMail.yahoo@mail.yahoo.com> From: Michael Zimmermann Date: Fri, 12 Aug 2016 18:01:40 +0200 Message-ID: To: Shubha Ramani Cc: Scott Duplichan , Daryl McDaniel , "edk2-devel@ml01.01.org" X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: Double or floating point on edk2 ? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2016 16:01:43 -0000 Content-Type: text/plain; charset=UTF-8 sry for bringing up this ancient thread but I got a question about this: shouldn't soft-float be 100% safe because it's a software implementations and thus never throw exceptions? Thanks Michael On Tue, Dec 8, 2015 at 6:28 PM, Shubha Ramani wrote: > Thanks for your well-thought out and detailed answer !I guess the safe bet > is "No". Stay away from floating point on EDK2. > Shubha Shubha D. Ramanishubharamani@gmail.com > shubharamani@yahoo.com > > > On Saturday, December 5, 2015 4:24 PM, Scott Duplichan < > scott@notabs.org> wrote: > > > Daryl McDaniel [mailto:edk2-lists@mc2research.org] wrote: > > ]Sent: Saturday, December 05, 2015 11:00 AM > ]To: 'Shubha Ramani' ; edk2-devel@ml01.01.org > ]Subject: Re: [edk2] Double or floating point on edk2 ? > ] > ]Hello, > ] > ]Doing floating point operations within the UEFI environment > ]is not recommended. There are many reasons, but the main one > ]is that floating point exceptions are unlikely to be handled. > > I think the need to enable and trap floating point exceptions > is rare. For most applications, the normal masked response > works well. Here is Intel's official position: > > "Exception-handling software is often difficult to write, > and the masked responses have been tailored to deliver the > most reasonable result for each condition. For the majority > of applications, masking all exceptions yields satisfactory > results with the least programming effort." > > ]The default FPU mode (rounding, precision, ...) may also not > ]be what you would want. > > I think the default FPU mode meets the requirements of the C > programming language. But if not, it could be changed. > > ]There is also a chance that one or more of the UEFI functions > ]may destroy a floating point or vector register that you are using. > > Is this really true? I think the compiler will preserve the registers > when needed for C code. ASM code could certainly destroy floating > point registers. A problem would occur if SMI or the timer interrupt > code were to use floating point registers. Could it be possible > for timer callback code to use floating point and destroy registers > of the interrupted application? > > ]That said, there is nothing that would prevent you from using > ]floating point types and operations in your Shell application. > ]If you do, it is your responsibility to ensure that the environment > ]is properly set up for your needs. The UEFI specification details > ]what registers are preserved, or not. > ] > ]Using StdLib does not alleviate this responsibility. The only thing > ]StdLib does is ensure that the correct rounding, floor, and NAN modes > ]are set in the FPU in order to conform to the ISO/IEC 9899 Addendum-1 > ](C95) specification. The sole purpose of StdLib's floating point > ]support is to facilitate porting existing C applications to the UEFI > ]environment. > ] > ]Unfortunately, using floating point is entirely at your own risk. > > The good thing is the problem with unresolved external symbol __dtoui3 > is gone with the current EDK2. This problem used to occur when building > AppPkg for IA32 using VS2013 or newer. It no longer occurs because of > "BaseTools: Add /arch:IA32 option in VS2012 and VS2013". Though that > change was made to prevent the compiler from generating the cmov > instruction, it also has the side effect of turning off SSE2 math. > > Thanks, > Scott > > > ]Sincerely, > ]Daryl McDaniel > > > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Shubha Ramani > > Sent: Friday, December 04, 2015 4:39 PM > > To: edk2-devel@lists.01.org > > Subject: [edk2] Double or floating point on edk2 ? > > > > I know this question has been answered before. Do I need to convert my > application to a UEFI StdLib applicationto do double or > > floating point math ? Can't do it in a regular Shell App ? > > Please illuminate. > > Thanks, > > Shubha Shubha D. Ramanishubharamani@gmail.com > > shubharamani@yahoo.com > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >