* params.c: Include common/common-target.h. Don't include tm.h.
(lang_independent_params): Move from toplev.c.
(global_init_params): New.
* params.h (global_init_params): Declare.
* target.def (default_params): Move to common-target.def.
* toplev.c (lang_independent_options): Remove.
(lang_independent_params): Move to params.c.
(general_init): Use global_init_params.
* common/common-target.def (option_default_params): Move from
target.def.
* common/config/ia64/ia64-common.c: Include params.h.
(ia64_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
from ia64.c.
* common/config/rs6000/rs6000-common.c: Include params.h.
(rs6000_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
from rs6000.c.
* common/config/sh/sh-common.c: Include params.h.
(sh_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
from sh.c.
* common/config/spu/spu-common.c: Include params.h.
(spu_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
from spu.c.
* config/ia64/ia64.c (ia64_option_default_params,
TARGET_OPTION_DEFAULT_PARAMS): Move to ia64-common.c.
* config/rs6000/rs6000.c (rs6000_option_default_params,
TARGET_OPTION_DEFAULT_PARAMS): Move to rs6000-common.c.
* config/sh/sh.c (sh_option_default_params,
TARGET_OPTION_DEFAULT_PARAMS): Move to sh-common.c.
* config/spu/spu.c (spu_option_default_params,
TARGET_OPTION_DEFAULT_PARAMS): Move to spu-common.c.
* Makefile.in (OBJS): Remove params.o.
(OBJS-libcommon-target): Add params.o.
(params.o, $(common_out_object_file)): Update dependencies.
* doc/tm.texi: Regenerate.
From-SVN: r175330
+2011-06-23 Joseph Myers <joseph@codesourcery.com>
+
+ * params.c: Include common/common-target.h. Don't include tm.h.
+ (lang_independent_params): Move from toplev.c.
+ (global_init_params): New.
+ * params.h (global_init_params): Declare.
+ * target.def (default_params): Move to common-target.def.
+ * toplev.c (lang_independent_options): Remove.
+ (lang_independent_params): Move to params.c.
+ (general_init): Use global_init_params.
+ * common/common-target.def (option_default_params): Move from
+ target.def.
+ * common/config/ia64/ia64-common.c: Include params.h.
+ (ia64_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
+ from ia64.c.
+ * common/config/rs6000/rs6000-common.c: Include params.h.
+ (rs6000_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
+ from rs6000.c.
+ * common/config/sh/sh-common.c: Include params.h.
+ (sh_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
+ from sh.c.
+ * common/config/spu/spu-common.c: Include params.h.
+ (spu_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move
+ from spu.c.
+ * config/ia64/ia64.c (ia64_option_default_params,
+ TARGET_OPTION_DEFAULT_PARAMS): Move to ia64-common.c.
+ * config/rs6000/rs6000.c (rs6000_option_default_params,
+ TARGET_OPTION_DEFAULT_PARAMS): Move to rs6000-common.c.
+ * config/sh/sh.c (sh_option_default_params,
+ TARGET_OPTION_DEFAULT_PARAMS): Move to sh-common.c.
+ * config/spu/spu.c (spu_option_default_params,
+ TARGET_OPTION_DEFAULT_PARAMS): Move to spu-common.c.
+ * Makefile.in (OBJS): Remove params.o.
+ (OBJS-libcommon-target): Add params.o.
+ (params.o, $(common_out_object_file)): Update dependencies.
+ * doc/tm.texi: Regenerate.
+
2011-06-23 Alan Modra <amodra@gmail.com>
PR bootstrap/49383
options-save.o \
opts-global.o \
opts.o \
- params.o \
passes.o \
plugin.o \
pointer-set.o \
# Objects in libcommon-target.a, used by drivers and by the core
# compiler and containing target-dependent code.
-OBJS-libcommon-target = $(common_out_object_file) prefix.o opts-common.o \
- options.o vec.o hooks.o common/common-targhooks.o
+OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
+ opts-common.o options.o vec.o hooks.o common/common-targhooks.o
# This lists all host objects for the front ends.
ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \
$(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h $(EXCEPT_H) $(TM_P_H) \
$(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) \
$(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
-params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) \
- $(DIAGNOSTIC_CORE_H)
+params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(COMMON_TARGET_H) \
+ $(PARAMS_H) $(DIAGNOSTIC_CORE_H)
pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H)
hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H)
$(out_file) $(OUTPUT_OPTION)
$(common_out_object_file): $(common_out_file) $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(COMMON_TARGET_H) $(COMMON_TARGET_DEF_H) \
+ coretypes.h $(COMMON_TARGET_H) $(COMMON_TARGET_DEF_H) $(PARAMS_H) \
$(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(OPTS_H) $(TM_H) $(TM_P_H) $(MACHMODE_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
$< $(OUTPUT_OPTION)
"",
const struct default_options *, empty_optimization_table)
+DEFHOOK
+(option_default_params,
+"Set target-dependent default values for @option{--param} settings, using\
+ calls to @code{set_default_param_value}.",
+ void, (void),
+ hook_void_void)
+
/* The initial value of target_flags. */
DEFHOOKPOD
(default_target_flags,
#include "common/common-target-def.h"
#include "opts.h"
#include "flags.h"
+#include "params.h"
/* Implement overriding of the optimization options. */
static const struct default_options ia64_option_optimization_table[] =
return UI_TARGET;
}
+/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
+
+static void
+ia64_option_default_params (void)
+{
+ /* Let the scheduler form additional regions. */
+ set_default_param_value (PARAM_MAX_SCHED_EXTEND_REGIONS_ITERS, 2);
+
+ /* Set the default values for cache-related parameters. */
+ set_default_param_value (PARAM_SIMULTANEOUS_PREFETCHES, 6);
+ set_default_param_value (PARAM_L1_CACHE_LINE_SIZE, 32);
+
+ set_default_param_value (PARAM_SCHED_MEM_TRUE_DEP_COST, 4);
+}
+
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table
+#undef TARGET_OPTION_DEFAULT_PARAMS
+#define TARGET_OPTION_DEFAULT_PARAMS ia64_option_default_params
#undef TARGET_EXCEPT_UNWIND_INFO
#define TARGET_EXCEPT_UNWIND_INFO ia64_except_unwind_info
#include "common/common-target-def.h"
#include "opts.h"
#include "flags.h"
+#include "params.h"
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
static const struct default_options rs6000_option_optimization_table[] =
opts->x_flag_section_anchors = 1;
}
+/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
+
+static void
+rs6000_option_default_params (void)
+{
+ /* Double growth factor to counter reduced min jump length. */
+ set_default_param_value (PARAM_MAX_GROW_COPY_BB_INSNS, 16);
+}
+
/* If not otherwise specified by a target, make 'long double' equivalent to
'double'. */
#undef TARGET_OPTION_INIT_STRUCT
#define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct
+#undef TARGET_OPTION_DEFAULT_PARAMS
+#define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params
+
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table
#include "common/common-target-def.h"
#include "opts.h"
#include "flags.h"
+#include "params.h"
/* Set default optimization options. */
static const struct default_options sh_option_optimization_table[] =
opts->x_flag_finite_math_only = 2;
}
+/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
+static void
+sh_option_default_params (void)
+{
+ set_default_param_value (PARAM_SIMULTANEOUS_PREFETCHES, 2);
+}
+
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE sh_option_optimization_table
#undef TARGET_OPTION_INIT_STRUCT
#define TARGET_OPTION_INIT_STRUCT sh_option_init_struct
+#undef TARGET_OPTION_DEFAULT_PARAMS
+#define TARGET_OPTION_DEFAULT_PARAMS sh_option_default_params
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
#undef TARGET_HANDLE_OPTION
#include "common/common-target-def.h"
#include "opts.h"
#include "flags.h"
+#include "params.h"
static void
spu_option_init_struct (struct gcc_options *opts)
opts->x_flag_rename_registers = 1;
}
+/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
+static void
+spu_option_default_params (void)
+{
+ /* Override some of the default param values. With so many registers
+ larger values are better for these params. */
+ set_default_param_value (PARAM_MAX_PENDING_LIST_LENGTH, 128);
+}
+
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
#undef TARGET_OPTION_INIT_STRUCT
#define TARGET_OPTION_INIT_STRUCT spu_option_init_struct
+#undef TARGET_OPTION_DEFAULT_PARAMS
+#define TARGET_OPTION_DEFAULT_PARAMS spu_option_default_params
+
#undef TARGET_EXCEPT_UNWIND_INFO
#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
static rtx gen_fr_restore_x (rtx, rtx, rtx);
static void ia64_option_override (void);
-static void ia64_option_default_params (void);
static bool ia64_can_eliminate (const int, const int);
static enum machine_mode hfa_element_mode (const_tree, bool);
static void ia64_setup_incoming_varargs (cumulative_args_t, enum machine_mode,
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE ia64_option_override
-#undef TARGET_OPTION_DEFAULT_PARAMS
-#define TARGET_OPTION_DEFAULT_PARAMS ia64_option_default_params
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
return NULL;
}
-/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
-static void
-ia64_option_default_params (void)
-{
- /* Let the scheduler form additional regions. */
- set_default_param_value (PARAM_MAX_SCHED_EXTEND_REGIONS_ITERS, 2);
-
- /* Set the default values for cache-related parameters. */
- set_default_param_value (PARAM_SIMULTANEOUS_PREFETCHES, 6);
- set_default_param_value (PARAM_L1_CACHE_LINE_SIZE, 32);
-
- set_default_param_value (PARAM_SCHED_MEM_TRUE_DEP_COST, 4);
-}
-
/* HP-UX version_id attribute.
For object foo, if the version_id is set to 1234 put out an alias
of '.alias foo "foo{1234}" We can't use "foo{1234}" in anything
static rtx altivec_expand_vec_ext_builtin (tree, rtx);
static int get_element_number (tree, tree);
static void rs6000_option_override (void);
-static void rs6000_option_default_params (void);
static int rs6000_loop_align_max_skip (rtx);
static int first_altivec_reg_to_save (void);
static unsigned int compute_vrsave_mask (void);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE rs6000_option_override
-#undef TARGET_OPTION_DEFAULT_PARAMS
-#define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params
-
#undef TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
#define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \
rs6000_builtin_vectorized_function
return word_mode;
}
-/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
-
-static void
-rs6000_option_default_params (void)
-{
- /* Double growth factor to counter reduced min jump length. */
- set_default_param_value (PARAM_MAX_GROW_COPY_BB_INSNS, 16);
-}
-
/* Handler for the Mathematical Acceleration Subsystem (mass) interface to a
library with vectorized intrinsics. */
static rtx gen_block_redirect (rtx, int, int);
static void sh_reorg (void);
static void sh_option_override (void);
-static void sh_option_default_params (void);
static void output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool);
static rtx frame_insn (rtx);
static rtx push (int);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE sh_option_override
-#undef TARGET_OPTION_DEFAULT_PARAMS
-#define TARGET_OPTION_DEFAULT_PARAMS sh_option_default_params
#undef TARGET_PRINT_OPERAND
#define TARGET_PRINT_OPERAND sh_print_operand
struct gcc_target targetm = TARGET_INITIALIZER;
\f
-\f
-/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
-static void
-sh_option_default_params (void)
-{
- set_default_param_value (PARAM_SIMULTANEOUS_PREFETCHES, 2);
-}
-
/* Implement TARGET_OPTION_OVERRIDE macro. Validate and override
various options, and do some machine dependent initialization. */
static void
/* Prototypes and external defs. */
static void spu_option_override (void);
-static void spu_option_default_params (void);
static void spu_init_builtins (void);
static tree spu_builtin_decl (unsigned, bool);
static bool spu_scalar_mode_supported_p (enum machine_mode mode);
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE spu_option_override
-#undef TARGET_OPTION_DEFAULT_PARAMS
-#define TARGET_OPTION_DEFAULT_PARAMS spu_option_default_params
-
#undef TARGET_CONDITIONAL_REGISTER_USAGE
#define TARGET_CONDITIONAL_REGISTER_USAGE spu_conditional_register_usage
struct gcc_target targetm = TARGET_INITIALIZER;
-/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
-static void
-spu_option_default_params (void)
-{
- /* Override some of the default param values. With so many registers
- larger values are better for these params. */
- set_default_param_value (PARAM_MAX_PENDING_LIST_LENGTH, 128);
-}
-
/* Implement TARGET_OPTION_OVERRIDE. */
static void
spu_option_override (void)
Set target-dependent initial values of fields in @var{opts}.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_OPTION_DEFAULT_PARAMS (void)
+@deftypefn {Common Target Hook} void TARGET_OPTION_DEFAULT_PARAMS (void)
Set target-dependent default values for @option{--param} settings, using calls to @code{set_default_param_value}.
@end deftypefn
/* params.c - Run-time parameters.
- Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
+#include "common/common-target.h"
#include "params.h"
#include "diagnostic-core.h"
default values determined. */
static bool params_finished;
+static const param_info lang_independent_params[] = {
+#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT, MIN, MAX) \
+ { OPTION, DEFAULT, MIN, MAX, HELP },
+#include "params.def"
+#undef DEFPARAM
+ { NULL, 0, 0, 0, NULL }
+};
+
/* Add the N PARAMS to the current list of compiler parameters. */
void
num_compiler_params += n;
}
+/* Add all parameters and default values that can be set in both the
+ driver and the compiler proper. */
+
+void
+global_init_params (void)
+{
+ add_params (lang_independent_params, LAST_PARAM);
+ targetm_common.option_default_params ();
+}
+
/* Note that all parameters have been added and all default values
set. */
extern void set_default_param_value (compiler_param num, int value);
+/* Add all parameters and default values that can be set in both the
+ driver and the compiler proper. */
+
+extern void global_init_params (void);
+
/* Note that all parameters have been added and all default values
set. */
extern void finish_params (void);
void, (void),
hook_void_void)
-DEFHOOK
-(default_params,
-"Set target-dependent default values for @option{--param} settings, using\
- calls to @code{set_default_param_value}.",
- void, (void),
- hook_void_void)
-
/* Function to determine if one function can inline another function. */
#undef HOOK_PREFIX
#define HOOK_PREFIX "TARGET_"
#define this_target_flag_state (&default_target_flag_state)
#endif
-typedef struct
-{
- const char *const string;
- int *const variable;
- const int on_value;
-}
-lang_independent_options;
-
/* The user symbol prefix after having resolved same. */
const char *user_label_prefix;
-static const param_info lang_independent_params[] = {
-#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT, MIN, MAX) \
- { OPTION, DEFAULT, MIN, MAX, HELP },
-#include "params.def"
-#undef DEFPARAM
- { NULL, 0, 0, 0, NULL }
-};
-
/* Output files for assembler code (real compiler output)
and debugging dumps. */
init_reg_sets ();
/* Register the language-independent parameters. */
- add_params (lang_independent_params, LAST_PARAM);
- targetm.target_option.default_params ();
+ global_init_params ();
- /* This must be done after add_params but before argument processing. */
+ /* This must be done after global_init_params but before argument
+ processing. */
init_ggc_heuristics();
init_optimization_passes ();
statistics_early_init ();