OSDN Git Service

libgcc/
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Jul 2011 10:02:34 +0000 (10:02 +0000)
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Jul 2011 10:02:34 +0000 (10:02 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175800 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/longlong.h
libgcc/ChangeLog
libgcc/config/avr/t-avr

index 28ff471..8c0dc9a 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-04  Georg-Johann Lay  <avr@gjlay.de>
+
+       * 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  <ira.rosen@linaro.org>
 
        PR tree-optimization/49610
index 7d11e10..cd4c40f 100644 (file)
@@ -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))
index 358cc1e..626a32a 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-04  Georg-Johann Lay  <avr@gjlay.de>
+
+       * config/avr/t-avr (intfuncs16): Add _clrsbXX2.
+
 2011-06-28  Nick Clifton  <nickc@redhat.com>
 
        * config.host: Recognize all V850 variants.
index 7c8783e..78829c7 100644 (file)
@@ -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))