RFC: Patch to libgcc2.h
Jason Merrill
jason@redhat.com
Thu Jun 15 09:25:00 GMT 2000
Jakub's December 27 patch to libgcc2.c broke a lot of libgcc bits for
16-bit targets; the #defines to change, say, the definition of
__floatdisf to actually define __floatsisf produced conflicts with
better versions from libgcc1 and fp-bit.c. In the case I've been
looking at, that definition was used rather than the one from
fp-bit.c, and so any code that needed to use __floatsisf ended up
going into an infinite recursion.
It's wrong to assume that things just scale down to smaller word
sizes. Or perhaps it's right, but libgcc1 (in all its various
incarnations) and fp-bit.c and the compiler optabs need to be adjusted
as well.
This patch returns us to the state of affairs from before
Jakub's patch, namely that 16-bit targets again get definitions of
dimode functions that they'll never use, but gcc seems perfectly happy
to generate code for them, at least for the h8300 (which, admittedly,
is not a pure 16-bit part).
Any other thoughts as to how to solve this problem?
2000-06-14 Jason Merrill <jason@redhat.com>
* libgcc2.h: Lose special handling of 8 and 16-bit targets.
Index: libgcc2.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/libgcc2.h,v
retrieving revision 1.3
diff -c -p -r1.3 libgcc2.h
*** libgcc2.h 2000/05/23 17:25:39 1.3
--- libgcc2.h 2000/06/15 16:08:21
*************** typedef int QItype __attribute__ ((mod
*** 84,95 ****
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)));
- #if MIN_UNITS_PER_WORD > 2
- /* 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
--- 84,91 ----
*************** typedef unsigned int UDItype __attribute
*** 97,104 ****
typedef int TItype __attribute__ ((mode (TI)));
typedef unsigned int UTItype __attribute__ ((mode (TI)));
#endif
- #endif
- #endif
#if BITS_PER_UNIT == 8
--- 93,98 ----
*************** typedef int word_type __attribute__ ((mo
*** 161,167 ****
#define UDWtype UTItype
#define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b
! #elif MIN_UNITS_PER_WORD > 2
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype SItype
#define UWtype USItype
--- 155,161 ----
#define UDWtype UTItype
#define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b
! #else
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype SItype
#define UWtype USItype
*************** typedef int word_type __attribute__ ((mo
*** 171,196 ****
#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
- #define HWtype HItype
- #define UHWtype UHItype
- #define DWtype SItype
- #define UDWtype USItype
- #define __NW(a,b) __ ## a ## hi ## b
- #define __NDW(a,b) __ ## a ## si ## b
- #else
- #define W_TYPE_SIZE BITS_PER_UNIT
- #define Wtype QItype
- #define UWtype UQItype
- #define HWtype QItype
- #define UHWtype UQItype
- #define DWtype HItype
- #define UDWtype UHItype
- #define __NW(a,b) __ ## a ## qi ## b
- #define __NDW(a,b) __ ## a ## hi ## b
#endif
#define __muldi3 __NDW(mul,3)
--- 165,170 ----
More information about the Gcc-patches
mailing list