OSDN Git Service

update
[pf3gnuchains/gcc-fork.git] / gcc / longlong.h
index 65a7179..f86f894 100644 (file)
@@ -1,5 +1,5 @@
 /* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-   Copyright (C) 1991, 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 94, 95, 96, 1997 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
             : "r" ((USItype) (x)))
 #endif /* __a29k__ */
 
+#if defined (__arc__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("add.f      %1, %4, %5
+       adc     %0, %2, %3"                                             \
+          : "=r" ((USItype) (sh)),                                     \
+            "=&r" ((USItype) (sl))                                     \
+          : "%r" ((USItype) (ah)),                                     \
+            "rIJ" ((USItype) (bh)),                                    \
+            "%r" ((USItype) (al)),                                     \
+            "rIJ" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("sub.f      %1, %4, %5
+       sbc     %0, %2, %3"                                             \
+          : "=r" ((USItype) (sh)),                                     \
+            "=&r" ((USItype) (sl))                                     \
+          : "r" ((USItype) (ah)),                                      \
+            "rIJ" ((USItype) (bh)),                                    \
+            "r" ((USItype) (al)),                                      \
+            "rIJ" ((USItype) (bl)))
+/* Call libgcc1 routine.  */
+#define umul_ppmm(w1, w0, u, v) \
+do {                                                                   \
+  DIunion __w;                                                         \
+  __w.ll = __umulsidi3 (u, v);                                         \
+  w1 = __w.s.high;                                                     \
+  w0 = __w.s.low;                                                      \
+} while (0)
+#define __umulsidi3 __umulsidi3
+UDItype __umulsidi3 (USItype, USItype);
+#endif
+
 #if defined (__arm__)
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("adds       %1, %4, %5
     __w; })  
 #endif /* __i960__ */
 
+#if defined (__M32R__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  /* The cmp clears the condition bit.  */ \
+  __asm__ ("cmp %0,%0
+       addx %%5,%1
+       addx %%3,%0"                                                    \
+          : "=r" ((USItype) (sh)),                                     \
+            "=&r" ((USItype) (sl))                                     \
+          : "%0" ((USItype) (ah)),                                     \
+            "r" ((USItype) (bh)),                                      \
+            "%1" ((USItype) (al)),                                     \
+            "r" ((USItype) (bl))                                       \
+          : "cbit")
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  /* The cmp clears the condition bit.  */ \
+  __asm__ ("cmp %0,%0
+       subx %5,%1
+       subx %3,%0"                                                     \
+          : "=r" ((USItype) (sh)),                                     \
+            "=&r" ((USItype) (sl))                                     \
+          : "0" ((USItype) (ah)),                                      \
+            "r" ((USItype) (bh)),                                      \
+            "1" ((USItype) (al)),                                      \
+            "r" ((USItype) (bl))                                       \
+          : "cbit")
+#endif /* __M32R__ */
+
 #if defined (__mc68000__)
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("add%.l %5,%1
 #if defined (__mc68020__) || defined(mc68020) \
        || defined(__mc68030__) || defined(mc68030) \
        || defined(__mc68040__) || defined(mc68040) \
-       || defined(__mc68332__) || defined(mc68332) \
+       || defined(__mcpu32__) || defined(mcpu32) \
        || defined(__NeXT__)
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mulu%.l %3,%1:%0"                                          \
@@ -1178,9 +1236,9 @@ extern const UQItype __clz_tab[];
                                                                        \
     if (SI_TYPE_SIZE <= 32)                                            \
       {                                                                        \
-       __a = __xr < (1<<2*__BITS4)                                     \
-         ? (__xr < (1<<__BITS4) ? 0 : __BITS4)                         \
-         : (__xr < (1<<3*__BITS4) ?  2*__BITS4 : 3*__BITS4);           \
+       __a = __xr < ((USItype)1<<2*__BITS4)                            \
+         ? (__xr < ((USItype)1<<__BITS4) ? 0 : __BITS4)                \
+         : (__xr < ((USItype)1<<3*__BITS4) ?  2*__BITS4 : 3*__BITS4);  \
       }                                                                        \
     else                                                               \
       {                                                                        \