[PATCH] define WIDEST_HARDWARE_FP_SIZE on mips

Richard Sandiford rdsandiford@googlemail.com
Wed Mar 4 20:24:00 GMT 2009


Laurent GUERBY <laurent@guerby.net> writes:
> 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.

Sorry, but no.  What I said in the original review still applies:

  http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00553.html

In other words:

  (a) this macro is used for two things:

      - an optimisation decision in libgcc2.c
      - a language conformance and ABI decision in ada/.

  (b) the natural definition of the macro is:

        #define WIDEST_HARDWARE_FP_SIZE \
          (UNITS_PER_HWFPVALUE * BITS_PER_UNIT)

      but this is presumably _not_ correct for Ada.  For -msingle-float,
      it would make Long_Long_Float (WIDEST_HARDWARE_FP_SIZE) smaller
      than Long_Float (DOUBLE_TYPE_SIZE), which certainly isn't right!
      And I shudder to think what would happen to Ada if we set
      WIDEST_HARDWARE_FP_SIZE to 0 for soft-float targets.

My point in that mesasge is that we're having to set WIDEST_HARDWARE_FP_SIZE
to a non-obvious value because it is argued that doing so is correct for Ada.
But IMO, if Ada's get_target_float_size, get_target_double_size and
get_target_long_double_size need to pick something different from
the C "float", "double" and "long double" types, they should have
specific macros to do that.

And I don't think we should commit anything until we know what the
correct behaviour for -msingle-float and -msoft-float is.  I'm not
sure anyone has said conclusively what they think that should be.
Geert said:

  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, [...]

so how does that apply to systems that don't have hardware floating point?

(I'm somewhat surprised no "as-if" rule applies here.  Is software FP,
or running programs under a system emulator or application translator,
really not allowed?)

Richard



More information about the Gcc-patches mailing list