This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Glibc on ppc built on i386




Geoff Keating wrote:

> > Date: Thu, 26 Nov 1998 13:12:02 +0100
> > From: Kenneth Johansson <erakeon@kieray1.p.y.ki.era.ericsson.se>
>
> > Hi Iam trying to make my own glibc that uses softfloat and no inline
> > assembler(FPU) for PPC. As I don't have an ppc machine I can use I
> > must make the library on a intel machine.
>
> The usual way to cope with those ppc chips that didn't come with an
> FPU is to write an FPU emulator.  If done well, this is faster and
> uses less memory than using softfloat, and lets you use precompiled
> binaries.  It also has the advantage that I don't think egcs has been
> tested with -msoft-float and -fpic together.

I'm using linux as kernel and it did not include emulation for FPU and when I looked at the emulation for i386 the size of
the code involved kind of got me thinking on another solution. And thu speed of floating point is of no interest to me as
I plan on not using it how would it be as fast as soft float. Even a move from one register to another will end up in an
exception where we need to fist find out a pointer to the code then save the registers we use, do the work, restor
register and back. But even soft-float cant be inlined al the time I guess.

But I do not need or require a system with soft-float over one that is emulated I just took what looked at the time to be
shortest way. As I dont see how I can use a prebuilt system and I need a cross compile environment I need to compile
everything anyway so a few changes to make it work without fpu did not look to hard. After al gcc have soft float and
glibc (acording to manual) can be compiled with --without-fp.
The only other thing I know have to change is gdb so it dont use fpu but my understanding of gdb let me to belive that is
easy. That would give me a setup I can work with.


> If you do want to use soft-float for some reason, you need to write
> implementations for the routines that currently use FPU instructions

> (setjmp and longjmp, the floating-point environment routines whose

> names start with 'f', the math routines written in assembler called
> sysdeps/powerpc/s_*.S);

> move the current versions of these routines
> into sysdeps/powerpc/fpu and put your routines in sysdeps/powerpc.
>

I did this but I have missed set/long jump. Did not look into them But now when I have Iam not clear on what they should
do. Well I can see that they store/load al local variables registers but what kind of jump is this that need that kind of
work. And as this is not a "libm" file in it self I think that I need to change it so it is possible to compile it to both
fpu and fpuless versions. Also I guess the code is done with some pipeline in mind, would be nice if this low level magic
had some comment on what it dose.

I don't really have too wite new f an s_*.S files do I ?

> Leave Versions alone, it's harmless if you don't define the routines.
> Leave the math routines written in C alone unless you want to rewrite
> them to be faster with the emulated library.  Of course, you will also
> need a library that implements gcc's soft-float floating point
> emulation.
>

hmm what do you mean that I need a soft-float library. This is how I see it.

gcc compiles in soft-float for +,-,*,/ compare functions and conversion (casts).
libc (libm) provides sin,pow...

So if I take out al asm with FPU instructions from libc I am done. With done I mean that I could compile any C program
linked with libc libm that uses float and it would not complain. Or is there some dependencies I don't see.



> > mmap(0x7ffff7f8, 0, PROT_NONE, 0x4 /* MAP_??? */|MAP_FIXED|MAP_ANONYMOUS|0x1860640, 25560692, 0x1860000) = 0x1800000
> > mmap(0x7ffff7f8, 0, PROT_NONE, 0x4 /* MAP_??? */|MAP_FIXED|MAP_ANONYMOUS|0x1860640, 25560692, 0x1860000) = 0x1840000
> > --- SIGSEGV (Segmentation fault) ---
> > +++ killed by SIGSEGV +++
> > bash#
>
> This could be absolutely anything.

yes I know But it is still very early so I thougt that if someone have had the same problem would know what it was. But
yes quite hard to pinpoint without more information. Personally I dont have a clue I dont know the memory map that ppc
uses. Where can I get that information?

> --
> Geoffrey Keating <geoffk@ozemail.com.au>





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]