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: MIPS clz support in longlong.h


Here's another little patch related to MIPS clz support. I wasn't sure how to test specifically that this does something useful, but it does pass the standard gcc tests. :-)

OK to commit?

-Sandra

2007-08-01  Sandra Loosemore  <sandra@codesourcery.com>
	    Nigel Stephens  <nigel@mips.com>

	gcc/
	* longlong.h [__mips__] (count_leading_zeros, COUNT_LEADING_ZEROS_0):
	Define for MIPS32 and MIPS64.
Index: gcc/longlong.h
===================================================================
*** gcc/longlong.h	(revision 127137)
--- gcc/longlong.h	(working copy)
*************** UDItype __umulsidi3 (USItype, USItype);
*** 624,629 ****
--- 624,634 ----
  	     "d" ((USItype) (v)))
  #define UMUL_TIME 10
  #define UDIV_TIME 100
+ 
+ #if (__mips == 32 || __mips == 64) && ! __mips16
+ #define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clz (X))
+ #define COUNT_LEADING_ZEROS_0 32
+ #endif
  #endif /* __mips__ */
  
  #if defined (__ns32000__) && W_TYPE_SIZE == 32

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