On Mon, 11 Sep 2006, Edmar Wienskoski wrote:
> There are 2 issues here:
> First, It is libgcc that is generating undefined references to __*tf*
> functions. If gcc can provide them with "softfp_float_modes := sf df tf", I
> think is reasonable to do that. For completeness sake you can do as you
> suggested: change softfp_extensions and softfp_truncations, but they are not
> absolutely necessary.
softfp_extensions and softfp_truncations are needed for conversions
between float/double and long double.
> Second, is the long double ABI problem. In the past gcc always generated
> function calls to _q_* functions. (Per ABI Chapter 5)
> For this code:
> long double foo (long double x, long double y){ return x + y; }
> gcc-4.0, target powerpc-eabise and
> gcc-4.0, target powerpc-*-linux-gnuspe with -mlong-double-128 option
> both generates a call to _q_add.
> The same code with gcc-4.2, both targets generates a call to __gcc_qadd.
__gcc_* are for IBM long double. _q_* are for IEEE long double. __*tf*
are for an unspecified version of long double *where there aren't
ABI-specified functions*; generating calls to them on PowerPC Linux is
generally a GCC bug. For IEEE long double, it's definitely better to use
_q_* from glibc since they support rounding modes and exceptions. (This
in general is an advantage of using soft-fp code in glibc where the glibc
version is known to have a good copy, but doing it in general - for float
and double - requires extra configure support to be implemented in GCC,
and some changes in glibc.)
I personally prefer IEEE long double to IBM long double, but in the
context of the existing family of PowerPC ABIs currently supported by
glibc and GCC I think trying to use it on Linux is a mistake; if used it
should have a separate family of target triplets whose names explicitly
indicate a new ABI.
--
Joseph S. Myers
[EMAIL PROTECTED]