From 17f0f8fac745e2713017636cfb4adcc609227a09 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 14 Sep 2000 18:09:16 +0000 Subject: [PATCH] invoke.texi (H8/300 Options): Add -ms2600. * invoke.texi (H8/300 Options): Add -ms2600. * config/h8300.c (h8300_init_once): Output an error when -ms2600 is used without -ms. * config/h8300.h (TARGET_MAC): New. (TARGET_SWITCHES): Add -ms2600 and -mno-s2600. (CONDITIONA_REGISTER_USAGE): Disable the mac register on any machine other than H8/S2600. * config/h8300.md: Accept mac instructions on the H8/S2600 instead of the H8/S2000. From-SVN: r36414 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/h8300/h8300.c | 3 +++ gcc/config/h8300/h8300.h | 13 +++++++++---- gcc/config/h8300/h8300.md | 4 ++-- gcc/invoke.texi | 3 +++ 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fb8152f34b3..8aa78abb09a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2000-09-14 Kazu Hirata + + * invoke.texi (H8/300 Options): Add -ms2600. + * config/h8300.c (h8300_init_once): Output an error when -ms2600 + is used without -ms. + * config/h8300.h (TARGET_MAC): New. + (TARGET_SWITCHES): Add -ms2600 and -mno-s2600. + (CONDITIONA_REGISTER_USAGE): Disable the mac register on any + machine other than H8/S2600. + * config/h8300.md: Accept mac instructions on the H8/S2600 instead + of the H8/S2000. + 2000-09-14 Alexandre Oliva , Bernd Schmidt * reload.c (find_reloads_address_1): Generate reloads for auto_inc diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 1ecda26af58..c81cac95b0d 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -107,6 +107,9 @@ h8300_init_once () h8_push_op = h8_push_ops[cpu_type]; h8_pop_op = h8_pop_ops[cpu_type]; h8_mov_op = h8_mov_ops[cpu_type]; + + if (!TARGET_H8300S && TARGET_MAC) + fatal ("-ms2600 is used without -ms."); } const char * diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 55af2e297e1..4a1d9e3022a 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -88,6 +88,9 @@ extern int target_flags; #define TARGET_H8300H (target_flags & 4096) #define TARGET_H8300S (target_flags & 1) +/* mac register and relevant instructions are available. */ +#define TARGET_MAC (target_flags & 2) + /* Align all values on the H8/300H the same way as the H8/300. Specifically, 32 bit and larger values are aligned on 16 bit boundaries. This is all the hardware requires, but the default is 32 bits for the 300H. @@ -104,6 +107,8 @@ extern int target_flags; #define TARGET_SWITCHES \ { {"s", 1, N_("Generate H8/S code")}, \ {"no-s", -1, N_("Do not generate H8/S code")}, \ + {"s2600", 2, N_("Generate H8/S2600 code")}, \ + {"no-s2600", -2, N_("Do not generate H8/S2600 code")}, \ {"int32", 8, N_("Make integers 32 bits wide")}, \ {"addresses", 64, NULL}, \ {"quickcall", 128, \ @@ -280,10 +285,10 @@ extern int target_flags; #define REG_ALLOC_ORDER \ { 2, 3, 0, 1, 4, 5, 6, 8, 7, 9} -#define CONDITIONAL_REGISTER_USAGE \ -{ \ - if (!TARGET_H8300S) \ - fixed_regs[8] = call_used_regs[8] = 1;\ +#define CONDITIONAL_REGISTER_USAGE \ +{ \ + if (!TARGET_MAC) \ + fixed_regs[8] = call_used_regs[8] = 1; \ } /* Return number of consecutive hard regs needed starting at reg REGNO diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 290b7addd4f..f75fad509f4 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -819,7 +819,7 @@ (mem:HI (post_inc:SI (match_operand:SI 1 "register_operand" "r")))) (sign_extend:SI (mem:HI (post_inc:SI (match_operand:SI 2 "register_operand" "r"))))))] - "TARGET_H8300S" + "TARGET_MAC" "clrmac\;mac @%2+,@%1+" [(set_attr "length" "6") (set_attr "cc" "none_0hit")]) @@ -832,7 +832,7 @@ (sign_extend:SI (mem:HI (post_inc:SI (match_operand:SI 2 "register_operand" "r"))))) (match_operand:SI 3 "register_operand" "0")))] - "TARGET_H8300S" + "TARGET_MAC" "mac @%2+,@%1+" [(set_attr "length" "4") (set_attr "cc" "none_0hit")]) diff --git a/gcc/invoke.texi b/gcc/invoke.texi index acd8c53b900..be42ad540ea 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -6681,6 +6681,9 @@ Generate code for the H8/300H. @item -ms Generate code for the H8/S. +@item -ms2600 +Generate code for the H8/S2600. This switch must be used with -ms. + @item -mint32 Make @code{int} data 32 bits by default. -- 2.30.2