[PATCH] define WIDEST_HARDWARE_FP_SIZE on mips
Laurent GUERBY
laurent@guerby.net
Tue Mar 3 09:16:00 GMT 2009
Hi,
So for now the best way would be to define WIDEST_HARDWARE_FP_SIZE
on mips like it's done on other platforms? That is
commit Olivier original patch?
Richard would such a patch be approved? I'll do the testing.
Laurent
2007-10-08 Olivier Hainque <hainque@adacore.com>
* config/mips/mips.h (WIDEST_HARDWARE_FP_SIZE): Define.
Index: config/mips/mips.h
===================================================================
*** config/mips/mips.h (revision 128810)
--- config/mips/mips.h (working copy)
*************** extern enum mips_code_readable_setting m
*** 1178,1183 ****
--- 1178,1184 ----
/* For MIPS, width of a floating point register. */
#define UNITS_PER_FPREG (TARGET_FLOAT64 ? 8 : 4)
+ #define WIDEST_HARDWARE_FP_SIZE 64
/* The number of consecutive floating-point registers needed to store the
largest format supported by the FPU. */
gcc/config$ grep WIDEST_HARDWARE_FP_SIZE */*
alpha/alpha.h:#define WIDEST_HARDWARE_FP_SIZE 64
i386/i386.h:#define WIDEST_HARDWARE_FP_SIZE LONG_DOUBLE_TYPE_SIZE
pa/pa.h:#define WIDEST_HARDWARE_FP_SIZE 64
rs6000/rs6000.h:#define WIDEST_HARDWARE_FP_SIZE 64
s390/s390.h:#define WIDEST_HARDWARE_FP_SIZE 64
sparc/sparc.h:#define WIDEST_HARDWARE_FP_SIZE 64
gcc/config$ grep LONG_DOUBLE_TYPE_SIZE i386/*
i386/i386.h:#define LONG_DOUBLE_TYPE_SIZE 80
i386/i386.h:#define WIDEST_HARDWARE_FP_SIZE LONG_DOUBLE_TYPE_SIZE
On Tue, 2009-03-03 at 00:16 -0500, Geert Bosch wrote:
> On Mar 2, 2009, at 16:46, Laurent GUERBY wrote:
> > I'm waiting a bit to see if AdaCore people did find a solution, if not
> > I'll investigate. As discussed in the old thread we don't really
> > want 128 bit Long_Long_Float anyway if not supported in hardware.
> >
> > For reference, below ACATS log extract of the failing tests,
> > some of it is self-explanatory. To me most of the stuff seem
> > to be that 128 bit float software routines might just not be accurate
> > enough.
>
> The Ada standard requires support for the widest hardware floating point
> format provided by the hardware. This type can be accessed by declaring
> your type as "type My_Float is digits System.Max_Digits". Various
> routines
> for printing and type conversions use this type as well.
>
> Ada does not allow a "type My_Float is digits X" where X >
> System.Max_Digits,
> except in some special cases where the type would provide more
> accuracy but
> a restricted range. For that reason, we can't easily support a 128-bit
> Long_Long_Float.
>
> The way forward would be to dynamically build a table of all available
> types,
> find out essential properties (basic arithmetic supported in hardware
> or not,
> implicit extra precision (a la x87) or not, fused multiply-add or not)
> and
> use that for type selection. Some work in this direction has been done
> in Gigi,
> but to add support for all parts of the compiler, especially the
> required
> exact static (compile-time) evaluation of expressions and such, is quite
> hard and involves a serious chunk of development work.
>
> So, even if "long long double" is 128 bits, Long_Long_Float not be wider
> than WIDEST_HARDWARE_FP_SIZE.
> -Geert
>
More information about the Gcc-patches
mailing list