This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] libgcc variant (was: [PATCH] Optionally emit SSE ABI libm calls on x86)


Richard Guenther <rguenther@suse.de> writes:

> The missed context is that fast implementations will be a lot more
> complicated and using SSE instructions.  They are supposed to called
> for non-optimized code, too (i.e. w/o -ffast-math).  Just at the
> moment, only Intel has such library.

If I understand you correctly, you are trying to prepare gcc to
support a set of library functions which can be used with SSE floating
point parameters, and which implements math functions with correct
errno setting, etc.  The patch you sent implements a subset of that,
namely a set of library functions which can only be used with
-ffast-math.

Now the question is where those functions should live.  The obvious
place, to me, would seem to be glibc, but Ulrich has rejected that
possibility.  libgcc seems clearly wrong.  In general I don't think
these functions belong in the gcc project at all (unless and until we
decide that gcc is going to provide a C99 library).

I would recommend the following, while acknowledging that this is far
from ideal (and that a few details may be wrong):

1) Create a new project, libmsse.  The SC can decide whether it should
   go into the gcc CVS tree.  Otherwise it could be hosted on
   sourceware.org or savannah.gnu.org.

2) The gcc configure script should check for the existence of libmsse.

3) If libmsse exists on the target system, then x86 gcc with -msse is
   free to rewrite calls to C99 standard math functions to call
   libmsse functions instead (subject to -std= and
   -fno-builtin-functions, etc.).

4) As the library evolves over time to add new functions, the
   configure checks will have to evolve accordingly to decide when
   those functions may be called.

Ian


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