Commit dd51e35a by Joseph Myers Committed by Joseph Myers

mep.c (option_mtiny_specified): Remove.

	* config/mep/mep.c (option_mtiny_specified): Remove.
	(mep_option_override): Move register handling for -mivc2 from
	mep_handle_option.  Use global_options_set.x_mep_tiny_cutoff
	instead of option_mtiny_specified.
	(mep_handle_option): Access target_flags via opts pointer.  Don't
	assert that global structures are in use.  Defer part of -mivc2
	handling and move it to mep_option_override.
	* config/mep/mep.opt (IVC2): New Mask entry.
	(mivc2): Use Var and Defer instead of Mask.

From-SVN: r171328
parent 4a8d3d91
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/mep/mep.c (option_mtiny_specified): Remove.
(mep_option_override): Move register handling for -mivc2 from
mep_handle_option. Use global_options_set.x_mep_tiny_cutoff
instead of option_mtiny_specified.
(mep_handle_option): Access target_flags via opts pointer. Don't
assert that global structures are in use. Defer part of -mivc2
handling and move it to mep_option_override.
* config/mep/mep.opt (IVC2): New Mask entry.
(mivc2): Use Var and Defer instead of Mask.
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/v850/v850-opts.h: New.
* config/v850/v850.c (small_memory): Replace with
small_memory_physical_max array. Make that array static const.
......
......@@ -268,8 +268,6 @@ static const int mep_cmov_insns[] = {
mep_cor3
};
static int option_mtiny_specified = 0;
static void
mep_set_leaf_registers (int enable)
......@@ -316,6 +314,58 @@ static const struct default_options mep_option_optimization_table[] =
static void
mep_option_override (void)
{
unsigned int i;
int j;
cl_deferred_option *opt;
VEC(cl_deferred_option,heap) *vec
= (VEC(cl_deferred_option,heap) *) mep_deferred_options;
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
{
switch (opt->opt_index)
{
case OPT_mivc2:
for (j = 0; j < 32; j++)
fixed_regs[j + 48] = 0;
for (j = 0; j < 32; j++)
call_used_regs[j + 48] = 1;
for (j = 6; j < 8; j++)
call_used_regs[j + 48] = 0;
#define RN(n,s) reg_names[FIRST_CCR_REGNO + n] = s
RN (0, "$csar0");
RN (1, "$cc");
RN (4, "$cofr0");
RN (5, "$cofr1");
RN (6, "$cofa0");
RN (7, "$cofa1");
RN (15, "$csar1");
RN (16, "$acc0_0");
RN (17, "$acc0_1");
RN (18, "$acc0_2");
RN (19, "$acc0_3");
RN (20, "$acc0_4");
RN (21, "$acc0_5");
RN (22, "$acc0_6");
RN (23, "$acc0_7");
RN (24, "$acc1_0");
RN (25, "$acc1_1");
RN (26, "$acc1_2");
RN (27, "$acc1_3");
RN (28, "$acc1_4");
RN (29, "$acc1_5");
RN (30, "$acc1_6");
RN (31, "$acc1_7");
#undef RN
break;
default:
gcc_unreachable ();
}
}
if (flag_pic == 1)
warning (OPT_fpic, "-fpic is not supported");
if (flag_pic == 2)
......@@ -326,9 +376,9 @@ mep_option_override (void)
error ("only one of -ms and -ml may be given");
if (TARGET_M && TARGET_L)
error ("only one of -mm and -ml may be given");
if (TARGET_S && option_mtiny_specified)
if (TARGET_S && global_options_set.x_mep_tiny_cutoff)
error ("only one of -ms and -mtiny= may be given");
if (TARGET_M && option_mtiny_specified)
if (TARGET_M && global_options_set.x_mep_tiny_cutoff)
error ("only one of -mm and -mtiny= may be given");
if (TARGET_OPT_CLIP && ! TARGET_OPT_MINMAX)
warning (0, "-mclip currently has no effect without -mminmax");
......@@ -345,7 +395,7 @@ mep_option_override (void)
mep_tiny_cutoff = 65536;
if (TARGET_M)
mep_tiny_cutoff = 0;
if (TARGET_L && ! option_mtiny_specified)
if (TARGET_L && ! global_options_set.x_mep_tiny_cutoff)
mep_tiny_cutoff = 0;
if (TARGET_64BIT_CR_REGS)
......@@ -7260,76 +7310,36 @@ mep_address_cost (rtx addr ATTRIBUTE_UNUSED, bool ATTRIBUTE_UNUSED speed_p)
}
static bool
mep_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
mep_handle_option (struct gcc_options *opts,
struct gcc_options *opts_set ATTRIBUTE_UNUSED,
const struct cl_decoded_option *decoded,
location_t loc ATTRIBUTE_UNUSED)
{
int i;
size_t code = decoded->opt_index;
gcc_assert (opts == &global_options);
gcc_assert (opts_set == &global_options_set);
switch (code)
{
case OPT_mall_opts:
target_flags |= MEP_ALL_OPTS;
opts->x_target_flags |= MEP_ALL_OPTS;
break;
case OPT_mno_opts:
target_flags &= ~ MEP_ALL_OPTS;
opts->x_target_flags &= ~ MEP_ALL_OPTS;
break;
case OPT_mcop64:
target_flags |= MASK_COP;
target_flags |= MASK_64BIT_CR_REGS;
opts->x_target_flags |= MASK_COP;
opts->x_target_flags |= MASK_64BIT_CR_REGS;
break;
case OPT_mtiny_:
option_mtiny_specified = 1;
case OPT_mivc2:
target_flags |= MASK_COP;
target_flags |= MASK_64BIT_CR_REGS;
target_flags |= MASK_VLIW;
target_flags |= MASK_OPT_VL64;
target_flags |= MASK_IVC2;
for (i=0; i<32; i++)
fixed_regs[i+48] = 0;
for (i=0; i<32; i++)
call_used_regs[i+48] = 1;
for (i=6; i<8; i++)
call_used_regs[i+48] = 0;
#define RN(n,s) reg_names[FIRST_CCR_REGNO + n] = s
RN (0, "$csar0");
RN (1, "$cc");
RN (4, "$cofr0");
RN (5, "$cofr1");
RN (6, "$cofa0");
RN (7, "$cofa1");
RN (15, "$csar1");
RN (16, "$acc0_0");
RN (17, "$acc0_1");
RN (18, "$acc0_2");
RN (19, "$acc0_3");
RN (20, "$acc0_4");
RN (21, "$acc0_5");
RN (22, "$acc0_6");
RN (23, "$acc0_7");
RN (24, "$acc1_0");
RN (25, "$acc1_1");
RN (26, "$acc1_2");
RN (27, "$acc1_3");
RN (28, "$acc1_4");
RN (29, "$acc1_5");
RN (30, "$acc1_6");
RN (31, "$acc1_7");
#undef RN
opts->x_target_flags |= MASK_COP;
opts->x_target_flags |= MASK_64BIT_CR_REGS;
opts->x_target_flags |= MASK_VLIW;
opts->x_target_flags |= MASK_OPT_VL64;
opts->x_target_flags |= MASK_IVC2;
/* Remaining handling of this option deferred. */
break;
default:
......
; Target specific command line options for the MEP port of the compiler.
; Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
; Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
; Contributed by Red Hat Inc.
;
; GCC is free software; you can redistribute it and/or modify it under
......@@ -16,6 +16,8 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>. */
Mask(IVC2)
mabsdiff
Target Mask(OPT_ABSDIFF)
Enable absolute difference instructions
......@@ -61,7 +63,7 @@ Target Mask(64BIT_CR_REGS) RejectNegative
Enable MeP Coprocessor with 64-bit registers
mivc2
Target Mask(IVC2) RejectNegative
Target RejectNegative Var(mep_deferred_options) Defer
Enable IVC2 scheduling
mdc
......
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