From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K4J16-0000Dd-Jb for mharc-grub-devel@gnu.org; Thu, 05 Jun 2008 13:12:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4J14-0000AX-G3 for grub-devel@gnu.org; Thu, 05 Jun 2008 13:12:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4J12-00007b-13 for grub-devel@gnu.org; Thu, 05 Jun 2008 13:12:45 -0400 Received: from [199.232.76.173] (port=45815 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4J11-00007J-Nf for grub-devel@gnu.org; Thu, 05 Jun 2008 13:12:43 -0400 Received: from gateway02.websitewelcome.com ([69.41.248.20]:54486) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1K4J11-0001sk-1u for grub-devel@gnu.org; Thu, 05 Jun 2008 13:12:43 -0400 Received: (qmail 25809 invoked from network); 5 Jun 2008 17:23:04 -0000 Received: from gator297.hostgator.com (74.53.228.114) by gateway02.websitewelcome.com with SMTP; 5 Jun 2008 17:23:04 -0000 Received: from [146.187.184.68] (port=43668 helo=localhost) by gator297.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1K4J0w-0006oW-D3 for grub-devel@gnu.org; Thu, 05 Jun 2008 12:12:38 -0500 Date: Thu, 5 Jun 2008 10:12:38 -0700 From: Colin D Bennett To: The development of GRUB 2 Message-ID: <20080605101238.68ecf34e@gibibit.com> In-Reply-To: <484804D4.8020400@coresystems.de> References: <1212598032.15804.9.camel@dv> <4848025A.9010302@gmx.de> <484804D4.8020400@coresystems.de> X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.9; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator297.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gibibit.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: Floating point usage X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2008 17:12:47 -0000 On Thu, 05 Jun 2008 17:23:00 +0200 Stefan Reinauer wrote: > Jan Kleinsorge wrote: > > Pavel Roskin wrote: > > > >> Hello! > >> > >> I tried to compile the current grub on Fedora 9 for PowerPC, but it > >> failed due to floating point usage in ls. Sorry, I don't have the > >> exact message handy. > >> > >> Anyway, there are several references to "float" and "double" in the > >> code, and I think it's wrong. GRUB should be able to work on > >> systems with no floating point support and on systems where the > >> floating point device needs to be activated. Even Linux kernel > >> avoids using floating point. > >> > >> If everyone is fine, I'll try to remove all floating point stuff > >> from the code. > >> > >> > > Hi Pavel, > > > > there is no need for hard-float support on the target machine. The > > libgcc provides all the software-emulation routines. Given that > > GRUB is linked against it. Which is likely as it is a necessity > > when compiling with gcc. Maybe your compilation is simply broken > > because of that one missing. Could you please post the error > > message? > Nonetheless, using Floating Point operations in bootloaders and > firmware is highly discouraged. If Floating Point is required for a > bootloader (except, maybe, possibly, at all, for encryption) the > bootloader is definitely broken, either in implementation or in > design. > > Also keep in mind, most operating systems expect the FPU to be in > power on state. > > Stefan The bootloader is "broken" if it uses floating point arithmetic? I think that while GRUB should not REQUIRE an FPU, it could use software floating point if there was a good reason to do so (and it would not be broken as long is it was done portably). Though I only have minimal knowledge of encryption algorithms, I don't think that floating point math is often used. I think that avoiding floating point math as Pavel Roskin suggested is good, though I don't agree that Stefan's assertion that any use of floating point math is necessarily "broken" -- it might be better to say that we'd prefer not to pull in softfloat libraries (necessary since many targets have no FPU); therefore it is desirable to avoid floating point math. Colin