From e24b8335fad88c8aeb933f6a2ef3c5f0c877a7a0 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 22 Mar 2011 22:34:42 +0000 Subject: [PATCH] iq2000-opts.h: New. * config/iq2000/iq2000-opts.h: New. * config/iq2000/iq2000.c: Don't include opts.h. (iq2000_tune, iq2000_handle_option, TARGET_HANDLE_OPTION): Remove. * config/iq2000/iq2000.h (enum processor_type, iq2000_tune): Remove. * config/iq2000/iq2000.opt (config/iq2000/iq2000-opts.h): New HeaderInclude entry. (iq2000_tune): New Variable entry. (march=): Add comment. Use Enum. (iq2000_arch): New Enum and EnumValue entries. (mcpu=): Use Enum and Var. (iq2000_tune): New Enum and EnumValue entries. From-SVN: r171318 --- gcc/ChangeLog | 15 +++++++++++ gcc/config/iq2000/iq2000-opts.h | 33 ++++++++++++++++++++++++ gcc/config/iq2000/iq2000.c | 45 --------------------------------- gcc/config/iq2000/iq2000.h | 14 +--------- gcc/config/iq2000/iq2000.opt | 36 +++++++++++++++++++++++--- 5 files changed, 82 insertions(+), 61 deletions(-) create mode 100644 gcc/config/iq2000/iq2000-opts.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9c325ca287..ad50dd2914c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2011-03-22 Joseph Myers + + * config/iq2000/iq2000-opts.h: New. + * config/iq2000/iq2000.c: Don't include opts.h. + (iq2000_tune, iq2000_handle_option, TARGET_HANDLE_OPTION): Remove. + * config/iq2000/iq2000.h (enum processor_type, iq2000_tune): + Remove. + * config/iq2000/iq2000.opt (config/iq2000/iq2000-opts.h): New + HeaderInclude entry. + (iq2000_tune): New Variable entry. + (march=): Add comment. Use Enum. + (iq2000_arch): New Enum and EnumValue entries. + (mcpu=): Use Enum and Var. + (iq2000_tune): New Enum and EnumValue entries. + 2011-03-22 Joseph Myers * config/ia64/ia64-opts.h: New. diff --git a/gcc/config/iq2000/iq2000-opts.h b/gcc/config/iq2000/iq2000-opts.h new file mode 100644 index 00000000000..8cc44b60741 --- /dev/null +++ b/gcc/config/iq2000/iq2000-opts.h @@ -0,0 +1,33 @@ +/* Definitions for option handling for Vitesse IQ2000 processors. + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 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 3, 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 COPYING3. If not see + . */ + +#ifndef IQ2000_OPTS_H +#define IQ2000_OPTS_H + +/* Which processor to schedule for. */ + +enum processor_type +{ + PROCESSOR_DEFAULT, + PROCESSOR_IQ2000, + PROCESSOR_IQ10 +}; + +#endif diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index ca949e23a13..2d6908545db 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -45,7 +45,6 @@ along with GCC; see the file COPYING3. If not see #include "target-def.h" #include "langhooks.h" #include "df.h" -#include "opts.h" /* Enumeration for all of the relational tests, so that we can build arrays indexed by the test type, and not worry about the order @@ -112,9 +111,6 @@ struct GTY(()) machine_function /* List of all IQ2000 punctuation characters used by iq2000_print_operand. */ static char iq2000_print_operand_punct[256]; -/* The target cpu for optimization and scheduling. */ -enum processor_type iq2000_tune; - /* Which instruction set architecture to use. */ int iq2000_isa; @@ -146,10 +142,6 @@ static enum machine_mode gpr_mode; /* Initialize the GCC target structure. */ static struct machine_function* iq2000_init_machine_status (void); -static bool iq2000_handle_option (struct gcc_options *, - struct gcc_options *, - const struct cl_decoded_option *, - location_t); static void iq2000_option_override (void); static section *iq2000_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT); @@ -197,8 +189,6 @@ static const struct default_options iq2000_option_optimization_table[] = #define TARGET_EXPAND_BUILTIN iq2000_expand_builtin #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section -#undef TARGET_HANDLE_OPTION -#define TARGET_HANDLE_OPTION iq2000_handle_option #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE iq2000_option_override #undef TARGET_OPTION_OPTIMIZATION_TABLE @@ -1438,41 +1428,6 @@ iq2000_init_machine_status (void) return ggc_alloc_cleared_machine_function (); } -/* Implement TARGET_HANDLE_OPTION. */ - -static bool -iq2000_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, - const struct cl_decoded_option *decoded, - location_t loc ATTRIBUTE_UNUSED) -{ - size_t code = decoded->opt_index; - const char *arg = decoded->arg; - - gcc_assert (opts == &global_options); - gcc_assert (opts_set == &global_options_set); - - switch (code) - { - case OPT_mcpu_: - if (strcmp (arg, "iq10") == 0) - iq2000_tune = PROCESSOR_IQ10; - else if (strcmp (arg, "iq2000") == 0) - iq2000_tune = PROCESSOR_IQ2000; - else - return false; - return true; - - case OPT_march_: - /* This option has no effect at the moment. */ - return (strcmp (arg, "default") == 0 - || strcmp (arg, "DEFAULT") == 0 - || strcmp (arg, "iq2000") == 0); - - default: - return true; - } -} - /* Detect any conflicts in the switches. */ static void diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h index 7f69d2a12b9..62cddea444e 100644 --- a/gcc/config/iq2000/iq2000.h +++ b/gcc/config/iq2000/iq2000.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Vitesse IQ2000 processors - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -609,15 +609,6 @@ enum delay_type DELAY_FCMP /* Delay after doing c..{d,s}. */ }; -/* Which processor to schedule for. */ - -enum processor_type -{ - PROCESSOR_DEFAULT, - PROCESSOR_IQ2000, - PROCESSOR_IQ10 -}; - /* Recast the cpu class to be the cpu attribute. */ #define iq2000_cpu_attr ((enum attr_cpu) iq2000_tune) @@ -850,9 +841,6 @@ enum processor_type #define SDATA_SECTION_ASM_OP "\t.sdata" /* Small data. */ -/* The target cpu for optimization and scheduling. */ -extern enum processor_type iq2000_tune; - /* Which instruction set architecture to use. */ extern int iq2000_isa; diff --git a/gcc/config/iq2000/iq2000.opt b/gcc/config/iq2000/iq2000.opt index 7ca61424f35..bfd8dcc43ca 100644 --- a/gcc/config/iq2000/iq2000.opt +++ b/gcc/config/iq2000/iq2000.opt @@ -1,6 +1,6 @@ ; Options for the Vitesse IQ2000 port of the compiler. -; Copyright (C) 2005, 2007 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -18,14 +18,44 @@ ; along with GCC; see the file COPYING3. If not see ; . +HeaderInclude +config/iq2000/iq2000-opts.h + +; The target cpu for optimization and scheduling. +Variable +enum processor_type iq2000_tune + +; This option has no effect at the moment. march= -Target RejectNegative Joined +Target RejectNegative Joined Enum(iq2000_arch) Specify CPU for code generation purposes +Enum +Name(iq2000_arch) Type(int) + +EnumValue +Enum(iq2000_arch) String(default) Value(0) + +EnumValue +Enum(iq2000_arch) String(DEFAULT) Value(0) + +EnumValue +Enum(iq2000_arch) String(iq2000) Value(0) + mcpu= -Target RejectNegative Joined +Target RejectNegative Joined Enum(iq2000_tune) Var(iq2000_tune) Specify CPU for scheduling purposes +Enum +Name(iq2000_tune) Type(enum processor_type) +Known IQ2000 CPUs (for use with the -mcpu= option): + +EnumValue +Enum(iq2000_tune) String(iq10) Value(PROCESSOR_IQ10) + +EnumValue +Enum(iq2000_tune) String(iq2000) Value(PROCESSOR_IQ2000) + membedded-data Target Mask(EMBEDDED_DATA) Use ROM instead of RAM -- 2.30.2