re PR target/61662 (Incorrect value calculated for _lrotl on LLP64 systems)
authorDavid Wohlferd <dw@LimeGreenSocks.com>
Wed, 16 Jul 2014 22:01:41 +0000 (22:01 +0000)
committerGerald Pfeifer <gerald@gcc.gnu.org>
Wed, 16 Jul 2014 22:01:41 +0000 (22:01 +0000)
PR target/61662
* config/i386/ia32intrin.h: Use __LP64__ to determine size of long.

From-SVN: r212699

gcc/ChangeLog
gcc/config/i386/ia32intrin.h

index 6680787..f3a404f 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-16  David Wohlferd <dw@LimeGreenSocks.com>
+
+       PR target/61662
+       * config/i386/ia32intrin.h: Use __LP64__ to determine size of long.
+
 2014-07-16  Dodji Seketeli  <dodji@redhat.com>
 
        Support location tracking for built-in macro tokens
index 5e7c893..614b0fa 100644 (file)
@@ -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)