Add port done awhile ago for the ARC cpu.
authorJeff Law <law@gcc.gnu.org>
Tue, 9 Sep 1997 22:21:04 +0000 (16:21 -0600)
committerJeff Law <law@gcc.gnu.org>
Tue, 9 Sep 1997 22:21:04 +0000 (16:21 -0600)
        * arc/arc.h: New file.
        * arc/arc.c: New file.
        * arc/arc.md: New file.
        * arc/initfini.c: New file.
        * arc/lib1funcs.asm: New file.
        * arc/t-arc: New file.
        * arc/xm-arc.h: New file.
        * ginclude/va-arc.h: New file.
        * ginclude/stdarg.h: Include va-arc.h ifdef __arc__.
        * ginclude/varargs.h: Likewise.
        * Makefile.in (USER_H): Add va-arc.h.
        * configure.in (arc-*-elf*): Recognize.
        * longlong.h: Add ARC support.
Mostly so I can test changes in snapshot scripts.

        * expr.c (clear_storage): Use CONST0_RTX instead of const0_rtx.
        when clearing non-BLKmode data.
Fixes sparc problem.

From-SVN: r15198

gcc/configure
gcc/configure.in
gcc/expr.c
gcc/ginclude/stdarg.h
gcc/ginclude/va-arc.h [new file with mode: 0644]
gcc/ginclude/varargs.h
gcc/longlong.h

index 38bb885f85ba577ca28cdc7dca2acf00a3c60bbd..5340f70f66b19ed0ce59f246422ba860218e40cc 100755 (executable)
@@ -1849,6 +1849,9 @@ for machine in $build $host $target; do
                tmake_file=alpha/t-vms
                fixincludes=Makefile.in
                ;;
+       arc-*-elf*)
+               extra_parts="crtinit.o crtfini.o"
+               ;;
        arm-*-coff* | armel-*-coff*)
                tm_file=arm/coff.h
                tmake_file=arm/t-bare
index 5d0f803556c96b50249f8058ed9a1e1c854037fd..1852d89e21682bbd82db5ed4c9b36154044f3924 100644 (file)
@@ -377,6 +377,9 @@ for machine in $build $host $target; do
                tmake_file=alpha/t-vms
                fixincludes=Makefile.in
                ;;
+       arc-*-elf*)
+               extra_parts="crtinit.o crtfini.o"
+               ;;
        arm-*-coff* | armel-*-coff*)
                tm_file=arm/coff.h
                tmake_file=arm/t-bare
index 41fe702a8415b001abe7a06f052e3ccc3c83aa3a..954cce4ecc839e0d15252cd469ea59442ae6ce24 100644 (file)
@@ -2153,7 +2153,7 @@ clear_storage (object, size, align)
        }
     }
   else
-    emit_move_insn (object, const0_rtx);
+    emit_move_insn (object, CONST0_RTX (GET_MODE (object)));
 }
 
 /* Generate code to copy Y into X.
index c497199d735579b45cd7e49865bd2b9a66ae84c9..431439c152f75af20765de270c498386b21987e5 100644 (file)
@@ -41,6 +41,9 @@
 #if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
 #include "va-ppc.h"
 #else
+#ifdef __arc__
+#include "va-arc.h"
+#else
 #ifdef __M32R__
 #include "va-m32r.h"
 #else
@@ -117,6 +120,7 @@ void va_end (__gnuc_va_list);               /* Defined in libgcc.a */
 #endif /* not mn10300 */
 #endif /* not sh */
 #endif /* not m32r */
+#endif /* not arc */
 #endif /* not powerpc with V.4 calling sequence */
 #endif /* not h8300 */
 #endif /* not alpha */
diff --git a/gcc/ginclude/va-arc.h b/gcc/ginclude/va-arc.h
new file mode 100644 (file)
index 0000000..a718ad6
--- /dev/null
@@ -0,0 +1,111 @@
+/* stdarg/varargs support for the ARC */
+
+/* Define __gnuc_va_list.  */
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+typedef void * __gnuc_va_list;
+#endif /* not __GNUC_VA_LIST */
+
+/* If this is for internal libc use, don't define anything but
+   __gnuc_va_list.  */
+#if defined (_STDARG_H) || defined (_VARARGS_H)
+
+/* In GCC version 2, we want an ellipsis at the end of the declaration
+   of the argument list.  GCC version 1 can't parse it.  */
+
+#if __GNUC__ > 1
+#define __va_ellipsis ...
+#else
+#define __va_ellipsis
+#endif
+
+/* See arc_setup_incoming_varargs for reasons for the oddity in va_start.  */
+#ifdef _STDARG_H
+#define va_start(AP, LASTARG) \
+(AP = (__gnuc_va_list) ((int *) __builtin_next_arg (LASTARG) \
+                       + (__builtin_args_info (0) < 8 \
+                          ? (__builtin_args_info (0) & 1) \
+                          : 0)))
+#else
+#define va_alist  __builtin_va_alist
+#define va_dcl    int __builtin_va_alist; __va_ellipsis
+#define va_start(AP) \
+(AP = (__gnuc_va_list) ((int *) &__builtin_va_alist \
+                       + (__builtin_args_info (0) < 8 \
+                          ? (__builtin_args_info (0) & 1) \
+                          : 0)))
+#endif
+
+#ifndef va_end
+void va_end (__gnuc_va_list);          /* Defined in libgcc.a */
+
+/* Values returned by __builtin_classify_type.  */
+
+enum __va_type_classes {
+  __no_type_class = -1,
+  __void_type_class,
+  __integer_type_class,
+  __char_type_class,
+  __enumeral_type_class,
+  __boolean_type_class,
+  __pointer_type_class,
+  __reference_type_class,
+  __offset_type_class,
+  __real_type_class,
+  __complex_type_class,
+  __function_type_class,
+  __method_type_class,
+  __record_type_class,
+  __union_type_class,
+  __array_type_class,
+  __string_type_class,
+  __set_type_class,
+  __file_type_class,
+  __lang_type_class
+};
+
+#endif
+#define va_end(AP)     ((void)0)
+
+/* Avoid errors if compiling GCC v2 with GCC v1.  */
+#if __GNUC__ == 1
+#define __extension__
+#endif
+
+/* All aggregates are passed by reference.  All scalar types larger than 8
+   bytes are passed by reference.  */
+/* We cast to void * and then to TYPE * because this avoids
+   a warning about increasing the alignment requirement.
+   The casts to char * avoid warnings about invalid pointer arithmetic.  */
+
+#define __va_rounded_size(TYPE)  \
+  (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
+
+#ifdef __big_endian__
+#define va_arg(AP,TYPE) \
+__extension__                                                  \
+(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
+      || __va_rounded_size (TYPE) > 8)                         \
+     ? ((AP) = (char *)(AP) + __va_rounded_size (TYPE *),      \
+       *(TYPE **) (void *) ((char *)(AP) - __va_rounded_size (TYPE *))) \
+     : ((TYPE *) (void *)                                      \
+       (AP = (void *) ((__alignof__ (TYPE) > 4                 \
+                        ? ((int) AP + 8 - 1) & -8              \
+                        : (int) AP)                            \
+                        + __va_rounded_size (TYPE))) - 1));}))
+#else
+#define va_arg(AP,TYPE) \
+__extension__                                                  \
+(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
+      || __va_rounded_size (TYPE) > 8)                         \
+     ? ((AP) = (char *)(AP) + __va_rounded_size (TYPE *),      \
+       *(TYPE **) (void *) ((char *)(AP) - __va_rounded_size (TYPE *))) \
+     : ((AP = (void *) ((__alignof__ (TYPE) > 4                        \
+                       ? ((int) AP + 8 - 1) & -8               \
+                       : (int) AP)                             \
+                      + __va_rounded_size (TYPE))),            \
+       (TYPE *) (void *) (AP - __va_rounded_size (TYPE))));}))
+#endif
+
+#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
index dbe97354abadb2f8f8a0dd9aa1589d584779467a..cfb5f2308c7d80292663c81f3c43c0bd38b22a5d 100644 (file)
@@ -39,6 +39,9 @@
 #if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
 #include "va-ppc.h"
 #else
+#ifdef __arc__
+#include "va-arc.h"
+#else
 #ifdef __M32R__
 #include "va-m32r.h"
 #else
@@ -134,6 +137,7 @@ typedef void *__gnuc_va_list;
 #endif /* not mn10300 */
 #endif /* not sh */
 #endif /* not m32r */
+#endif /* not arc */
 #endif /* not powerpc with V.4 calling sequence */
 #endif /* not h8300 */
 #endif /* not alpha */
index e6071547ad77493b2892312244528ad1e622693f..d9055c2a177eebd3d083dc9a9ab9dcdf7d478bc9 100644 (file)
             : "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