This is the mail archive of the gcc-patches@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]

[cft][avr/h8] reorg libgcc for double == float


> Richard Henderson <rth@redhat.com>
> My recent change to complex numbers highlighted the fact that some
> targets don't actually support a separate DFmode.  Or perhaps they
> really do, but just don't expose this type to C?  And even if they
> do support DFmode, but don't expose it, it means that at least one
> algorithm inside libgcc2 is broken.
> 
> So I've rearranged things such that if there is not a C type
> associated with DFmode, we will not do *anything* in DFmode.
> 
> This complies on both avr and h8300, but I've not done any testing.

For consistency, might it be possible to also similarly conditionally
define the remaining LIBGCC2 supported types and corresponding modes?

 #ifndef LIBGCC2_CHAR_TYPE_SIZE
 #define LIBGCC2_CHAR_TYPE_SIZE CHAR_TYPE_SIZE
 #endif
 #ifndef LIBGCC2_SHORT_TYPE_SIZE
 #define LIBGCC2_SHORT_TYPE_SIZE SHORT_TYPE_SIZE
 #endif
 #ifndef LIBGCC2_INT_TYPE_SIZE
 #define LIBGCC2_INT_TYPE_SIZE INT_TYPE_SIZE
 #endif
 #ifndef LIBGCC2_LONG_TYPE_SIZE
 #define LIBGCC2_LONG_TYPE_SIZE LONG_TYPE_SIZE
 #endif
 #ifndef LIBGCC2_LONG_LONG_TYPE_SIZE
 #define LIBGCC2_LONG_LONG_TYPE_SIZE LONG_LONG_TYPE_SIZE
 #endif
 #ifndef LIBGCC2_FLOAT_TYPE_SIZE
 #define LIBGCC2_FLOAT_TYPE_SIZE FLOAT_TYPE_SIZE
 #endif

  #if LIBGCC2_CHAR_TYPE_SIZE == 8 || LIBGCC2_SHORT_TYPE_SIZE == 8
  #define HAVE_QIMODE
  typedef int  QIType    __attribute__ ((mode (QI)));
  #endif
  #if LIBGCC2_SHORT_TYPE_SIZE == 16 || LIBGCC2_INT_TYPE_SIZE == 16
  #define HAVE_HIMODE
  typedef int  HIType    __attribute__ ((mode (HI)));
  #endif
  #if LIBGCC2_INT_TYPE_SIZE == 32 || LIBGCC2_LONG_TYPE_SIZE == 32
  #define HAVE_SIMODE
  typedef int  SIType    __attribute__ ((mode (SI)));
  #endif
  #if LIBGCC2_LONG_TYPE_SIZE == 64 || LIBGCC2_LONG_LONG_TYPE_SIZE == 64
  #define HAVE_DIMODE
  typedef int  DIType    __attribute__ ((mode (DI)));
  #endif
  #if LIBGCC2_FLOAT_TYPE_SIZE == 32 || LIBGCC2_DOUBLE_TYPE_SIZE == 32
  #define HAVE_SFMODE
  typedef          float SFType  __attribute__ ((mode (SF)));
  typedef _Complex float SCtype  __attribute__ ((mode (SC)));
  #endif

Thereby enabling all the word-size derived type/mode stuff to disappear, by
replacing it with clear type and mode consistent conditional definitions; as
you've done for DF/DC types?



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