This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


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

Re: i386/soft-float




Ralf Corsepius wrote:
> 
> Hi,
> 
> Building newlib currently unconditionally inserts i386-fpu
> instructions into libc, which prevents using newlib for i386's w/o
> fpu (eg. if using gcc -msoft-float -mno-fpu-ret-in-387).
> 
> To work around this issue, the patch below disables the parts of
> libc/machine/i386 which apply floating point instructions if
> _SOFT_FLOAT is defined.

There is a corresponding patch to gcc that turns on
multilib'ing for i386 embedded targets like i386-coff,
i386-elf, and i386-rtems.  The 1st version of that patch 
has already been submitted to gcc.  I need to submit
an update.

 
> Regards
>         Ralf
> 
> --
> Ralf Corsepius
> Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung
> (FAW)
> Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
> mailto:corsepiu@faw.uni-ulm.de           FAX: +49/731/501-999
> http://www.faw.uni-ulm.de
> 
>   ------------------------------------------------------------------------
> 2001-02-22      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
> 
>         * libc/machine/i386/f_atan2.S: Do not build FPU-asm if _SOFT_FLOAT
>         is defined.
>         * libc/machine/i386/f_atan2f.S: Ditto.
>         * libc/machine/i386/f_exp.c: Ditto.
>         * libc/machine/i386/f_expf.c: Ditto.
>         * libc/machine/i386/f_frexp.S: Ditto.
>         * libc/machine/i386/f_frexpf.S: Ditto.
>         * libc/machine/i386/f_ldexp.S: Ditto.
>         * libc/machine/i386/f_ldexpf.S: Ditto.
>         * libc/machine/i386/f_log.S: Ditto.
>         * libc/machine/i386/f_log10.S: Ditto.
>         * libc/machine/i386/f_log10f.S: Ditto.
>         * libc/machine/i386/f_logf.S: Ditto.
>         * libc/machine/i386/f_pow.c: Ditto.
>         * libc/machine/i386/f_powf.c: Ditto.
>         * libc/machine/i386/f_tan.S: Ditto.
>         * libc/machine/i386/f_tanf.S: Ditto.
> 
>   ------------------------------------------------------------------------
> Index: newlib/libc/machine/i386/f_atan2.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_atan2.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_atan2.S
> --- f_atan2.S   2000/08/28 17:50:06     1.2
> +++ f_atan2.S   2001/02/21 22:26:15
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of atan2 using Intel float instructions.
> 
> @@ -31,3 +33,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_atan2f.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_atan2f.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_atan2f.S
> --- f_atan2f.S  2000/08/28 17:50:06     1.2
> +++ f_atan2f.S  2001/02/21 22:26:15
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of atan2f using Intel float instructions.
> 
> @@ -31,3 +33,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_exp.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_exp.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 f_exp.c
> --- f_exp.c     2000/02/17 19:39:46     1.1.1.1
> +++ f_exp.c     2001/02/21 22:26:15
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of exp using Intel float instructions.
> 
> @@ -41,5 +43,5 @@
> 
>     return x;
>  }
> -
> 
> +#endif
> Index: newlib/libc/machine/i386/f_expf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_expf.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 f_expf.c
> --- f_expf.c    2000/02/17 19:39:46     1.1.1.1
> +++ f_expf.c    2001/02/21 22:26:15
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of exp using Intel float instructions.
> 
> @@ -41,5 +43,5 @@
> 
>     return x;
>  }
> -
> 
> +#endif
> Index: newlib/libc/machine/i386/f_frexp.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_frexp.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_frexp.S
> --- f_frexp.S   2000/08/28 17:50:06     1.2
> +++ f_frexp.S   2001/02/21 22:26:15
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of frexp using Intel float instructions.
> 
> @@ -42,3 +44,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_frexpf.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_frexpf.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_frexpf.S
> --- f_frexpf.S  2000/08/28 17:50:06     1.2
> +++ f_frexpf.S  2001/02/21 22:26:15
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of frexpf using Intel float instructions.
> 
> @@ -42,3 +44,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_ldexp.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_ldexp.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_ldexp.S
> --- f_ldexp.S   2000/08/28 17:50:06     1.2
> +++ f_ldexp.S   2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of ldexp using Intel float instructions.
> 
> @@ -32,3 +34,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_ldexpf.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_ldexpf.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_ldexpf.S
> --- f_ldexpf.S  2000/08/28 17:50:06     1.2
> +++ f_ldexpf.S  2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of ldexpf using Intel float instructions.
> 
> @@ -32,3 +34,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_log.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_log.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_log.S
> --- f_log.S     2000/08/28 17:50:06     1.2
> +++ f_log.S     2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of log using Intel float instructions.
> 
> @@ -34,3 +36,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_log10.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_log10.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_log10.S
> --- f_log10.S   2000/08/28 17:50:06     1.2
> +++ f_log10.S   2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of log10 using Intel float instructions.
> 
> @@ -34,3 +36,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_log10f.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_log10f.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_log10f.S
> --- f_log10f.S  2000/08/28 17:50:06     1.2
> +++ f_log10f.S  2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of logf using Intel float instructions.
> 
> @@ -34,3 +36,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_logf.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_logf.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_logf.S
> --- f_logf.S    2000/08/28 17:50:06     1.2
> +++ f_logf.S    2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of logf using Intel float instructions.
> 
> @@ -34,3 +36,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_pow.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_pow.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 f_pow.c
> --- f_pow.c     2000/02/17 19:39:46     1.1.1.1
> +++ f_pow.c     2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of pow using Intel float instructions.
> 
> @@ -42,3 +44,4 @@
>      return pow (x,y);
>  }
> 
> +#endif
> Index: newlib/libc/machine/i386/f_powf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_powf.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 f_powf.c
> --- f_powf.c    2000/02/17 19:39:46     1.1.1.1
> +++ f_powf.c    2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of pow using Intel float instructions.
> 
> @@ -42,3 +44,4 @@
>      return powf (x,y);
>  }
> 
> +#endif
> Index: newlib/libc/machine/i386/f_tan.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_tan.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_tan.S
> --- f_tan.S     2000/08/28 17:50:06     1.2
> +++ f_tan.S     2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of tan using Intel float instructions.
> 
> @@ -31,3 +33,5 @@
> 
>         leave
>         ret
> +
> +#endif
> Index: newlib/libc/machine/i386/f_tanf.S
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/i386/f_tanf.S,v
> retrieving revision 1.2
> diff -u -r1.2 f_tanf.S
> --- f_tanf.S    2000/08/28 17:50:06     1.2
> +++ f_tanf.S    2001/02/21 22:26:16
> @@ -8,6 +8,8 @@
>   * ====================================================
>   */
> 
> +#if !defined(_SOFT_FLOAT)
> +
>  /*
>  Fast version of tanf using Intel float instructions.
> 
> @@ -31,3 +33,5 @@
> 
>         leave
>         ret
> +
> +#endif

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


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