[gnu.gcc] math.h allowing for fast inline code generation

roberto@cernvax.UUCP (roberto bagnara) (08/13/89)

I'm looking for a <math.h> include file to allow GCC producing (fast)
M68881 inline code for all the mathematical functions. I think it
should be structured in a way like :

#if defined (__GNUC__) && defined (__HAVE_68881__)

/* GCC mathematical functions using M68881. */

#define sin(x) \
({ double __value, __arg = (x); \
   __asm("fsin.x %1,%0": "=f" (__value): "f" (__arg));\
   __value; })
...
...
#else

/* Standard math.h definitions. */

extern double sin();
...
...
#endif

so to be safely included by any program/compiler/system combinations.
Did anyone write such an include file ? Are there any possible problems
in doing that ?
I'll appreciate very much receiving it, if existing.
Thank you for your time
                           Roberto Bagnara