Commit 7dd2f19b by Richard Sandiford Committed by Richard Sandiford

sh.c (multcosts): Check sh_multcost rather than sh_multcost_str.

	* config/sh/sh.c (multcosts): Check sh_multcost rather than
	sh_multcost_str.
	(sh_register_move_cost): Likewise sh_gettrcost and sh_gettrcost_str.
	(sh_multcost_str, sh_gettrcost_str, sh_div_str, sh_divsi3_libfunc)
	(cut2_workaround_str): Delete.
	* config/sh/sh.h (SUBTARGET_OPTIONS, TARGET_OPTIONS)
	(TARGET_SH5_CUT2_WORKAROUND, sh_multcost_str, sh_gettrcost_str)
	(sh_div_str, sh_divsi3_libfunc, cut2_workaround_str): Delete.
	* config/sh/sh.opt (mcut2-workaround, mdiv=, mdivsi3_libfunc=)
	(mgettrcost=, multcost=): New options.

From-SVN: r100431
parent 5c60a017
2005-06-01 Richard Sandiford <rsandifo@redhat.com> 2005-06-01 Richard Sandiford <rsandifo@redhat.com>
* config/sh/sh.c (multcosts): Check sh_multcost rather than
sh_multcost_str.
(sh_register_move_cost): Likewise sh_gettrcost and sh_gettrcost_str.
(sh_multcost_str, sh_gettrcost_str, sh_div_str, sh_divsi3_libfunc)
(cut2_workaround_str): Delete.
* config/sh/sh.h (SUBTARGET_OPTIONS, TARGET_OPTIONS)
(TARGET_SH5_CUT2_WORKAROUND, sh_multcost_str, sh_gettrcost_str)
(sh_div_str, sh_divsi3_libfunc, cut2_workaround_str): Delete.
* config/sh/sh.opt (mcut2-workaround, mdiv=, mdivsi3_libfunc=)
(mgettrcost=, multcost=): New options.
2005-06-01 Richard Sandiford <rsandifo@redhat.com>
* opts.h (cl_option_state): New structure. * opts.h (cl_option_state): New structure.
(get_option_state): Declare. (get_option_state): Declare.
* opts.c (get_option_state): New function. * opts.c (get_option_state): New function.
......
...@@ -1965,8 +1965,8 @@ addsubcosts (rtx x) ...@@ -1965,8 +1965,8 @@ addsubcosts (rtx x)
static inline int static inline int
multcosts (rtx x ATTRIBUTE_UNUSED) multcosts (rtx x ATTRIBUTE_UNUSED)
{ {
if (*sh_multcost_str) if (sh_multcost >= 0)
return atoi (sh_multcost_str); return sh_multcost;
if (TARGET_SHMEDIA) if (TARGET_SHMEDIA)
/* ??? We have a mul insn, but it has a latency of three, and doesn't /* ??? We have a mul insn, but it has a latency of three, and doesn't
accept constants. Ideally, we would use a cost of one or two and accept constants. Ideally, we would use a cost of one or two and
...@@ -10069,8 +10069,8 @@ sh_register_move_cost (enum machine_mode mode, ...@@ -10069,8 +10069,8 @@ sh_register_move_cost (enum machine_mode mode,
if (TARGET_SHMEDIA if (TARGET_SHMEDIA
&& ((srcclass) == TARGET_REGS || (srcclass) == SIBCALL_REGS)) && ((srcclass) == TARGET_REGS || (srcclass) == SIBCALL_REGS))
{ {
if (*sh_gettrcost_str) if (sh_gettrcost >= 0)
return atoi (sh_gettrcost_str); return sh_gettrcost;
else if (!TARGET_PT_FIXED) else if (!TARGET_PT_FIXED)
return 100; return 100;
} }
...@@ -11233,11 +11233,6 @@ shmedia_prepare_call_address (rtx fnaddr, int is_sibcall) ...@@ -11233,11 +11233,6 @@ shmedia_prepare_call_address (rtx fnaddr, int is_sibcall)
return fnaddr; return fnaddr;
} }
const char *sh_multcost_str = "";
const char *sh_gettrcost_str = "";
const char *sh_div_str = "";
const char *sh_divsi3_libfunc = "";
const char *cut2_workaround_str = "";
enum sh_divide_strategy_e sh_div_strategy = SH_DIV_STRATEGY_DEFAULT; enum sh_divide_strategy_e sh_div_strategy = SH_DIV_STRATEGY_DEFAULT;
/* This defines the storage for the variable part of a -mboard= option. /* This defines the storage for the variable part of a -mboard= option.
......
...@@ -334,26 +334,6 @@ do { \ ...@@ -334,26 +334,6 @@ do { \
#define TARGET_DEFAULT \ #define TARGET_DEFAULT \
(TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT | TARGET_OPT_DEFAULT) (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT | TARGET_OPT_DEFAULT)
#ifndef SUBTARGET_OPTIONS
#define SUBTARGET_OPTIONS
#endif
#define TARGET_OPTIONS \
{ { "ultcost=", &sh_multcost_str, \
N_("Cost to assume for a multiply insn"), 0 }, \
{ "gettrcost=", &sh_gettrcost_str, \
N_("Cost to assume for gettr insn"), 0 }, \
{ "div=", &sh_div_str, \
N_("division strategy, one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call, inv:call2, inv:fp"), 0 }, \
{ "divsi3_libfunc=", &sh_divsi3_libfunc, \
N_("Specify name for 32 bit signed division function"), 0 }, \
{ "cut2-workaround", &cut2_workaround_str, \
N_("Enable SH5 cut2 workaround"), "\1" }, \
SUBTARGET_OPTIONS \
}
#define TARGET_SH5_CUT2_WORKAROUND (*cut2_workaround_str)
#ifndef SH_MULTILIB_CPU_DEFAULT #ifndef SH_MULTILIB_CPU_DEFAULT
#define SH_MULTILIB_CPU_DEFAULT "m1" #define SH_MULTILIB_CPU_DEFAULT "m1"
#endif #endif
...@@ -3460,12 +3440,6 @@ extern struct rtx_def *sp_switch; ...@@ -3460,12 +3440,6 @@ extern struct rtx_def *sp_switch;
#define SIMULTANEOUS_PREFETCHES 2 #define SIMULTANEOUS_PREFETCHES 2
extern const char *sh_multcost_str;
extern const char *sh_gettrcost_str;
extern const char *sh_div_str;
extern const char *sh_divsi3_libfunc;
extern const char *cut2_workaround_str;
/* FIXME: middle-end support for highpart optimizations is missing. */ /* FIXME: middle-end support for highpart optimizations is missing. */
#define high_life_started reload_in_progress #define high_life_started reload_in_progress
......
...@@ -148,13 +148,29 @@ mbigtable ...@@ -148,13 +148,29 @@ mbigtable
Target Report RejectNegative Mask(BIGTABLE) Target Report RejectNegative Mask(BIGTABLE)
Generate 32-bit offsets in switch tables Generate 32-bit offsets in switch tables
mcut2-workaround
Target RejectNegative Var(TARGET_SH5_CUT2_WORKAROUND)
Enable SH5 cut2 workaround
mdalign mdalign
Target Report RejectNegative Mask(ALIGN_DOUBLE) Target Report RejectNegative Mask(ALIGN_DOUBLE)
Align doubles at 64-bit boundaries Align doubles at 64-bit boundaries
mdiv=
Target RejectNegative Joined Var(sh_div_str) Init("")
Division strategy, one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call, inv:call2, inv:fp
mdivsi3_libfunc=
Target RejectNegative Joined Var(sh_divsi3_libfunc) Init("")
Specify name for 32 bit signed division function
mfmovd mfmovd
Target RejectNegative Mask(FMOVD) Undocumented Target RejectNegative Mask(FMOVD) Undocumented
mgettrcost=
Target RejectNegative Joined UInteger Var(sh_gettrcost) Init(-1)
Cost to assume for gettr insn
mhitachi mhitachi
Target Report RejectNegative Mask(HITACHI) Target Report RejectNegative Mask(HITACHI)
Follow Renesas (formerly Hitachi) / SuperH calling conventions Follow Renesas (formerly Hitachi) / SuperH calling conventions
...@@ -209,6 +225,10 @@ mspace ...@@ -209,6 +225,10 @@ mspace
Target Report RejectNegative Mask(SMALLCODE) Target Report RejectNegative Mask(SMALLCODE)
Deprecated. Use -Os instead Deprecated. Use -Os instead
multcost=
Target RejectNegative Joined UInteger Var(sh_multcost) Init(-1)
Cost to assume for a multiply insn
musermode musermode
Target Report RejectNegative Mask(USERMODE) Target Report RejectNegative Mask(USERMODE)
Generate library function call to invalidate instruction cache entries after fixing trampoline Generate library function call to invalidate instruction cache entries after fixing trampoline
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