Commit dabb3f04 by Richard Henderson Committed by Richard Henderson

libgcc2.c (__ffsdi2, [...]): Change return type to "int".

        * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
        __popcountsi2, __popcountdi2, __paritysi2, __paritydi2): Change
        return type to "int".  Shuffle declarations and undef int trap.
        * libgcc2.h: Remove their declarations.
        * optabs.c (expand_unop): Force outmode to int for bitops.

From-SVN: r62353
parent d074ed7c
2003-02-03 Richard Henderson <rth@redhat.com>
* libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2,
__popcountsi2, __popcountdi2, __paritysi2, __paritydi2): Change
return type to "int". Shuffle declarations and undef int trap.
* libgcc2.h: Remove their declarations.
* optabs.c (expand_unop): Force outmode to int for bitops.
2003-02-03 Bob Wilson <bob.wilson@acm.org> 2003-02-03 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (order_regs_for_local_alloc): Order the * config/xtensa/xtensa.c (order_regs_for_local_alloc): Order the
......
...@@ -341,7 +341,9 @@ __ashrdi3 (DWtype u, word_type b) ...@@ -341,7 +341,9 @@ __ashrdi3 (DWtype u, word_type b)
#endif #endif
#ifdef L_ffsdi2 #ifdef L_ffsdi2
Wtype #undef int
extern int __ffsdi2 (DWtype u);
int
__ffsdi2 (DWtype u) __ffsdi2 (DWtype u)
{ {
DWunion uu; DWunion uu;
...@@ -520,7 +522,9 @@ const UQItype __clz_tab[] = ...@@ -520,7 +522,9 @@ const UQItype __clz_tab[] =
#endif #endif
#ifdef L_clzsi2 #ifdef L_clzsi2
Wtype #undef int
extern int __clzsi2 (USItype x);
int
__clzsi2 (USItype x) __clzsi2 (USItype x)
{ {
UWtype w = x; UWtype w = x;
...@@ -534,7 +538,9 @@ __clzsi2 (USItype x) ...@@ -534,7 +538,9 @@ __clzsi2 (USItype x)
#endif #endif
#ifdef L_clzdi2 #ifdef L_clzdi2
Wtype #undef int
extern int __clzdi2 (UDItype x);
int
__clzdi2 (UDItype x) __clzdi2 (UDItype x)
{ {
UWtype word; UWtype word;
...@@ -559,7 +565,9 @@ __clzdi2 (UDItype x) ...@@ -559,7 +565,9 @@ __clzdi2 (UDItype x)
#endif #endif
#ifdef L_ctzsi2 #ifdef L_ctzsi2
Wtype #undef int
extern int __ctzsi2 (USItype x);
int
__ctzsi2 (USItype x) __ctzsi2 (USItype x)
{ {
Wtype ret; Wtype ret;
...@@ -571,7 +579,9 @@ __ctzsi2 (USItype x) ...@@ -571,7 +579,9 @@ __ctzsi2 (USItype x)
#endif #endif
#ifdef L_ctzdi2 #ifdef L_ctzdi2
Wtype #undef int
extern int __ctzdi2 (UDItype x);
int
__ctzdi2 (UDItype x) __ctzdi2 (UDItype x)
{ {
UWtype word; UWtype word;
...@@ -615,7 +625,9 @@ const UQItype __popcount_tab[] = ...@@ -615,7 +625,9 @@ const UQItype __popcount_tab[] =
#endif #endif
#ifdef L_popcountsi2 #ifdef L_popcountsi2
Wtype #undef int
extern int __popcountsi2 (USItype x);
int
__popcountsi2 (USItype x) __popcountsi2 (USItype x)
{ {
return __popcount_tab[(x >> 0) & 0xff] return __popcount_tab[(x >> 0) & 0xff]
...@@ -626,7 +638,9 @@ __popcountsi2 (USItype x) ...@@ -626,7 +638,9 @@ __popcountsi2 (USItype x)
#endif #endif
#ifdef L_popcountdi2 #ifdef L_popcountdi2
Wtype #undef int
extern int __popcountdi2 (UDItype x);
int
__popcountdi2 (UDItype x) __popcountdi2 (UDItype x)
{ {
return __popcount_tab[(x >> 0) & 0xff] return __popcount_tab[(x >> 0) & 0xff]
...@@ -641,7 +655,9 @@ __popcountdi2 (UDItype x) ...@@ -641,7 +655,9 @@ __popcountdi2 (UDItype x)
#endif #endif
#ifdef L_paritysi2 #ifdef L_paritysi2
Wtype #undef int
extern int __paritysi2 (USItype x);
int
__paritysi2 (USItype x) __paritysi2 (USItype x)
{ {
UWtype nx = x; UWtype nx = x;
...@@ -655,7 +671,9 @@ __paritysi2 (USItype x) ...@@ -655,7 +671,9 @@ __paritysi2 (USItype x)
#endif #endif
#ifdef L_paritydi2 #ifdef L_paritydi2
Wtype #undef int
extern int __paritydi2 (UDItype x);
int
__paritydi2 (UDItype x) __paritydi2 (UDItype x)
{ {
UWtype nx = x ^ (x >> 32); UWtype nx = x ^ (x >> 32);
......
...@@ -223,31 +223,19 @@ extern DWtype __negdi2 (DWtype); ...@@ -223,31 +223,19 @@ extern DWtype __negdi2 (DWtype);
extern DWtype __lshrdi3 (DWtype, word_type); extern DWtype __lshrdi3 (DWtype, word_type);
extern DWtype __ashldi3 (DWtype, word_type); extern DWtype __ashldi3 (DWtype, word_type);
extern DWtype __ashrdi3 (DWtype, word_type); extern DWtype __ashrdi3 (DWtype, word_type);
extern Wtype __ffsdi2 (DWtype);
/* ??? Ought to get these named properly for DSPs. */ /* ??? Ought to get these named properly for DSPs. */
#if BITS_PER_UNIT == 8 && MIN_UNITS_PER_WORD >= 4 #if BITS_PER_UNIT != 8 || MIN_UNITS_PER_WORD < 4
extern Wtype __clzsi2 (USItype); # undef L_clzsi2
extern Wtype __ctzsi2 (USItype); # undef L_ctzsi2
extern Wtype __popcountsi2 (USItype x); # undef L_popcountsi2
extern Wtype __paritysi2 (USItype x); # undef L_paritysi2
#else # if LONG_LONG_TYPE_SIZE <= 32
#undef L_clzsi2 # undef L_clzdi2
#undef L_ctzsi2 # undef L_ctzdi2
#undef L_popcountsi2 # undef L_popcountdi2
#undef L_paritysi2 # undef L_paritydi2
#endif # endif
#if BITS_PER_UNIT == 8 && MIN_UNITS_PER_WORD >= 4 && LONG_LONG_TYPE_SIZE > 32
extern Wtype __clzdi2 (UDItype);
extern Wtype __ctzdi2 (UDItype);
extern Wtype __popcountdi2 (UDItype x);
extern Wtype __paritydi2 (UDItype x);
#else
#undef L_clzdi2
#undef L_ctzdi2
#undef L_popcountdi2
#undef L_paritydi2
#endif #endif
/* __udiv_w_sdiv is static inline when building other libgcc2 portions. */ /* __udiv_w_sdiv is static inline when building other libgcc2 portions. */
......
...@@ -2675,7 +2675,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp) ...@@ -2675,7 +2675,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
have them return something that isn't a double-word. */ have them return something that isn't a double-word. */
if (unoptab == ffs_optab || unoptab == clz_optab || unoptab == ctz_optab if (unoptab == ffs_optab || unoptab == clz_optab || unoptab == ctz_optab
|| unoptab == popcount_optab || unoptab == parity_optab) || unoptab == popcount_optab || unoptab == parity_optab)
outmode = word_mode; outmode = TYPE_MODE (integer_type_node);
start_sequence (); start_sequence ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment