OSDN Git Service

* g++.dg/other/debug1.C: Fix typos.
[pf3gnuchains/gcc-fork.git] / gcc / longlong.h
index aa9aea5..f218a02 100644 (file)
@@ -1,5 +1,6 @@
 /* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-   Copyright (C) 1991,92,94,95,96,97,98,99, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   Free Software Foundation, Inc.
 
    This definition file is free software; you can redistribute it
    and/or modify it under the terms of the GNU General Public
 extern UDItype __udiv_qrnnd PARAMS ((UDItype *, UDItype, UDItype, UDItype));
 #define UDIV_TIME 220
 #endif /* LONGLONG_STANDALONE */
+#ifdef __alpha_cix__
+#define count_leading_zeros(COUNT,X) \
+  __asm__("ctlz %1,%0" : "=r"(COUNT) : "r"(X))
+#define count_trailing_zeros(COUNT,X) \
+  __asm__("cttz %1,%0" : "=r"(COUNT) : "r"(X))
+#define COUNT_LEADING_ZEROS_0 64
+#else
+extern const UQItype __clz_tab[];
+#define count_leading_zeros(COUNT,X) \
+  do {                                                                 \
+    UDItype __xr = (X), __t, __a;                                      \
+    __asm__("cmpbge $31,%1,%0" : "=r"(__t) : "r"(__xr));               \
+    __a = __clz_tab[__t ^ 0xff] - 1;                                   \
+    __asm__("extbl %1,%2,%0" : "=r"(__t) : "r"(__xr), "r"(__a));       \
+    (COUNT) = 64 - (__clz_tab[__t] + __a*8);                           \
+  } while (0)
+#define count_trailing_zeros(COUNT,X) \
+  do {                                                                 \
+    UDItype __xr = (X), __t, __a;                                      \
+    __asm__("cmpbge $31,%1,%0" : "=r"(__t) : "r"(__xr));               \
+    __t = ~__t & -~__t;                                                        \
+    __a = ((__t & 0xCC) != 0) * 2;                                     \
+    __a += ((__t & 0xF0) != 0) * 4;                                    \
+    __a += ((__t & 0xAA) != 0);                                                \
+    __asm__("extbl %1,%2,%0" : "=r"(__t) : "r"(__xr), "r"(__a));       \
+    __a <<= 3;                                                         \
+    __t &= -__t;                                                       \
+    __a += ((__t & 0xCC) != 0) * 2;                                    \
+    __a += ((__t & 0xF0) != 0) * 4;                                    \
+    __a += ((__t & 0xAA) != 0);                                                \
+    (COUNT) = __a;                                                     \
+  } while (0)
+#endif /* __alpha_cix__ */
 #endif /* __alpha */
 
 #if defined (__arc__) && W_TYPE_SIZE == 32
@@ -188,7 +222,7 @@ extern UDItype __udiv_qrnnd PARAMS ((UDItype *, UDItype, UDItype, UDItype));
             "rIJ" ((USItype) (bh)),                                    \
             "r" ((USItype) (al)),                                      \
             "rIJ" ((USItype) (bl)))
-/* Call libgcc1 routine.  */
+/* Call libgcc routine.  */
 #define umul_ppmm(w1, w0, u, v) \
 do {                                                                   \
   DWunion __w;                                                         \
@@ -551,7 +585,7 @@ UDItype __umulsidi3 (USItype, USItype);
             "1" ((USItype) (al)),                                      \
             "g" ((USItype) (bl)))
 
-/* The '020, '030, '040 and CPU32 have 32x32->64 and 64/32->32q-32r. */
+/* The '020, '030, '040 and CPU32 have 32x32->64 and 64/32->32q-32r.  */
 #if defined (__mc68020__) || defined(mc68020) \
        || defined(__mc68030__) || defined(mc68030) \
        || defined(__mc68040__) || defined(mc68040) \
@@ -620,7 +654,7 @@ UDItype __umulsidi3 (USItype, USItype);
 #endif /* not mcf5200 */
 #endif /* not mc68020 */
 
-/* The '020, '030, '040 and '060 have bitfield insns. */
+/* The '020, '030, '040 and '060 have bitfield insns.  */
 #if defined (__mc68020__) || defined(mc68020) \
        || defined(__mc68030__) || defined(mc68030) \
        || defined(__mc68040__) || defined(mc68040) \
@@ -832,7 +866,7 @@ UDItype __umulsidi3 (USItype, USItype);
   } while (0)
 #define SMUL_TIME 14
 #define UDIV_TIME 120
-#elif defined (_ARCH_POWER)
+#elif defined (_ARCH_PWR)
 #define umul_ppmm(xh, xl, m0, m1) \
   do {                                                                 \
     USItype __m0 = (m0), __m1 = (m1);                                  \
@@ -882,8 +916,7 @@ UDItype __umulsidi3 (USItype, USItype);
   ({union {UDItype __ll;                                               \
           struct {USItype __h, __l;} __i;                              \
          } __xx;                                                       \
-  __asm__ ("movw %1,%R0
-       uemul %2,%0"                                                    \
+  __asm__ ("movw %1,%R0\n\tuemul %2,%0"                                        \
           : "=&r" (__xx.__ll)                                          \
           : "g" ((USItype) (u)),                                       \
             "g" ((USItype) (v)));                                      \
@@ -1151,7 +1184,7 @@ UDItype __umulsidi3 (USItype, USItype);
           : "r" ((USItype) (__d)),                                     \
             "1" ((USItype) (__n1)),                                    \
             "0" ((USItype) (__n0)) : "g1" __AND_CLOBBER_CC)
-#define UDIV_TIME (3+7*32)     /* 7 instructions/iteration. 32 iterations. */
+#define UDIV_TIME (3+7*32)     /* 7 instructions/iteration. 32 iterations.  */
 #endif /* __sparclite__ */
 #endif /* __sparc_v8__ */
 #endif /* sparc32 */
@@ -1344,7 +1377,7 @@ UDItype __umulsidi3 (USItype, USItype);
     __x1 += __ll_highpart (__x0);/* this can't give carry */           \
     __x1 += __x2;              /* but this indeed can */               \
     if (__x1 < __x2)           /* did we get it? */                    \
-      __x3 += __ll_B;          /* yes, add it in the proper pos. */    \
+      __x3 += __ll_B;          /* yes, add it in the proper pos.  */   \
                                                                        \
     (w1) = __x3 + __ll_highpart (__x1);                                        \
     (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0);         \