This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: AM33/2.0 support in mn10300-elf
On Jul 10, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Jul 9, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:
>> This patch adds support for AM33/2.0 to the mn10300-elf port.
>> AM33/2.0 introduces a single-precision floating point unit to the
>> original AM33.
> This patch adds PIC support to mn10300-elf. Tested along with the
> previous patch, on i686-pc-linux-gnu-x-mn10300-elf.
And this adds the am33_2.0-unknown-linux-gnu target. A patch for the
toplevel will be posted momentarily.
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
2001-12-13 Alexandre Oliva <aoliva@redhat.com>
* config/mn10300/linux.h (LINK_SPEC): Rename the dynamic linker
from ld-linux.so.2 to ld.so.1.
2001-11-18 Alexandre Oliva <aoliva@redhat.com>
* config/mn10300/linux.h (LINK_SPEC): -lpthread, not -lthread.
* config/mn10300/linux.h (LINK_SPEC): Don't handle -Wl,-rpath
nor -Wl,-rpath-link.
(LIB_SPEC): Add -rpath-link if !static.
2001-08-22 Alexandre Oliva <aoliva@redhat.com>
* config/mn10300/mn10300.c (mn10300_protect_label): New
variable.
* config/mn10300/linux.h (PRINT_OPERAND,
PRINT_OPERAND_ADDRESS): Set it during their execution.
(ASM_OUTPUT_LABELREF): Output `+' before symbol name if
mn10300_protect_label is set.
* config/mn10300/linux.h (LINK_SPEC): Recognize -Wl,-rpath and
-Wl,-rpath-link.
(LIB_SPEC, STARTFILE_SPEC): Define.
2001-05-11 Alexandre Oliva <aoliva@redhat.com>
* config/mn10300/t-linux (dp-bit.c, fp-bit.c): Don't define
FLOAT_BIT_ORDER_MISMATCH.
2001-05-09 Alexandre Oliva <aoliva@redhat.com>
* config.gcc (am33_2.0-*-linux*): Added.
* config/mn10300/linux.h: New.
* config/mn10300/t-linux: New.
Index: gcc/config.gcc
===================================================================
RCS file: /cvs/uberbaum/gcc/config.gcc,v
retrieving revision 1.332
diff -u -p -r1.332 config.gcc
--- gcc/config.gcc 4 Jul 2003 19:45:50 -0000 1.332
+++ gcc/config.gcc 10 Jul 2003 04:13:45 -0000
@@ -276,6 +276,9 @@ alpha*-*-*)
cpu_type=alpha
need_64bit_hwint=yes
;;
+am33_2.0-*-linux*)
+ cpu_type=mn10300
+ ;;
strongarm*-*-*)
cpu_type=arm
;;
@@ -2150,6 +2153,16 @@ xtensa-*-elf*)
xtensa-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h xtensa/linux.h"
tmake_file="t-slibgcc-elf-ver t-linux xtensa/t-xtensa xtensa/t-linux"
+ ;;
+am33_2.0-*-linux*)
+ tm_file="mn10300/mn10300.h dbxelf.h elfos.h linux.h mn10300/linux.h"
+ tmake_file="t-linux mn10300/t-linux"
+ gas=yes gnu_ld=yes
+ if test x$enable_threads = xyes; then
+ thread_file='posix'
+ fi
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ use_collect2=no
;;
*)
echo "*** Configuration $machine not supported" 1>&2
Index: gcc/config/mn10300/linux.h
===================================================================
RCS file: gcc/config/mn10300/linux.h
diff -N gcc/config/mn10300/linux.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc/config/mn10300/linux.h 10 Jul 2003 04:13:47 -0000
@@ -0,0 +1,116 @@
+/* Definitions of taret machine for GNU compiler.
+ Matsushita AM33/2.0
+ Copyright 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("unix"); \
+ builtin_define_std ("linux"); \
+ builtin_define ("__gnu_linux__"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=posix"); \
+ } \
+ while (0)
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{mam33:-D__AM33__} %{!mam33:-D__AM33__=2 -D__AM33_2__} \
+ %{posix:-D_POSIX_SOURCE} \
+ %{pthread:-D_REENTRANT -D_PTHREADS}"
+
+#undef ASM_SPEC
+#define ASM_SPEC "%{Wa,*:%*}"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ "%{shared: -lc} \
+ %{!static:-rpath-link %R/lib:%R/usr/lib} \
+ %{!shared: %{pthread:-lpthread} \
+ %{profile:-lc_p} %{!profile: -lc}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+#undef TARGET_SWITCHES
+#define TARGET_SWITCHES \
+ {{ "am33", -0x4, N_("Target the AM33 processor") }, \
+ { "am33-2", 6, N_("Target the AM33/2.0 processor") }, \
+ { "relax", 0, N_("Enable linker relaxations") }, \
+ { "", TARGET_DEFAULT, NULL }}
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT 6
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (AM33/2.0 GNU/Linux)");
+
+#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
+
+extern int mn10300_protect_label;
+
+#undef PRINT_OPERAND
+#define PRINT_OPERAND(FILE, X, CODE) \
+ do \
+ { \
+ mn10300_protect_label = 1; \
+ print_operand ((FILE), (X), (CODE)); \
+ mn10300_protect_label = 0; \
+ } \
+ while (0)
+
+#undef PRINT_OPERAND_ADDRESS
+#define PRINT_OPERAND_ADDRESS(FILE, X) \
+ do \
+ { \
+ mn10300_protect_label = 1; \
+ print_operand_address ((FILE), (X)); \
+ mn10300_protect_label = 0; \
+ } \
+ while (0)
+
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ do \
+ { \
+ const char * real_name; \
+ \
+ real_name = (*targetm.strip_name_encoding) (NAME); \
+ if (mn10300_protect_label) \
+ asm_fprintf (FILE, "+"); \
+ asm_fprintf (FILE, "%U%s", real_name); \
+ } \
+ while (0)
+
Index: gcc/config/mn10300/mn10300.c
===================================================================
RCS file: /cvs/uberbaum/gcc/config/mn10300/mn10300.c,v
retrieving revision 1.54
diff -u -p -r1.54 mn10300.c
--- gcc/config/mn10300/mn10300.c 10 Jul 2003 03:25:32 -0000 1.54
+++ gcc/config/mn10300/mn10300.c 10 Jul 2003 04:13:48 -0000
@@ -48,6 +48,12 @@ Boston, MA 02111-1307, USA. */
UNSPEC_INT_LABELs. */
int mn10300_unspec_int_label_counter;
+/* This is used in the am33_2.0-linux-gnu port, in which global symbol
+ names are not prefixed by underscores, to tell whether to prefix a
+ label with a plus sign or not, so that the assembler can tell
+ symbol names from register names. */
+int mn10300_protect_label;
+
/* The size of the callee register save area. Right now we save everything
on entry since it costs us nothing in code size. It does cost us from a
speed standpoint, so we want to optimize this sooner or later. */
Index: gcc/config/mn10300/t-linux
===================================================================
RCS file: gcc/config/mn10300/t-linux
diff -N gcc/config/mn10300/t-linux
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc/config/mn10300/t-linux 10 Jul 2003 04:13:48 -0000
@@ -0,0 +1,11 @@
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer