public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH [7/n]: Prepare x32: Use Use long long builtin for x86-64
@ 2011-06-14 16:15 H.J. Lu
  2011-06-14 17:42 ` Uros Bizjak
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2011-06-14 16:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak

Hi,

long may be 32bit for x86-64. But long long is always 64bit.  This
patch uses long long builtin for 64bit.  OK for trunk?

Thanks.


H.J.
---
2011-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* longlong.h (count_leading_zeros): Use long long builtin for
	x86-64.
	(count_trailing_zeros): Likewise.

diff --git a/gcc/longlong.h b/gcc/longlong.h
index 1bab76d..d5c0cd9 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -430,8 +430,8 @@ UDItype __umulsidi3 (USItype, USItype);
 	   : "0" ((UDItype) (n0)),					\
 	     "1" ((UDItype) (n1)),					\
 	     "rm" ((UDItype) (dv)))
-#define count_leading_zeros(count, x)	((count) = __builtin_clzl (x))
-#define count_trailing_zeros(count, x)	((count) = __builtin_ctzl (x))
+#define count_leading_zeros(count, x)	((count) = __builtin_clzll (x))
+#define count_trailing_zeros(count, x)	((count) = __builtin_ctzll (x))
 #define UMUL_TIME 40
 #define UDIV_TIME 40
 #endif /* x86_64 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH [7/n]: Prepare x32: Use Use long long builtin for x86-64
  2011-06-14 16:15 PATCH [7/n]: Prepare x32: Use Use long long builtin for x86-64 H.J. Lu
@ 2011-06-14 17:42 ` Uros Bizjak
  2011-06-14 17:58   ` H.J. Lu
  2011-06-18 19:04   ` H.J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Uros Bizjak @ 2011-06-14 17:42 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches, Kai Tietz, Jakub Jelinek

On Tue, Jun 14, 2011 at 6:04 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> long may be 32bit for x86-64. But long long is always 64bit.  This
> patch uses long long builtin for 64bit.  OK for trunk?
>
> Thanks.
>
>
> H.J.
> ---
> 2011-06-14  H.J. Lu  <hongjiu.lu@intel.com>
>
>        * longlong.h (count_leading_zeros): Use long long builtin for
>        x86-64.
>        (count_trailing_zeros): Likewise.
>
> diff --git a/gcc/longlong.h b/gcc/longlong.h
> index 1bab76d..d5c0cd9 100644
> --- a/gcc/longlong.h
> +++ b/gcc/longlong.h
> @@ -430,8 +430,8 @@ UDItype __umulsidi3 (USItype, USItype);
>           : "0" ((UDItype) (n0)),                                      \
>             "1" ((UDItype) (n1)),                                      \
>             "rm" ((UDItype) (dv)))
> -#define count_leading_zeros(count, x)  ((count) = __builtin_clzl (x))
> -#define count_trailing_zeros(count, x) ((count) = __builtin_ctzl (x))
> +#define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
> +#define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
>  #define UMUL_TIME 40
>  #define UDIV_TIME 40
>  #endif /* x86_64 */

Uh, this is also needed for MingW (LLP64 target).

The patch is OK for SVN and release branches, but please also wait for
approval from MingW maintainer.

Do we need to updata glibc as well?

Thanks,
Uros.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH [7/n]: Prepare x32: Use Use long long builtin for x86-64
  2011-06-14 17:42 ` Uros Bizjak
@ 2011-06-14 17:58   ` H.J. Lu
  2011-06-18 19:04   ` H.J. Lu
  1 sibling, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2011-06-14 17:58 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, Kai Tietz, Jakub Jelinek

On Tue, Jun 14, 2011 at 10:37 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Jun 14, 2011 at 6:04 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>
>> long may be 32bit for x86-64. But long long is always 64bit.  This
>> patch uses long long builtin for 64bit.  OK for trunk?
>>
>> Thanks.
>>
>>
>> H.J.
>> ---
>> 2011-06-14  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>        * longlong.h (count_leading_zeros): Use long long builtin for
>>        x86-64.
>>        (count_trailing_zeros): Likewise.
>>
>> diff --git a/gcc/longlong.h b/gcc/longlong.h
>> index 1bab76d..d5c0cd9 100644
>> --- a/gcc/longlong.h
>> +++ b/gcc/longlong.h
>> @@ -430,8 +430,8 @@ UDItype __umulsidi3 (USItype, USItype);
>>           : "0" ((UDItype) (n0)),                                      \
>>             "1" ((UDItype) (n1)),                                      \
>>             "rm" ((UDItype) (dv)))
>> -#define count_leading_zeros(count, x)  ((count) = __builtin_clzl (x))
>> -#define count_trailing_zeros(count, x) ((count) = __builtin_ctzl (x))
>> +#define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
>> +#define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
>>  #define UMUL_TIME 40
>>  #define UDIV_TIME 40
>>  #endif /* x86_64 */
>
> Uh, this is also needed for MingW (LLP64 target).
>
> The patch is OK for SVN and release branches, but please also wait for
> approval from MingW maintainer.
>
> Do we need to updata glibc as well?
>

Yes:

http://git.kernel.org/?p=devel/glibc/hjl/x86.git;a=commit;h=196911a6e77bbe851caff25ba260a25ceb9cf376


-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH [7/n]: Prepare x32: Use Use long long builtin for x86-64
  2011-06-14 17:42 ` Uros Bizjak
  2011-06-14 17:58   ` H.J. Lu
@ 2011-06-18 19:04   ` H.J. Lu
  1 sibling, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2011-06-18 19:04 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, Kai Tietz, Jakub Jelinek

On Tue, Jun 14, 2011 at 10:37 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Jun 14, 2011 at 6:04 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>
>> long may be 32bit for x86-64. But long long is always 64bit.  This
>> patch uses long long builtin for 64bit.  OK for trunk?
>>
>> Thanks.
>>
>>
>> H.J.
>> ---
>> 2011-06-14  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>        * longlong.h (count_leading_zeros): Use long long builtin for
>>        x86-64.
>>        (count_trailing_zeros): Likewise.
>>
>> diff --git a/gcc/longlong.h b/gcc/longlong.h
>> index 1bab76d..d5c0cd9 100644
>> --- a/gcc/longlong.h
>> +++ b/gcc/longlong.h
>> @@ -430,8 +430,8 @@ UDItype __umulsidi3 (USItype, USItype);
>>           : "0" ((UDItype) (n0)),                                      \
>>             "1" ((UDItype) (n1)),                                      \
>>             "rm" ((UDItype) (dv)))
>> -#define count_leading_zeros(count, x)  ((count) = __builtin_clzl (x))
>> -#define count_trailing_zeros(count, x) ((count) = __builtin_ctzl (x))
>> +#define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
>> +#define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
>>  #define UMUL_TIME 40
>>  #define UDIV_TIME 40
>>  #endif /* x86_64 */
>
> Uh, this is also needed for MingW (LLP64 target).
>
> The patch is OK for SVN and release branches, but please also wait for
> approval from MingW maintainer.
>

I am checking it in.  I will investigate if there is any issue.

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-18 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-14 16:15 PATCH [7/n]: Prepare x32: Use Use long long builtin for x86-64 H.J. Lu
2011-06-14 17:42 ` Uros Bizjak
2011-06-14 17:58   ` H.J. Lu
2011-06-18 19:04   ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).