* Floating point usage
@ 2008-06-04 16:47 Pavel Roskin
2008-06-05 15:12 ` Jan Kleinsorge
2008-06-05 20:12 ` Vesa Jääskeläinen
0 siblings, 2 replies; 8+ messages in thread
From: Pavel Roskin @ 2008-06-04 16:47 UTC (permalink / raw)
To: The development of GRUB 2
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.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Floating point usage
2008-06-04 16:47 Floating point usage Pavel Roskin
@ 2008-06-05 15:12 ` Jan Kleinsorge
2008-06-05 15:23 ` Stefan Reinauer
2008-06-05 20:01 ` Vincent Pelletier
2008-06-05 20:12 ` Vesa Jääskeläinen
1 sibling, 2 replies; 8+ messages in thread
From: Jan Kleinsorge @ 2008-06-05 15:12 UTC (permalink / raw)
To: The development of GRUB 2
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?
Jan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Floating point usage
2008-06-05 15:12 ` Jan Kleinsorge
@ 2008-06-05 15:23 ` Stefan Reinauer
2008-06-05 17:12 ` Colin D Bennett
2008-06-05 20:01 ` Vincent Pelletier
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Reinauer @ 2008-06-05 15:23 UTC (permalink / raw)
To: The development of GRUB 2
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
--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info@coresystems.de • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Floating point usage
2008-06-05 15:23 ` Stefan Reinauer
@ 2008-06-05 17:12 ` Colin D Bennett
0 siblings, 0 replies; 8+ messages in thread
From: Colin D Bennett @ 2008-06-05 17:12 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, 05 Jun 2008 17:23:00 +0200
Stefan Reinauer <stepan@coresystems.de> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Floating point usage
2008-06-05 15:12 ` Jan Kleinsorge
2008-06-05 15:23 ` Stefan Reinauer
@ 2008-06-05 20:01 ` Vincent Pelletier
2008-06-05 20:53 ` Robert Millan
1 sibling, 1 reply; 8+ messages in thread
From: Vincent Pelletier @ 2008-06-05 20:01 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 638 bytes --]
Le Thursday 05 June 2008 17:12:26 Jan Kleinsorge, vous avez écrit :
> Given that GRUB is linked against it. Which is likely as it is a necessity
> when compiling with gcc.
...except if -nostdlib is given to gcc, which is the case in grub2. For the
bootloader part at least, grub-emu is another question.
And there is an except to this except: If -lgcc is specified it will be used,
and it is for the following archs, as far as I can see:
- powerpc-ieee1275
- i386-linuxbios
- i386-ieee1275
So half the supported archs don't need libgcc, I think it's enough to try
avoiding that dependency.
--
Vincent Pelletier
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Floating point usage
2008-06-05 20:01 ` Vincent Pelletier
@ 2008-06-05 20:53 ` Robert Millan
2008-06-05 21:22 ` Stefan Reinauer
0 siblings, 1 reply; 8+ messages in thread
From: Robert Millan @ 2008-06-05 20:53 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, Jun 05, 2008 at 10:01:38PM +0200, Vincent Pelletier wrote:
> And there is an except to this except: If -lgcc is specified it will be used,
> and it is for the following archs, as far as I can see:
> - powerpc-ieee1275
> - i386-linuxbios
> - i386-ieee1275
Why would i386-linuxbios and i386-ieee1275 need libgcc but i386-pc don't?
IIRC the tendency is that CISC platforms tend not to need libgcc for floating
point but RISC ones do. Did I make a mistake on these two ports?
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Floating point usage
2008-06-05 20:53 ` Robert Millan
@ 2008-06-05 21:22 ` Stefan Reinauer
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Reinauer @ 2008-06-05 21:22 UTC (permalink / raw)
To: The development of GRUB 2
Robert Millan wrote:
> Why would i386-linuxbios and i386-ieee1275 need libgcc but i386-pc don't?
> IIRC the tendency is that CISC platforms tend not to need libgcc for floating
> point but RISC ones do. Did I make a mistake on these two ports?
>
Those platforms require libgcc even for double precision integer
divisions. It's a bit nasty.
--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info@coresystems.de • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Floating point usage
2008-06-04 16:47 Floating point usage Pavel Roskin
2008-06-05 15:12 ` Jan Kleinsorge
@ 2008-06-05 20:12 ` Vesa Jääskeläinen
1 sibling, 0 replies; 8+ messages in thread
From: Vesa Jääskeläinen @ 2008-06-05 20:12 UTC (permalink / raw)
To: The development of GRUB 2
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.
Its only for printing units in human readable format. So its only small
arithmetics to get it going nicely with integers. While you are there,
can you modify it to use more proper units... MiB , KiB,...
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-06-05 21:22 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04 16:47 Floating point usage Pavel Roskin
2008-06-05 15:12 ` Jan Kleinsorge
2008-06-05 15:23 ` Stefan Reinauer
2008-06-05 17:12 ` Colin D Bennett
2008-06-05 20:01 ` Vincent Pelletier
2008-06-05 20:53 ` Robert Millan
2008-06-05 21:22 ` Stefan Reinauer
2008-06-05 20:12 ` Vesa Jääskeläinen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.