Kernel Math Emulation vs. -msoft-float and -nfp

2 messages, 2 authors, 1999-10-30 · open the first message on its own page

Kernel Math Emulation vs. -msoft-float and -nfp

From: Grant Erickson <hidden>
Date: 1999-10-29 16:09:04

I finally got NFS root mounting working for the PowerPC 403GCX board port
I'm playing with and figured out why /sbin/init wasn't getting very far
(shared libraries, of course). However, that's about as far as things get.

I suspect that things are dying at this point because I'm using standard
files from Linux/PPC 1999 and that really assumes a PPC machine based on
the 6xx or 7xx processors.

So, I'm guessing that printf or one of the other routines that uses
varargs is killing things. I even compiled a simple, static, hello program
to replace /sbin/init and it too died.

So, I'm a little fuzzy on the issues with sans-FPU CPUs. What I'd like* to
accomplish is the ability to run a PowerPC binary compiled on ANY
Linux/PPC machine to run on this board. I think* I need kernel math
emualtion to accomplish this.

Anyway it seems to me that with the sans-FPU CPUs, there are three issues:
use of the floating point registers for argument passing, use of float and
double data types, and the use of arithmetic operations on those data
types.

So, my understanding is that -msoft-float does two things. First, it
prevents varags routines from using the floating point registers for
parameter passing, correct? Second, all floating / double math operations
are handled in inline or library code in user space, right?

So, my understanding of kernel math emulation is that it allows me to do
away with -msoft-float and instead all FP operations are emulated in the
kernel, right?

So, it seems the trade-off is more code (redundant for each app if it's
inline, shared if it's in the library) in user-space or a little more code
in the kernel (shared by ANY application needing it), right?

So, where does passing '-nfp' during the binutils, gcc, and glibc build
fit into all this?

Any light you can shed would be most appreciated.

Thanks,

Grant


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: Kernel Math Emulation vs. -msoft-float and -nfp

From: Wang Yong <hidden>
Date: 1999-10-30 00:57:13

how do you debug? kgdb or riscwatch? i met with the same problem when i
run a modified linux on i386. finally, i found the bug with kgdb that
the
problem is memory management. that is the handler of page fault. so i
guess if this is useful to you. i found that bug by adding some printk
in
the handlers and they gave me many useful information.

to the math-emu, i searched in the manual of 401d2 and found two
solutions
are provided. one is math library and the other is using the FPU
exception. the former is recommended for performance consideration. but 
i cannot find any math-emu lib for ppc. does linuxppc have one? there is 
a dir called math-emu in the arch/i386 and arch/sparc64 while arch/ppc
not.

anyway, i think the kernel should work without mathemu for there isn't 
any float point operation in kernel. right?

Grant Erickson wrote:
I finally got NFS root mounting working for the PowerPC 403GCX board port
I'm playing with and figured out why /sbin/init wasn't getting very far
(shared libraries, of course). However, that's about as far as things get.

I suspect that things are dying at this point because I'm using standard
files from Linux/PPC 1999 and that really assumes a PPC machine based on
the 6xx or 7xx processors.

So, I'm guessing that printf or one of the other routines that uses
varargs is killing things. I even compiled a simple, static, hello program
to replace /sbin/init and it too died.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help