On Mar 19, 2007, at 05:44, François-Xavier Coudert wrote:
I have the three following questions, probably best directed to
middle-end experts and Ada maintainers:

 * How can I know the longest float type? My first patch uses the
long_double_type_node unconditionally, but it surely isn't a generic
solution
In particular, that has the problem of long double often being a
type that is implemented in software only. For Ada, we use
WIDEST_HARDWARE_FP_SIZE if defined, or LONG_DOUBLE_TYPE_SIZE
otherwise.

Using the widest hardware type will at least guarantee that
the hardware doesn't implicitly use a wider type. However, it's
unnecessarily conservative: on x86 with -mfpmath=sse for example,
we could use any type without problems. Similarly, on most
architectures other than x86 and PPC, extra precision is never used.

 * How can I determine if a given type may have extra precision?
We should somehow add a new predicate that would give this information
per type. Something like FP_TYPE_ROUNDS_P that is true for any type
that always rounds results might be useful. The predicate should
probably default to TRUE, and be overridden for single and double
precision types on non-SSE x86 and x86-64, as well as single precision
types for some PPC configurations.

 * What is this padding code doing, and is it necessary?
The Ada front end sometimes adds padding to a type if an explicit
alignment is requested (through use of attributes in the source code)
that is higher than the default. As the FIXME comment indicates,
this should be going away. Don't worry about it for Fortran.

  -Geert

Reply via email to