This is the mail archive of the gcc@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: IEEE 128-bit floating point support for PowerPC RTEMS


On Tue, Jan 24, 2017 at 11:21:27AM +0100, Sebastian Huber wrote:
> Hello,
> 
> some time ago IEEE 128-bit floating point support for PowerPC was
> added to GCC:
> 
> https://gcc.gnu.org/wiki/Ieee128PowerPC
> 
> I noticed some issues for RTEMS in this area. Firstly, RTEMS had no
> __powerpc__ builtin define, so some source files were effectively
> disabled, e.g. ibm-ldouble.c. With __powerpc__ defined, the
> ibm-ldouble.c didn't compile due to:
> 
> In file included from /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:374:0:
> /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/quad.h:72:1:
> error: unable to emulate 'TF'
>  typedef float TFtype __attribute__ ((mode (TF)));
>  ^~~~~~~
> 
> I added
> 
> #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
> 
> #undef TARGET_IEEEQUAD
> #define TARGET_IEEEQUAD 1
> 
> This fixed the problem above and changes the long double type from 8
> bytes to 16 bytes.
> 
> The new compiler defines now (powerpc-rtems target):
> 
> #define __LONG_DOUBLE_128__ 1
> #define __LONGDOUBLE128 1
> #define __LONG_DOUBLE_IEEE128__ 1
> 
> However, the libgcc multilib build fails due to several ICEs. See
> attached errors.log.
> 
> Is this supposed to work for 32-bit PowerPC. Did I miss some magic
> configuration switch?

Please check this patch:
https://gcc.gnu.org/ml/gcc-patches/2017-02/msg00861.html

It has fixes for building on a 32-bit systems and non-VSX systems.

Now, when I did the initial float128 work, as far as I could tell, long double
was not enabled to be 128-bits on RTEMS.

If it is now enabled, there may be gotchas, since RTEMS would be the only
PowerPC system to use 128-bit floating point and use IEEE 128-bit instead of
IBM double-double that the other PowerPC systems currently use.

So it may be your call whether you want to enable it, and get it to work, or
default back to long double == double.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797


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