This is the mail archive of the libc-alpha@sources.redhat.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]
Other format: [Raw text]

Re: [PATCH] Implement __abs?f2 functions in soft-fp


> Date: Sat, 2 Nov 2002 20:43:30 -0700 (MST)
> From: Roger Sayle <roger@eyesopen.com>
> Cc: <libc-alpha@sources.redhat.com>
> X-OriginalArrivalTime: 03 Nov 2002 03:58:12.0858 (UTC) FILETIME=[3B010DA0:01C282ED]
> 
> 
> Hi Geoff,
> > > When compiling on a processor without an FPU, such as H8300, or
> > > even x86 with "-msoft-float -mno-ret-in-387", GCC emits code that
> > > contains calls to a suitable software floating point library.
> > > These generic routines are not part of libgcc, and on most platforms
> > > aren't part of glibc by default.
> >
> > This is not correct. If -ffree-standing is specified then GCC
> > should not assume that libm routines are available.
> 
> I think you misunderstand.  With "-msoft-float", GCC emits libcalls
> to functions such as __gtsf2 or __adddf3.  

Correct.  These functions are in libgcc.

> These functions are very
> different to those in libm.  As I've explained in a earlier post,
> -ffree-standing is one reason why GCC can't emit calls to "fabs"
> instead of "__absdf2" (i.e. it can't assume the availability of a
> standard C library, but it can assume the existance of libgcc?).

Right.  So, either libgcc should provide __absdf2, or GCC should not
emit calls to it.  In this case, if the user called fabs, GCC should
emit a call to fabs; if the user wrote 'x >= 0 ? x : -x', GCC should
emit that sequence through calls to routines like __gedf2 and __negdf2.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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