Commit cd8d8754 by Joseph Myers Committed by Joseph Myers

mn10300-opts.h: New.

	* config/mn10300/mn10300-opts.h: New.
	* config/mn10300/mn10300.c (mn10300_processor,
	mn10300_tune_string): Remove.
	(mn10300_handle_option): Don't assert that global structures are
	in use.  Access mn10300_processor via opts pointer.  Don't handle
	OPT_mtune_ here.
	* config/mn10300/mn10300.h (enum processor_type): Move to
	mn10300-opts.h.
	(mn10300_processor): Remove.
	* config/mn10300/mn10300.opt (config/mn10300/mn10300-opts.h): New
	HeaderInclude entry.
	(mn10300_processor): New Variable entry.
	(mtune=): Use Var.

From-SVN: r171323
parent 24e6e6b1
2011-03-22 Joseph Myers <joseph@codesourcery.com> 2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/mn10300/mn10300-opts.h: New.
* config/mn10300/mn10300.c (mn10300_processor,
mn10300_tune_string): Remove.
(mn10300_handle_option): Don't assert that global structures are
in use. Access mn10300_processor via opts pointer. Don't handle
OPT_mtune_ here.
* config/mn10300/mn10300.h (enum processor_type): Move to
mn10300-opts.h.
(mn10300_processor): Remove.
* config/mn10300/mn10300.opt (config/mn10300/mn10300-opts.h): New
HeaderInclude entry.
(mn10300_processor): New Variable entry.
(mtune=): Use Var.
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/microblaze/microblaze.c: Don't include opts.h. * config/microblaze/microblaze.c: Don't include opts.h.
(microblaze_handle_option, TARGET_HANDLE_OPTION): Remove. (microblaze_handle_option, TARGET_HANDLE_OPTION): Remove.
* config/microblaze/microblaze.opt (mxl-stack-check): Use Warn. * config/microblaze/microblaze.opt (mxl-stack-check): Use Warn.
......
/* Definitions for option handling for Matsushita MN10300 series.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
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
<http://www.gnu.org/licenses/>. */
#ifndef MN10300_OPTS_H
#define MN10300_OPTS_H
enum processor_type
{
PROCESSOR_MN10300,
PROCESSOR_AM33,
PROCESSOR_AM33_2,
PROCESSOR_AM34
};
#endif
...@@ -52,12 +52,6 @@ ...@@ -52,12 +52,6 @@
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;
/* Processor type to select for tuning. */
static const char * mn10300_tune_string = NULL;
/* Selected processor type for tuning. */ /* Selected processor type for tuning. */
enum processor_type mn10300_tune_cpu = PROCESSOR_DEFAULT; enum processor_type mn10300_tune_cpu = PROCESSOR_DEFAULT;
...@@ -91,35 +85,28 @@ static int cc_flags_for_code(enum rtx_code); ...@@ -91,35 +85,28 @@ static int cc_flags_for_code(enum rtx_code);
/* Implement TARGET_HANDLE_OPTION. */ /* Implement TARGET_HANDLE_OPTION. */
static bool static bool
mn10300_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, mn10300_handle_option (struct gcc_options *opts,
struct gcc_options *opts_set ATTRIBUTE_UNUSED,
const struct cl_decoded_option *decoded, const struct cl_decoded_option *decoded,
location_t loc ATTRIBUTE_UNUSED) location_t loc ATTRIBUTE_UNUSED)
{ {
size_t code = decoded->opt_index; size_t code = decoded->opt_index;
const char *arg = decoded->arg;
int value = decoded->value; int value = decoded->value;
gcc_assert (opts == &global_options);
gcc_assert (opts_set == &global_options_set);
switch (code) switch (code)
{ {
case OPT_mam33: case OPT_mam33:
mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300; opts->x_mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300;
return true; return true;
case OPT_mam33_2: case OPT_mam33_2:
mn10300_processor = (value opts->x_mn10300_processor = (value
? PROCESSOR_AM33_2 ? PROCESSOR_AM33_2
: MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT)); : MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT));
return true; return true;
case OPT_mam34: case OPT_mam34:
mn10300_processor = (value ? PROCESSOR_AM34 : PROCESSOR_DEFAULT); opts->x_mn10300_processor = (value ? PROCESSOR_AM34 : PROCESSOR_DEFAULT);
return true;
case OPT_mtune_:
mn10300_tune_string = arg;
return true; return true;
default: default:
......
/* Definitions of target machine for GNU compiler. /* Definitions of target machine for GNU compiler.
Matsushita MN10300 series Matsushita MN10300 series
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2007, 2008, 2009, 2010 Free Software Foundation, Inc. 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com). Contributed by Jeff Law (law@cygnus.com).
This file is part of GCC. This file is part of GCC.
...@@ -57,15 +57,10 @@ ...@@ -57,15 +57,10 @@
} \ } \
while (0) while (0)
enum processor_type #ifndef MN10300_OPTS_H
{ #include "config/mn10300/mn10300-opts.h"
PROCESSOR_MN10300, #endif
PROCESSOR_AM33,
PROCESSOR_AM33_2,
PROCESSOR_AM34
};
extern enum processor_type mn10300_processor;
extern enum processor_type mn10300_tune_cpu; extern enum processor_type mn10300_tune_cpu;
#define TARGET_AM33 (mn10300_processor >= PROCESSOR_AM33) #define TARGET_AM33 (mn10300_processor >= PROCESSOR_AM33)
......
...@@ -18,6 +18,13 @@ ...@@ -18,6 +18,13 @@
; along with GCC; see the file COPYING3. If not see ; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>. ; <http://www.gnu.org/licenses/>.
HeaderInclude
config/mn10300/mn10300-opts.h
; The selected processor.
Variable
enum processor_type mn10300_processor = PROCESSOR_DEFAULT
mam33 mam33
Target Target
Target the AM33 processor Target the AM33 processor
...@@ -31,7 +38,7 @@ Target Report ...@@ -31,7 +38,7 @@ Target Report
Target the AM34 processor Target the AM34 processor
mtune= mtune=
Target RejectNegative Joined Target RejectNegative Joined Var(mn10300_tune_string)
Tune code for the given processor Tune code for the given processor
mmult-bug mmult-bug
......
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