From: David Wohlferd Date: Wed, 16 Jul 2014 22:01:41 +0000 (+0000) Subject: re PR target/61662 (Incorrect value calculated for _lrotl on LLP64 systems) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ed6e4e15247af6110d444cef486152fea6f01b5;p=gcc.git re PR target/61662 (Incorrect value calculated for _lrotl on LLP64 systems) PR target/61662 * config/i386/ia32intrin.h: Use __LP64__ to determine size of long. From-SVN: r212699 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6680787ba41..f3a404fe9e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-07-16 David Wohlferd + + PR target/61662 + * config/i386/ia32intrin.h: Use __LP64__ to determine size of long. + 2014-07-16 Dodji Seketeli Support location tracking for built-in macro tokens diff --git a/gcc/config/i386/ia32intrin.h b/gcc/config/i386/ia32intrin.h index 5e7c893fe85..614b0fab203 100644 --- a/gcc/config/i386/ia32intrin.h +++ b/gcc/config/i386/ia32intrin.h @@ -256,11 +256,7 @@ __writeeflags (unsigned long long X) #define _bswap64(a) __bswapq(a) #define _popcnt64(a) __popcntq(a) -#define _lrotl(a,b) __rolq((a), (b)) -#define _lrotr(a,b) __rorq((a), (b)) #else -#define _lrotl(a,b) __rold((a), (b)) -#define _lrotr(a,b) __rord((a), (b)) /* Read flags register */ extern __inline unsigned int @@ -280,6 +276,16 @@ __writeeflags (unsigned int X) #endif +/* On LP64 systems, longs are 64-bit. Use the appropriate rotate + * function. */ +#ifdef __LP64__ +#define _lrotl(a,b) __rolq((a), (b)) +#define _lrotr(a,b) __rorq((a), (b)) +#else +#define _lrotl(a,b) __rold((a), (b)) +#define _lrotr(a,b) __rord((a), (b)) +#endif + #define _bit_scan_forward(a) __bsfd(a) #define _bit_scan_reverse(a) __bsrd(a) #define _bswap(a) __bswapd(a)