This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libgcc2 versus x86_64 Ada
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com, geert at gnat dot com
- Date: Mon, 26 Aug 2002 20:51:30 +0200
- Subject: libgcc2 versus x86_64 Ada
Hi,:
libgcc2 is supposed to support TImode arithmetic for 64bit targets as needed by Ada.
However it doesn't for x86_64 as it uses MIN_UNITS_PER_WORD to decide about it.
MIN_UNITS_PER_WORD is set to 4 as x86_64 compiler can crosscompile to i386.
The attached patch follows scheme used previously and introduces LIBGCC2_MIN_UNITS_PER_WORD
It applies and bootstraps both 3.2 and mainline tree. OK?
Honza
Po srp 26 20:29:49 CEST 2002 Jan Hubicka <jh@suse.cz>
* libgcc2.h (LIBGCC2_UNITS_PER_WORD): Define.
(MIN_UNITS_PER_WORD): Replace all uces by new define.
* i386.h (LIBGCC2_UNITS_PER_WORD): Define.
*** 3/gcc-3.2/gcc/libgcc2.h Wed Aug 22 16:35:22 2001
--- gcc-3.2/gcc/libgcc2.h Mon Aug 26 19:55:31 2002
*************** extern short int __get_eh_table_version
*** 51,58 ****
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
#endif
! #ifndef MIN_UNITS_PER_WORD
! #define MIN_UNITS_PER_WORD UNITS_PER_WORD
#endif
/* In the first part of this file, we are interfacing to calls generated
--- 51,66 ----
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
#endif
! #ifndef LIBGCC2_UNITS_PER_WORD
! #ifdef MIN_UNITS_PER_WORD
! #define LIBGCC2_UNITS_PER_WORD MIN_UNITS_PER_WORD
! #else
! #define LIBGCC2_UNITS_PER_WORD UNITS_PER_WORD
! #endif
! #endif
!
! #ifndef LIBGCC2_UNITS_PER_WORD
! #define LIBGCC2_UNITS_PER_WORD UNITS_PER_WORD
#endif
/* In the first part of this file, we are interfacing to calls generated
*************** typedef int QItype __attribute__ ((mod
*** 68,74 ****
typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef int HItype __attribute__ ((mode (HI)));
typedef unsigned int UHItype __attribute__ ((mode (HI)));
! #if MIN_UNITS_PER_WORD > 1
/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1 */
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
--- 76,82 ----
typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef int HItype __attribute__ ((mode (HI)));
typedef unsigned int UHItype __attribute__ ((mode (HI)));
! #if LIBGCC2_UNITS_PER_WORD > 1
/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1 */
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
*************** typedef unsigned int USItype __attribute
*** 76,82 ****
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));
! #if MIN_UNITS_PER_WORD > 4
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */
typedef int TItype __attribute__ ((mode (TI)));
typedef unsigned int UTItype __attribute__ ((mode (TI)));
--- 84,90 ----
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));
! #if LIBGCC2_UNITS_PER_WORD > 4
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */
typedef int TItype __attribute__ ((mode (TI)));
typedef unsigned int UTItype __attribute__ ((mode (TI)));
*************** typedef int word_type __attribute__ ((mo
*** 135,141 ****
#define float bogus_type
#define double bogus_type
! #if MIN_UNITS_PER_WORD > 4
#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
#define Wtype DItype
#define UWtype UDItype
--- 143,149 ----
#define float bogus_type
#define double bogus_type
! #if LIBGCC2_UNITS_PER_WORD > 4
#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
#define Wtype DItype
#define UWtype UDItype
*************** typedef int word_type __attribute__ ((mo
*** 145,152 ****
#define UDWtype UTItype
#define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b
! #elif MIN_UNITS_PER_WORD > 2 \
! || (MIN_UNITS_PER_WORD > 1 && LONG_LONG_TYPE_SIZE > 32)
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype SItype
#define UWtype USItype
--- 153,160 ----
#define UDWtype UTItype
#define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b
! #elif LIBGCC2_UNITS_PER_WORD > 2 \
! || (LIBGCC2_UNITS_PER_WORD > 1 && LONG_LONG_TYPE_SIZE > 32)
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype SItype
#define UWtype USItype
*************** typedef int word_type __attribute__ ((mo
*** 156,162 ****
#define UDWtype UDItype
#define __NW(a,b) __ ## a ## si ## b
#define __NDW(a,b) __ ## a ## di ## b
! #elif MIN_UNITS_PER_WORD > 1
#define W_TYPE_SIZE (2 * BITS_PER_UNIT)
#define Wtype HItype
#define UWtype UHItype
--- 164,170 ----
#define UDWtype UDItype
#define __NW(a,b) __ ## a ## si ## b
#define __NDW(a,b) __ ## a ## di ## b
! #elif LIBGCC2_UNITS_PER_WORD > 1
#define W_TYPE_SIZE (2 * BITS_PER_UNIT)
#define Wtype HItype
#define UWtype UHItype
*** 3/gcc-3.2/gcc/config/i386/i386.h Mon Jul 15 08:54:36 2002
--- gcc-3.2/gcc/config/i386/i386.h Mon Aug 26 19:39:56 2002
*************** extern int ix86_arch;
*** 734,739 ****
--- 734,744 ----
/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4)
#define MIN_UNITS_PER_WORD 4
+ #ifdef __x86_64__
+ #define LIBGCC2_UNITS_PER_WORD 8
+ #else
+ #define LIBGCC2_UNITS_PER_WORD 4
+ #endif
/* Width in bits of a pointer.
See also the macro `Pmode' defined below. */