Commit 13dd556c by Richard Sandiford Committed by Richard Sandiford

mn10300-protos.h (mn10300_override_options): Declare.

	* config/mn10300/mn10300-protos.h (mn10300_override_options): Declare.
	* config/mn10300/mn10300.h (target_flags, TARGET_MULT_BUG)
	(TARGET_SWITCHES, TARGET_DEFAULT): Delete.
	(processor_type): New enum.
	(mn10300_processor): New variable.
	(TARGET_AM33, TARGET_AM33_2): Redefine in terms of mn10300_processor.
	(PROCESSOR_DEFAULT, OVERRIDE_OPTIONS): New macros.
	* config/mn10300/linux.h (TARGET_SWITCHES, TARGET_DEFAULT): Delete.
	(PROCESSOR_DEFAULT): New macro.
	* config/mn10300/mn10300.c (mn10300_processor): New variable.
	(TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults.
	(mn10300_handle_option, mn10300_override_options): New functions.
	* config/mn10300/mn10300.opt: New file.

From-SVN: r97609
parent c4cdbeb4
2004-04-05 Richard Sandiford <rsandifo@redhat.com>
* config/mn10300/mn10300-protos.h (mn10300_override_options): Declare.
* config/mn10300/mn10300.h (target_flags, TARGET_MULT_BUG)
(TARGET_SWITCHES, TARGET_DEFAULT): Delete.
(processor_type): New enum.
(mn10300_processor): New variable.
(TARGET_AM33, TARGET_AM33_2): Redefine in terms of mn10300_processor.
(PROCESSOR_DEFAULT, OVERRIDE_OPTIONS): New macros.
* config/mn10300/linux.h (TARGET_SWITCHES, TARGET_DEFAULT): Delete.
(PROCESSOR_DEFAULT): New macro.
* config/mn10300/mn10300.c (mn10300_processor): New variable.
(TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults.
(mn10300_handle_option, mn10300_override_options): New functions.
* config/mn10300/mn10300.opt: New file.
2005-04-05 Eric Botcazou <ebotcazou@libertysurf.fr> 2005-04-05 Eric Botcazou <ebotcazou@libertysurf.fr>
Sebastian Pop <sebastian.pop@cri.ensmp.fr> Sebastian Pop <sebastian.pop@cri.ensmp.fr>
......
...@@ -40,15 +40,8 @@ ...@@ -40,15 +40,8 @@
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
%{static:-static}" %{static:-static}"
#undef TARGET_SWITCHES #undef PROCESSOR_DEFAULT
#define TARGET_SWITCHES \ #define PROCESSOR_DEFAULT PROCESSOR_AM33_2
{{ "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 #undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (AM33/2.0 GNU/Linux)"); #define TARGET_VERSION fprintf (stderr, " (AM33/2.0 GNU/Linux)");
......
...@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */
extern void mn10300_va_start (tree, rtx); extern void mn10300_va_start (tree, rtx);
#endif /* TREE_CODE */ #endif /* TREE_CODE */
extern void mn10300_override_options (void);
extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode); extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode);
extern rtx legitimize_pic_address (rtx, rtx); extern rtx legitimize_pic_address (rtx, rtx);
extern int legitimate_pic_operand_p (rtx); extern int legitimate_pic_operand_p (rtx);
......
...@@ -54,6 +54,9 @@ int mn10300_unspec_int_label_counter; ...@@ -54,6 +54,9 @@ int mn10300_unspec_int_label_counter;
symbol names from register names. */ symbol names from register names. */
int mn10300_protect_label; int mn10300_protect_label;
/* The selected processor. */
enum processor_type mn10300_processor = PROCESSOR_DEFAULT;
/* The size of the callee register save area. Right now we save everything /* 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 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. */ speed standpoint, so we want to optimize this sooner or later. */
...@@ -65,6 +68,7 @@ int mn10300_protect_label; ...@@ -65,6 +68,7 @@ int mn10300_protect_label;
|| regs_ever_live[16] || regs_ever_live[17])) || regs_ever_live[16] || regs_ever_live[17]))
static bool mn10300_handle_option (size_t, const char *, int);
static int mn10300_address_cost_1 (rtx, int *); static int mn10300_address_cost_1 (rtx, int *);
static int mn10300_address_cost (rtx); static int mn10300_address_cost (rtx);
static bool mn10300_rtx_costs (rtx, int, int, int *); static bool mn10300_rtx_costs (rtx, int, int, int *);
...@@ -90,6 +94,11 @@ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, ...@@ -90,6 +94,11 @@ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION mn10300_handle_option
#undef TARGET_ENCODE_SECTION_INFO #undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mn10300_encode_section_info #define TARGET_ENCODE_SECTION_INFO mn10300_encode_section_info
...@@ -110,6 +119,37 @@ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, ...@@ -110,6 +119,37 @@ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
static void mn10300_encode_section_info (tree, rtx, int); static void mn10300_encode_section_info (tree, rtx, int);
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
static bool
mn10300_handle_option (size_t code,
const char *arg ATTRIBUTE_UNUSED,
int value)
{
switch (code)
{
case OPT_mam33:
mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300;
return true;
case OPT_mam33_2:
mn10300_processor = (value
? PROCESSOR_AM33_2
: MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT));
return true;
default:
return true;
}
}
/* Implement OVERRIDE_OPTIONS. */
void
mn10300_override_options (void)
{
if (TARGET_AM33)
target_flags &= ~MASK_MULT_BUG;
}
static void static void
mn10300_file_start (void) mn10300_file_start (void)
{ {
......
...@@ -42,46 +42,25 @@ Boston, MA 02111-1307, USA. */ ...@@ -42,46 +42,25 @@ Boston, MA 02111-1307, USA. */
#define CPP_SPEC "%{mam33:-D__AM33__} %{mam33-2:-D__AM33__=2 -D__AM33_2__}" #define CPP_SPEC "%{mam33:-D__AM33__} %{mam33-2:-D__AM33__=2 -D__AM33_2__}"
/* Run-time compilation parameters selecting different hardware subsets. */ extern GTY(()) int mn10300_unspec_int_label_counter;
extern int target_flags; enum processor_type {
PROCESSOR_MN10300,
PROCESSOR_AM33,
PROCESSOR_AM33_2
};
extern GTY(()) int mn10300_unspec_int_label_counter; extern enum processor_type mn10300_processor;
/* Macros used in the machine description to test the flags. */ #define TARGET_AM33 (mn10300_processor >= PROCESSOR_AM33)
#define TARGET_AM33_2 (mn10300_processor == PROCESSOR_AM33_2)
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces, #ifndef PROCESSOR_DEFAULT
each pair being { "NAME", VALUE } #define PROCESSOR_DEFAULT PROCESSOR_MN10300
where VALUE is the bits to set or minus the bits to clear.
An empty string NAME is used to identify the default VALUE. */
/* Generate code to work around mul/mulq bugs on the mn10300. */
#define TARGET_MULT_BUG (target_flags & 0x1)
/* Generate code for the AM33 processor. */
#define TARGET_AM33 (target_flags & 0x2)
/* Generate code for the AM33/2.0 processor. */
#define TARGET_AM33_2 (target_flags & 0x4)
#define TARGET_SWITCHES \
{{ "mult-bug", 0x1, N_("Work around hardware multiply bug")}, \
{ "no-mult-bug", -0x1, N_("Do not work around hardware multiply bug")},\
{ "am33", 0x2, N_("Target the AM33 processor")}, \
{ "am33", -(0x1), ""},\
{ "no-am33", -0x2, ""}, \
{ "no-crt0", 0, N_("No default crt0.o") }, \
{ "am33-2", 0x6, N_("Target the AM33/2.0 processor")}, \
{ "am33-2", -(0x1), ""},\
{ "no-am33-2", -0x4, ""}, \
{ "relax", 0, N_("Enable linker relaxations") }, \
{ "", TARGET_DEFAULT, NULL}}
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT 0x1
#endif #endif
#define OVERRIDE_OPTIONS mn10300_override_options ()
/* Print subsidiary information on the compiler version in use. */ /* Print subsidiary information on the compiler version in use. */
#define TARGET_VERSION fprintf (stderr, " (MN10300)"); #define TARGET_VERSION fprintf (stderr, " (MN10300)");
......
; Options for the Matsushita MN10300 port of the compiler.
; Copyright (C) 2005 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC 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.
;
; GCC 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 GCC; see the file COPYING. If not, write to the Free
; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
; 02111-1307, USA.
mam33
Target
Target the AM33 processor
mam33-2
Target
Target the AM33/2.0 processor
mmult-bug
Target Report Mask(MULT_BUG)
Work around hardware multiply bug
; Ignored by the compiler
mrelax
Target RejectNegative
Enable linker relaxations
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment