From 6dab9931f8f4b4366c3e1670902ace73e736ac4d Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Mon, 4 Jul 2011 10:02:34 +0000 Subject: [PATCH] t-avr (intfuncs16): Add _clrsbXX2. libgcc/ * config/avr/t-avr (intfuncs16): Add _clrsbXX2. gcc/ * longlong.h (count_leading_zeros, count_trailing_zeros, COUNT_LEADING_ZEROS_0): Define for target avr if W_TYPE_SIZE is 16 resp. 64. From-SVN: r175800 --- gcc/ChangeLog | 6 ++++++ gcc/longlong.h | 20 ++++++++++++++++++-- libgcc/ChangeLog | 4 ++++ libgcc/config/avr/t-avr | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 28ff47174c1..8c0dc9ac79c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-07-04 Georg-Johann Lay + + * longlong.h (count_leading_zeros, count_trailing_zeros, + COUNT_LEADING_ZEROS_0): Define for target avr if W_TYPE_SIZE is 16 + resp. 64. + 2011-07-03 Ira Rosen PR tree-optimization/49610 diff --git a/gcc/longlong.h b/gcc/longlong.h index 7d11e10646e..cd4c40ff32a 100644 --- a/gcc/longlong.h +++ b/gcc/longlong.h @@ -250,11 +250,27 @@ UDItype __umulsidi3 (USItype, USItype); #define COUNT_LEADING_ZEROS_0 32 #endif -#if defined (__AVR__) && W_TYPE_SIZE == 32 +#if defined (__AVR__) + +#if W_TYPE_SIZE == 16 +#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X)) +#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctz (X)) +#define COUNT_LEADING_ZEROS_0 16 +#endif /* W_TYPE_SIZE == 16 */ + +#if W_TYPE_SIZE == 32 #define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clzl (X)) #define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctzl (X)) #define COUNT_LEADING_ZEROS_0 32 -#endif /* defined (__AVR__) && W_TYPE_SIZE == 32 */ +#endif /* W_TYPE_SIZE == 32 */ + +#if W_TYPE_SIZE == 64 +#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clzll (X)) +#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctzll (X)) +#define COUNT_LEADING_ZEROS_0 64 +#endif /* W_TYPE_SIZE == 64 */ + +#endif /* defined (__AVR__) */ #if defined (__CRIS__) && __CRIS_arch_version >= 3 #define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X)) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 358cc1eb242..626a32a7fdb 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2011-07-04 Georg-Johann Lay + + * config/avr/t-avr (intfuncs16): Add _clrsbXX2. + 2011-06-28 Nick Clifton * config.host: Recognize all V850 variants. diff --git a/libgcc/config/avr/t-avr b/libgcc/config/avr/t-avr index 7c8783ee212..78829c76af4 100644 --- a/libgcc/config/avr/t-avr +++ b/libgcc/config/avr/t-avr @@ -1,5 +1,5 @@ # Extra 16-bit integer functions. -intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 +intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2 hiintfuncs16 = $(subst XX,hi,$(intfuncs16)) siintfuncs16 = $(subst XX,si,$(intfuncs16)) -- 2.30.2