diff mbox

PR 61662

Message ID alpine.LSU.2.11.1407162359120.6423@tuna.site
State New
Headers show

Commit Message

Gerald Pfeifer July 16, 2014, 10:03 p.m. UTC
On Wed, 16 Jul 2014, David Wohlferd wrote:
>>> 2014-07-09  David Wohlferd <dw@LimeGreenSocks.com>
>>> 
>>>          PR target/61662
>>>          * config/i386/ia32intrin.h: Use __LP64__ to determine size of
>>> long
>> This is OK for mainline and 4.9 backport.
> Thank you for reviewing and approving this.  However while I have a 
> release on file with FSF, I don't have SVN write permissions, so I 
> cannot check this in.

I applied this to trunk with minor tweaks to the ChangeLog and the 
comment in the patch itself.  (Both should end with a full stop, we 
use 64-bit as an adjective, and the line was getting long.)

Gerald


2014-07-16  David Wohlferd <dw@LimeGreenSocks.com>

	PR target/61662
	* config/i386/ia32intrin.h: Use __LP64__ to determine size of long.
diff mbox

Patch

Index: config/i386/ia32intrin.h
===================================================================
--- config/i386/ia32intrin.h	(revision 212698)
+++ config/i386/ia32intrin.h	(working copy)
@@ -256,11 +256,7 @@ 
 
 #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 @@ 
 
 #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)