This is the mail archive of the libc-alpha@sourceware.org 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]

[Fwd: Status of long double soft-fp support for powerpc32]


David has explained the error of my ways. The __addtf3 etc names are
SYSV ABI mandated for IEEE soft_fp. So I should not be overriding these
implementations with IBM extended. David has explained that the
__gcc_gadd etc names are specifically choosen to avoid conflict with the
SYSV ABI and the complete implementation is in libgcc.

Also the _q_add etc implementations are for powerpc hard-float IEEE-128,
as the powerpc hardware does not support a 128-bit format. So I should
leave this alone as well, but perhaps modify the Makefiles so they don't
get built for linux.

This simplies things, back to work.
--- Begin Message ---
I am making progress on fixing soft-fp for powerpc32. I am using a patch
from David that provides  code gen for -msoft-float -mlong-double-128
and I have implemented the IBM extented varients of addtf3, divtf3,
eqtf2, extenddftf2, extendsftf2, getf2, letf2, multf3, negtf2, sqrttf2,
subtf3, unordtf2. I also found come comflicts with the existing
ldbl-128ibm implementation, that required some minor changes (I'll be
submitting patches for these soon). With this work I am able to build
and run make check.

This raised a few questions.  Where should this code go in the hierarcy?
and which naming  (/libc soft-fp or gcc) should  we use?

There are existing ieee-128 implementation in ./soft-fp and again in
./sysdeps/powerpc/soft-fp. For example there ./soft-fp/addtf3.c
implementing __addtf3() and ./sysdeps/powerpc/soft-fp /q_add.c
implementing q_add(). These are effectively the same except for the type
(one uses TFtype, the other long double). My implementation is currently
in ./ports/sysdeps/unix/sysv/linux/powerpc/nofpu/addtf3.c.

Clearly for powerpc32 linux implementations I need to override the IEEE
quad implementation. I believe that there are some other (not linux)
powerpc32 implementations that still use IEEE.  But so far my soft-fp
IBM extended implementations are generic. So should we add a
./soft-fp/ldbl-128ibm directory? In trunk or ports? Should the existing
soft-fp quad implementation be moved to ./soft-fp/ldbl-128? These
changes would require some carefully placed Implies files to get the
desired soft-fp implementation.

At the moment we are not actually using the quad soft-fp implements from
glibc. GCC is already calling out of line for most IBM extented
operations. For example gcc already generates calls to __gcc_qadd,
__gcc_qmul etc for the hardware double implementation of IBM extended.
With the current patch this continues with generated libm code using the
implementations of __gcc_g??? implementations from libgcc. The same gcc
uses the libc implementations (__adddf3, __muldf3, etc) for soft-fp double.

Not sure if this a problem, but we should decide if this is the best
approach before we release this code. One immediate problem is that I am
seeing (only) ~200 failures in test-ldouble and some debuging is
required. For me this would be easier if the code used the glibc/soft-fp
implementation. As an experiment I tried using strong_alias to override
override the gcc_quad implementation with the libc/soft-fp code, but
this just resulted in the link failure below.

strong_alias (__addtf3, __gcc_qadd)
strong_alias (__subtf3, __gcc_qsub)
strong_alias (__multf3, __gcc_qmul)
strong_alias (__divtf3, __gcc_qdiv)

strong_alias (__extendsftf2, __gcc_stoq)
strong_alias (__extenddftf2, __gcc_dtoq)

strong_alias (__eqtf2, __gcc_qeq)
strong_alias (__eqtf2, __gcc_qne)
strong_alias (__letf2, __gcc_qle)
strong_alias (__letf2, __gcc_qlt)
strong_alias (__getf2, __gcc_qge)
strong_alias (__getf2, __gcc_qqt)

/opt/biarch/gcc41-softld/lib/gcc/powerpc64-linux/4.1.1/nof/libgcc.a(darwin-ldouble.o):
In function `__gcc_qdiv':
/home/sjmunroe/toolchain/src/gcc/gcc/config/rs6000/darwin-ldouble.c:183:
multiple definition of `__gcc_qdiv'
/home/sjmunroe/work/build32-nofpu/libc_pic.os:../ports/sysdeps/unix/sysv/linux/powerpc/nofpu/divtf3.c:51:
first defined here
/opt/biarch/gcc41-softld/bin/ld: Warning: size of symbol `__gcc_qdiv'
changed from 696 in /home/sjmunroe/work/build32-nofpu/libc_pic.os to 716
in
/opt/biarch/gcc41-softld/lib/gcc/powerpc64-linux/4.1.1/nof/libgcc.a(darwin-ldouble.o)




--- End Message ---

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