Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Steve Ellcey " <sellcey@mips.com>
To: <gdb-patches@sourceware.org>, <binutils@sourcware.org>
Cc: <yufeng.zhang@arm.com>, <rdsandiford@googlemail.com>
Subject: [Patch] Update include/longlong.h to match GCC
Date: Thu, 01 May 2014 15:18:00 -0000	[thread overview]
Message-ID: <bc4d7f87-57da-4931-8f5f-5bf9df04c6af@BAMAIL02.ba.imgtec.org> (raw)


I would like to update include/longlong.h to pick up the latest changes
from GCC and keep this file in sync.  I think changes to keep files 
in sync are considered pre-approved so if I don't hear any objections
I will go ahead.  The changes in GCC that are not yet in the binutils
tree are:

2014-05-01  Steve Ellcey  <sellcey@mips.com>

	* include/longlong.h: Use 'defined()' to check __mips16.

2014-04-30  Richard Sandiford  <rdsandiford@googlemail.com>

	* longlong.h (__i386__): Remove W_TYPE_SIZE==64 handling.

2014-04-22  Yufeng Zhang  <yufeng.zhang@arm.com>

	* longlong.h: Merge from glibc.


Steve Ellcey
sellcey@mips.com




2014-05-01  Steve Ellcey  <sellcey@mips.com>

	* include/longlong.h: Import latest version from GCC tree.


diff --git a/include/longlong.h b/include/longlong.h
index 5f00e54..31f88cb 100644
--- a/include/longlong.h
+++ b/include/longlong.h
@@ -1,5 +1,5 @@
 /* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-   Copyright (C) 1991-2013 Free Software Foundation, Inc.
+   Copyright (C) 1991-2014 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.
 
@@ -122,6 +122,22 @@ extern const UQItype __clz_tab[256] attribute_hidden;
 #define __AND_CLOBBER_CC , "cc"
 #endif /* __GNUC__ < 2 */
 
+#if defined (__aarch64__)
+
+#if W_TYPE_SIZE == 32
+#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 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 /* __aarch64__ */
+
 #if defined (__alpha) && W_TYPE_SIZE == 64
 #define umul_ppmm(ph, pl, m0, m1) \
   do {									\
@@ -467,7 +483,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
 #define UDIV_TIME 40
 #endif /* 80x86 */
 
-#if (defined (__x86_64__) || defined (__i386__)) && W_TYPE_SIZE == 64
+#if defined (__x86_64__) && W_TYPE_SIZE == 64
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("add{q} {%5,%1|%1,%5}\n\tadc{q} {%3,%0|%0,%3}"		\
 	   : "=r" ((UDItype) (sh)),					\
@@ -832,7 +848,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
 #define UMUL_TIME 10
 #define UDIV_TIME 100
 
-#if (__mips == 32 || __mips == 64) && ! __mips16
+#if (__mips == 32 || __mips == 64) && ! defined (__mips16)
 #define count_leading_zeros(COUNT,X)	((COUNT) = __builtin_clz (X))
 #define COUNT_LEADING_ZEROS_0 32
 #endif


             reply	other threads:[~2014-05-01 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 15:18 Steve Ellcey  [this message]
2014-05-01 15:56 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc4d7f87-57da-4931-8f5f-5bf9df04c6af@BAMAIL02.ba.imgtec.org \
    --to=sellcey@mips.com \
    --cc=binutils@sourcware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=rdsandiford@googlemail.com \
    --cc=yufeng.zhang@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox