OSDN Git Service

* config/m68hc11/m68hc11.h (ASM_SPEC): Handle -m68hcs12; Pass -mshort
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jan 2003 22:50:41 +0000 (22:50 +0000)
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jan 2003 22:50:41 +0000 (22:50 +0000)
and -mshort-double to the assembler to specify the ABI.
(LINK_SPEC): Likewise.
(CPP_SPEC): Pass HCS12 specific define.
(MASK_M68S12): New define.
(TARGET_M68S12): Likewise.
(TARGET_SWITCHES): New options -m68hcs12 and -m68S12.
(TARGET_VERSION): Update.
* config/m68hc11/m68hc12.h (CPP_SPEC): Pass HCS12 specific define.
(LINK_SPEC): Update.
(ASM_SPEC): Update.
* config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Update.
* doc/invoke.texi (M68hc1x Options): Document -m68hcs12.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61358 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h
gcc/config/m68hc11/m68hc12.h
gcc/doc/invoke.texi

index 1f7e019..ca7b57f 100644 (file)
@@ -1,5 +1,21 @@
 2003-01-15  Stephane Carrez  <stcarrez@nerim.fr>
 
+       * config/m68hc11/m68hc11.h (ASM_SPEC): Handle -m68hcs12; Pass -mshort
+       and -mshort-double to the assembler to specify the ABI.
+       (LINK_SPEC): Likewise.
+       (CPP_SPEC): Pass HCS12 specific define.
+       (MASK_M68S12): New define.
+       (TARGET_M68S12): Likewise.
+       (TARGET_SWITCHES): New options -m68hcs12 and -m68S12.
+       (TARGET_VERSION): Update.
+       * config/m68hc11/m68hc12.h (CPP_SPEC): Pass HCS12 specific define.
+       (LINK_SPEC): Update.
+       (ASM_SPEC): Update.
+       * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Update.
+       * doc/invoke.texi (M68hc1x Options): Document -m68hcs12.
+
+2003-01-15  Stephane Carrez  <stcarrez@nerim.fr>
+
        * config/m68hc11/m68hc11.md ("return"): Use emit_jump_insn to emit
        the return code.
 
index 6f61659..cb9593f 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines for code generation on Motorola 68HC11 and 68HC12.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of GNU CC.
@@ -5509,7 +5509,10 @@ m68hc11_asm_file_start (out, main_file)
      const char *main_file;
 {
   fprintf (out, ";;;-----------------------------------------\n");
-  fprintf (out, ";;; Start MC68HC11 gcc assembly output\n");
+  fprintf (out, ";;; Start %s gcc assembly output\n",
+           TARGET_M6811
+           ? "MC68HC11"
+           : TARGET_M68S12 ? "MC68HCS12" : "MC68HC12");
   fprintf (out, ";;; gcc compiler %s\n", version_string);
   print_options (out);
   fprintf (out, ";;;-----------------------------------------\n");
index 6911b41..2c72cec 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler.
    Motorola 68HC11 and 68HC12.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of GNU CC.
@@ -43,13 +43,22 @@ Note:
 
 /* Compile and assemble for a 68hc11 unless there is a -m68hc12 option.  */
 #ifndef ASM_SPEC
-#define ASM_SPEC       "%{m68hc12:-m68hc12}%{!m68hc12:-m68hc11}"
+#define ASM_SPEC                                                \
+"%{m68hc12:-m68hc12}"                                           \
+"%{m68hcs12:-m68hcs12}"                                         \
+"%{!m68hc12:%{!m68hcs12:-m68hc11}} "                            \
+"%{mshort:-mshort}%{!mshort:-mlong} "                           \
+"%{fshort-double:-mshort-double}%{!fshort-double:-mlong-double}"
 #endif
 
 /* We need to tell the linker the target elf format.  Just pass an
    emulation option.  This can be overridden by -Wl option of gcc.  */
 #ifndef LINK_SPEC
-#define LINK_SPEC      "%{m68hc12:-m m68hc12elf}%{!m68hc12:-m m68hc11elf} %{mrelax:-relax}"
+#define LINK_SPEC                                               \
+"%{m68hc12:-m m68hc12elf}"                                      \
+"%{m68hcs12:-m m68hc12elf}"                                     \
+"%{!m68hc12:%{!m68hcs12:-m m68hc11elf}} "                       \
+"%{!mnorelax:%{!m68hc12:%{!m68hcs12:-relax}}}"
 #endif
 
 #ifndef LIB_SPEC
@@ -65,7 +74,8 @@ Note:
 "%{mshort:-D__HAVE_SHORT_INT__ -D__INT__=16}\
  %{!mshort:-D__INT__=32}\
  %{m68hc12:-Dmc6812 -DMC6812 -Dmc68hc12}\
- %{!m68hc12:-Dmc6811 -DMC6811 -Dmc68hc11}\
+ %{m68hcs12:-Dmc6812 -DMC6812 -Dmc68hcs12}\
+ %{!m68hc12:%{!m68hcs12:-Dmc6811 -DMC6811 -Dmc68hc11}}\
  %{fshort-double:-D__HAVE_SHORT_DOUBLE__}\
  %{mlong-calls:-D__USE_RTC__}"
 #endif
@@ -118,15 +128,16 @@ extern short *reg_renumber;       /* def in local_alloc.c */
 #define MASK_SHORT              0002   /* Compile with 16-bit `int' */
 #define MASK_AUTO_INC_DEC       0004
 #define MASK_M6811              0010
-#define MASK_M6812              0020
-#define MASK_NO_DIRECT_MODE     0040
-#define MASK_MIN_MAX            0100
-#define MASK_LONG_CALLS         0200
+#define MASK_M68S12             0040
+#define MASK_NO_DIRECT_MODE     0100
+#define MASK_MIN_MAX            0200
+#define MASK_LONG_CALLS         0400
 
 #define TARGET_OP_TIME         (optimize && optimize_size == 0)
 #define TARGET_SHORT            (target_flags & MASK_SHORT)
 #define TARGET_M6811            (target_flags & MASK_M6811)
 #define TARGET_M6812            (target_flags & MASK_M6812)
+#define TARGET_M68S12           (target_flags & MASK_M68S12)
 #define TARGET_AUTO_INC_DEC     (target_flags & MASK_AUTO_INC_DEC)
 #define TARGET_MIN_MAX          (target_flags & MASK_MIN_MAX)
 #define TARGET_NO_DIRECT_MODE   (target_flags & MASK_NO_DIRECT_MODE)
@@ -178,10 +189,14 @@ extern short *reg_renumber;       /* def in local_alloc.c */
     N_("Compile for a 68HC11")},                               \
   { "68hc12", MASK_M6812,                                      \
     N_("Compile for a 68HC12")},                               \
+  { "68hcs12", MASK_M6812 | MASK_M68S12,                       \
+    N_("Compile for a 68HCS12")},                              \
   { "6811",   MASK_M6811,                                      \
     N_("Compile for a 68HC11")},                               \
   { "6812",   MASK_M6812,                                      \
     N_("Compile for a 68HC12")},                               \
+  { "68S12",  MASK_M6812 | MASK_M68S12,                                \
+    N_("Compile for a 68HCS12")},                              \
   { "", TARGET_DEFAULT, 0 }}
 
 /* This macro is similar to `TARGET_SWITCHES' but defines names of
@@ -214,7 +229,7 @@ extern const char *m68hc11_soft_reg_count;
 #endif
 
 /* Print subsidiary information on the compiler version in use.  */
-#define TARGET_VERSION         fprintf (stderr, " (MC68HC11/MC68HC12)")
+#define TARGET_VERSION fprintf (stderr, " (MC68HC11/MC68HC12/MC68HCS12)")
 
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
index a9f09dd..498763e 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, for m68hc12.
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
-   Contributed by Stephane Carrez (stcarrez@worldnet.fr).
+   Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+   Contributed by Stephane Carrez (stcarrez@nerim.fr).
 
 This file is part of GNU CC.
 
@@ -20,19 +20,26 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 /* Compile and assemble for a 68hc12 unless there is a -m68hc11 option.  */
-#define ASM_SPEC       "%{m68hc11:-m68hc11}%{!m68hc11:-m68hc12}"
+#define ASM_SPEC                                                \
+"%{m68hc11:-m68hc11}"                                           \
+"%{m68hcs12:-m68hcs12}"                                         \
+"%{!m68hc11:%{!m68hcs12:-m68hc12}}"
 #define LIB_SPEC       ""
 #define CC1_SPEC       ""
 
 /* We need to tell the linker the target elf format.  Just pass an
    emulation option.  This can be overridden by -Wl option of gcc.  */
-#define LINK_SPEC      "%{m68hc11:-m m68hc11elf}%{!m68hc11:-m m68hc12elf}"
+#define LINK_SPEC                                               \
+"%{m68hc11:-m m68hc11elf}"                                      \
+"%{m68hcs12:-m m68hc12elf}"                                     \
+"%{!m68hc11:%{!m68hcs12:-m m68hc11elf}} %{mrelax:-relax}"
 
 #define CPP_SPEC  \
 "%{mshort:-D__HAVE_SHORT_INT__ -D__INT__=16}\
  %{!mshort:-D__INT__=32}\
  %{m68hc11:-Dmc6811 -DMC6811 -Dmc68hc11}\
- %{!m68hc11:-Dmc6812 -DMC6812 -Dmc68hc12}\
+ %{!m68hc11:%{!m68hc12:-Dmc6812 -DMC6812 -Dmc68hc12}}\
+ %{m68hcs12:-Dmc6812 -DMC6812 -Dmc68hcs12}\
  %{fshort-double:-D__HAVE_SHORT_DOUBLE__}"
 
 /* Default target_flags if no switches specified.  */
index a96caa7..34b597a 100644 (file)
@@ -345,7 +345,7 @@ in the following sections.
 
 @emph{M68hc1x Options}
 @gccoptlist{
--m6811  -m6812  -m68hc11  -m68hc12 @gol
+-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
 -msoft-reg-count=@var{count}}
 
@@ -5505,6 +5505,12 @@ when the compiler is configured for 68HC11-based systems.
 Generate output for a 68HC12.  This is the default
 when the compiler is configured for 68HC12-based systems.
 
+@item -m68S12
+@itemx -m68hcs12
+@opindex m68S12
+@opindex m68hcs12
+Generate output for a 68HCS12.  
+
 @item -mauto-incdec
 @opindex mauto-incdec
 Enable the use of 68HC12 pre and post auto-increment and auto-decrement