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]

[patch] libgcc2.c: Enable clzsi2 and friends even whenMIN_UNITS_PER_WORD < 4.


Hi,

Attached is a patch to enable the generation of clzsi2 and friends
even when MIN_UNITS_PER_WORD < 4.

Without this, the use of __builtin_clz() causes a "undefined
reference" at the link time on H8.  This is because clzsi2, etc, are
not disabled in libgcc2.

The patch enables the generation.  One problem so far is that optabs.c
does not widen mode properly when clz is done via a libcall, but am I
in the right direction?  I'd like to know if it's OK to simply remove
"MIN_UNITS_PER_WORD < 4".

Thanks,

Kazu Hirata

2003-02-06  Kazu Hirata  <kazu@cs.umass.edu>

	* libgcc2.h: Don't undef L_{clz,ctz,popcount,parity}si2 just
	because MIN_UNITS_PER_WORD < 4.

Index: libgcc2.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/libgcc2.h,v
retrieving revision 1.25
diff -c -r1.25 libgcc2.h
*** libgcc2.h	5 Feb 2003 00:52:24 -0000	1.25
--- libgcc2.h	7 Feb 2003 03:52:10 -0000
***************
*** 227,243 ****
  extern DWtype __ashrdi3 (DWtype, word_type);
  
  /* ??? Ought to get these named properly for DSPs.  */
! #if BITS_PER_UNIT != 8 || MIN_UNITS_PER_WORD < 4
  # undef L_clzsi2
  # undef L_ctzsi2
  # undef L_popcountsi2
  # undef L_paritysi2
! # if LONG_LONG_TYPE_SIZE <= 32
! #  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.  */
--- 227,244 ----
  extern DWtype __ashrdi3 (DWtype, word_type);
  
  /* ??? Ought to get these named properly for DSPs.  */
! #if BITS_PER_UNIT != 8
  # undef L_clzsi2
  # undef L_ctzsi2
  # undef L_popcountsi2
  # undef L_paritysi2
! #endif
! 
! #if BITS_PER_UNIT != 8 || MIN_UNITS_PER_WORD < 4 || LONG_LONG_TYPE_SIZE <= 32
! # undef L_clzdi2
! # undef L_ctzdi2
! # undef L_popcountdi2
! # undef L_paritydi2
  #endif
  
  /* __udiv_w_sdiv is static inline when building other libgcc2 portions.  */


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