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


> Date: Fri, 27 Nov 1998 17:02:16 +0100
> From: Kenneth Johansson <erakeon@kieray1.p.y.ki.era.ericsson.se>
> CC: libc-alpha@cygnus.com

> 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.

You need to have all the functionality in the library available in
both fpu and fpuless versions, including libm.  Soft-float does not
mean programs will not need to do floating-point calculations; it just
means that you need to write software that can perform them, instead
of using hardware provided by IBM.  When you ask gcc for soft-float,
it just tries to call the routines you provide instead of using the
hardware.

setjmp and longjmp are documented in the glibc manual under "Non-Local
Exits".  You can find information about which registers it needs to
save by reading the PowerPC SYSV ABI, and by consulting the PowerPC
User's Manuals; the first is apparently available from
<http://www.esofta.com/softspecs.html>, the second from IBM or
Motorola's web sites.

(The short answer is you can just delete the instructions that save or
restore FPU registers).

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

You may be able to just move the s_*.S files out of the way so that
the libm-ieee754 routines get used, but you do need to write the fenv
stuff.  Probably you will need to just write versions of the routines
that don't actually do anything: they only support one rounding mode,
they have no exceptions, and there is no floating-point environmental
state to save or restore.  Of course, if you're using a comprehensive
soft-float library, it will provide exceptions and/or rounding modes,
and it would be nice to interface with these.

> > 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...

Yes, but gcc does not _implement_ the +, -, etc. functions.  It just
compiles in calls to routines that you need to provide.

> 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.

I've had similar problems dozens of times, and can say with confidence
that it could be anything :-).

> 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?

It varies with kernel and binutils revisions.  The way it's supposed
to work is documented in the SYSV ABI.

-- 
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]