* [ppc patch] soft-float
@ 2004-10-03 23:46 Hollis Blanchard
2004-10-04 11:24 ` Marco Gerards
0 siblings, 1 reply; 8+ messages in thread
From: Hollis Blanchard @ 2004-10-03 23:46 UTC (permalink / raw)
To: grub-devel
This patch allows the Total Impact briQ
(http://www.totalimpact.com/products/the_briq/the_briq.html) to boot GRUB.
The briQ's firmware does not set MSR:FP; however, floating point registers
are used as per the PPC SVR4 ABI to pass variable argument lists. This
results in a fatal exception.
Our options are either to enable MSR:FP ourselves or to disable this
behavior. Either is easy enough, but since there is no real reason to use
FP in GRUB I chose to disable it.
I also noticed that __ASSEMBLY__ was being defined in CFLAGS, which is
incorrect.
2004-10-03 Hollis Blanchard <hollis@penguinppc.org>
* conf/powerpc-ieee1275.mk (COMMON_CFLAGS): remove -D__ASSEMBLY__.
Add -msoft-float.
* conf/powerpc-ieee1275.rmk (COMMON_CFLAGS): remove
-D__ASSEMBLY__.
Add -msoft-float.
Index: conf/powerpc-ieee1275.mk
===================================================================
RCS file: /cvsroot/grub/grub2/conf/powerpc-ieee1275.mk,v
retrieving revision 1.9
diff -u -r1.9 powerpc-ieee1275.mk
--- conf/powerpc-ieee1275.mk 14 Sep 2004 21:21:12 -0000 1.9
+++ conf/powerpc-ieee1275.mk 3 Oct 2004 23:31:01 -0000
@@ -2,7 +2,7 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -D__ASSEMBLY__
-COMMON_CFLAGS = -fno-builtin -D__ASSEMBLY__
+COMMON_CFLAGS = -fno-builtin -msoft-float
# Images.
Index: conf/powerpc-ieee1275.rmk
===================================================================
RCS file: /cvsroot/grub/grub2/conf/powerpc-ieee1275.rmk,v
retrieving revision 1.10
diff -u -r1.10 powerpc-ieee1275.rmk
--- conf/powerpc-ieee1275.rmk 22 Sep 2004 18:26:16 -0000 1.10
+++ conf/powerpc-ieee1275.rmk 3 Oct 2004 23:31:01 -0000
@@ -2,7 +2,7 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -D__ASSEMBLY__
-COMMON_CFLAGS = -fno-builtin -D__ASSEMBLY__
+COMMON_CFLAGS = -fno-builtin -msoft-float
# Images.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-03 23:46 [ppc patch] soft-float Hollis Blanchard
@ 2004-10-04 11:24 ` Marco Gerards
2004-10-06 7:10 ` Stefan Reinauer
0 siblings, 1 reply; 8+ messages in thread
From: Marco Gerards @ 2004-10-04 11:24 UTC (permalink / raw)
To: The development of GRUB 2
Hollis Blanchard <hollis@penguinppc.org> writes:
> This patch allows the Total Impact briQ
> (http://www.totalimpact.com/products/the_briq/the_briq.html) to boot GRUB.
> The briQ's firmware does not set MSR:FP; however, floating point registers
> are used as per the PPC SVR4 ABI to pass variable argument lists. This
> results in a fatal exception.
Oh, neat!
> Our options are either to enable MSR:FP ourselves or to disable this
> behavior. Either is easy enough, but since there is no real reason to use
> FP in GRUB I chose to disable it.
You mean we have to choose between hardware floating point
calculations or doing this in software? If it is possible, it would
be nice to do this in hardware, also because this will reduce the code
size.
But floating point instructions are not used that much so I will apply
this patch.
Thanks,
Marco
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-04 11:24 ` Marco Gerards
@ 2004-10-06 7:10 ` Stefan Reinauer
2004-10-06 8:57 ` Yoshinori K. Okuji
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Reinauer @ 2004-10-06 7:10 UTC (permalink / raw)
To: The development of GRUB 2
* Marco Gerards <metgerards@student.han.nl> [041004 13:24]:
> > Our options are either to enable MSR:FP ourselves or to disable this
> > behavior. Either is easy enough, but since there is no real reason to use
> > FP in GRUB I chose to disable it.
>
> You mean we have to choose between hardware floating point
> calculations or doing this in software? If it is possible, it would
> be nice to do this in hardware, also because this will reduce the code
> size.
>
> But floating point instructions are not used that much so I will apply
> this patch.
Are there _any_? I would expect that a bootloader gets along nicely
without FP instructions at all.
I think the patch is valuable not only for those machines with FPU
disabled, but also for those with no FPU at all..
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-06 7:10 ` Stefan Reinauer
@ 2004-10-06 8:57 ` Yoshinori K. Okuji
2004-10-06 9:59 ` Marco Gerards
0 siblings, 1 reply; 8+ messages in thread
From: Yoshinori K. Okuji @ 2004-10-06 8:57 UTC (permalink / raw)
To: The development of GRUB 2
On Wednesday 06 October 2004 09:10, Stefan Reinauer wrote:
> Are there _any_? I would expect that a bootloader gets along nicely
> without FP instructions at all.
I agree. GRUB should not use floating point at all. Marco, can you
describe why you need floating point?
> I think the patch is valuable not only for those machines with FPU
> disabled, but also for those with no FPU at all..
Yes.
Okuji
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-06 8:57 ` Yoshinori K. Okuji
@ 2004-10-06 9:59 ` Marco Gerards
2004-10-06 10:18 ` Tomas Ebenlendr
0 siblings, 1 reply; 8+ messages in thread
From: Marco Gerards @ 2004-10-06 9:59 UTC (permalink / raw)
To: The development of GRUB 2
"Yoshinori K. Okuji" <okuji@enbug.org> writes:
> On Wednesday 06 October 2004 09:10, Stefan Reinauer wrote:
>> Are there _any_? I would expect that a bootloader gets along nicely
>> without FP instructions at all.
>
> I agree. GRUB should not use floating point at all. Marco, can you
> describe why you need floating point?
There is grub_ftoa and in commands/ls.c it is used to print the size
of files like "2.5k" or so.
--
Marco
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-06 9:59 ` Marco Gerards
@ 2004-10-06 10:18 ` Tomas Ebenlendr
2004-10-07 9:18 ` Yoshinori K. Okuji
0 siblings, 1 reply; 8+ messages in thread
From: Tomas Ebenlendr @ 2004-10-06 10:18 UTC (permalink / raw)
To: The development of GRUB 2
> "Yoshinori K. Okuji" <okuji@enbug.org> writes:
>
> > On Wednesday 06 October 2004 09:10, Stefan Reinauer wrote:
> >> Are there _any_? I would expect that a bootloader gets along nicely
> >> without FP instructions at all.
> >
> > I agree. GRUB should not use floating point at all. Marco, can you
> > describe why you need floating point?
>
> There is grub_ftoa and in commands/ls.c it is used to print the size
> of files like "2.5k" or so.
>
> --
> Marco
>
This can be done with integers, if we define some 'human big number
format', or so. But I think that FP/FPE is more generic problem,
because of modularity of grub.
It seems to me that some combinations (like grub with FP emul, and
module with FP instructions) may not work. I think, there should be
left (compiletime) decision on user if she want to use FP emul. So
I'm voting for having possibility to use FP instructions, at least
on platforms where it is possible easily.
--
Tomas 'ebi' Ebenlendr
http://get.to/ebik
PF 2004.76367672915
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-06 10:18 ` Tomas Ebenlendr
@ 2004-10-07 9:18 ` Yoshinori K. Okuji
2004-10-07 14:54 ` Stefan Reinauer
0 siblings, 1 reply; 8+ messages in thread
From: Yoshinori K. Okuji @ 2004-10-07 9:18 UTC (permalink / raw)
To: The development of GRUB 2
On Wednesday 06 October 2004 12:18, Tomas Ebenlendr wrote:
> This can be done with integers, if we define some 'human big number
> format', or so. But I think that FP/FPE is more generic problem,
> because of modularity of grub.
But, IMO, floating point is not required for boot loaders. I admit that
floating point is convenient, but I don't see many cases where floating
point is useful in the context of boot loaders.
Okuji
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ppc patch] soft-float
2004-10-07 9:18 ` Yoshinori K. Okuji
@ 2004-10-07 14:54 ` Stefan Reinauer
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Reinauer @ 2004-10-07 14:54 UTC (permalink / raw)
To: The development of GRUB 2
* Yoshinori K. Okuji <okuji@enbug.org> [041007 11:18]:
> On Wednesday 06 October 2004 12:18, Tomas Ebenlendr wrote:
> > This can be done with integers, if we define some 'human big number
> > format', or so. But I think that FP/FPE is more generic problem,
> > because of modularity of grub.
In case of file sizes, the number format is just bytes..
(bytes>>10) is kbytes
etc... It is easy to shift through and print the remainder..
> But, IMO, floating point is not required for boot loaders. I admit that
> floating point is convenient, but I don't see many cases where floating
> point is useful in the context of boot loaders.
If a module wants to use fp, it should take care of checking for an fpu
and enabling it autonomously. There's cases where operating
systems started crashing because they assumed that the fpu is untouched
at a certain point of startup. Sure, it's the OSes fault to some regard.
But we don't start enabling MMU and paging either. Even though some
applications might use it. At some point it is the responsibility of an
OS or standalone application to handle hardware extensions. And this
point should not be pushed higher for no real reason.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-10-07 15:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-03 23:46 [ppc patch] soft-float Hollis Blanchard
2004-10-04 11:24 ` Marco Gerards
2004-10-06 7:10 ` Stefan Reinauer
2004-10-06 8:57 ` Yoshinori K. Okuji
2004-10-06 9:59 ` Marco Gerards
2004-10-06 10:18 ` Tomas Ebenlendr
2004-10-07 9:18 ` Yoshinori K. Okuji
2004-10-07 14:54 ` Stefan Reinauer
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.