| 1 |
708 |
jeremybenn |
/* Common hooks for IA64.
|
| 2 |
|
|
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
|
| 3 |
|
|
2009, 2010, 2011
|
| 4 |
|
|
Free Software Foundation, Inc.
|
| 5 |
|
|
|
| 6 |
|
|
This file is part of GCC.
|
| 7 |
|
|
|
| 8 |
|
|
GCC is free software; you can redistribute it and/or modify
|
| 9 |
|
|
it under the terms of the GNU General Public License as published by
|
| 10 |
|
|
the Free Software Foundation; either version 3, or (at your option)
|
| 11 |
|
|
any later version.
|
| 12 |
|
|
|
| 13 |
|
|
GCC is distributed in the hope that it will be useful,
|
| 14 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 15 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 16 |
|
|
GNU General Public License for more details.
|
| 17 |
|
|
|
| 18 |
|
|
You should have received a copy of the GNU General Public License
|
| 19 |
|
|
along with GCC; see the file COPYING3. If not see
|
| 20 |
|
|
<http://www.gnu.org/licenses/>. */
|
| 21 |
|
|
|
| 22 |
|
|
#include "config.h"
|
| 23 |
|
|
#include "system.h"
|
| 24 |
|
|
#include "coretypes.h"
|
| 25 |
|
|
#include "diagnostic-core.h"
|
| 26 |
|
|
#include "tm.h"
|
| 27 |
|
|
#include "tm_p.h"
|
| 28 |
|
|
#include "common/common-target.h"
|
| 29 |
|
|
#include "common/common-target-def.h"
|
| 30 |
|
|
#include "opts.h"
|
| 31 |
|
|
#include "flags.h"
|
| 32 |
|
|
#include "params.h"
|
| 33 |
|
|
|
| 34 |
|
|
/* Implement overriding of the optimization options. */
|
| 35 |
|
|
static const struct default_options ia64_option_optimization_table[] =
|
| 36 |
|
|
{
|
| 37 |
|
|
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
|
| 38 |
|
|
#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
|
| 39 |
|
|
SUBTARGET_OPTIMIZATION_OPTIONS,
|
| 40 |
|
|
#endif
|
| 41 |
|
|
{ OPT_LEVELS_NONE, 0, NULL, 0 }
|
| 42 |
|
|
};
|
| 43 |
|
|
|
| 44 |
|
|
/* Implement TARGET_HANDLE_OPTION. */
|
| 45 |
|
|
|
| 46 |
|
|
static bool
|
| 47 |
|
|
ia64_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
|
| 48 |
|
|
struct gcc_options *opts_set ATTRIBUTE_UNUSED,
|
| 49 |
|
|
const struct cl_decoded_option *decoded,
|
| 50 |
|
|
location_t loc)
|
| 51 |
|
|
{
|
| 52 |
|
|
size_t code = decoded->opt_index;
|
| 53 |
|
|
const char *arg = decoded->arg;
|
| 54 |
|
|
int value = decoded->value;
|
| 55 |
|
|
|
| 56 |
|
|
switch (code)
|
| 57 |
|
|
{
|
| 58 |
|
|
case OPT_mtls_size_:
|
| 59 |
|
|
if (value != 14 && value != 22 && value != 64)
|
| 60 |
|
|
error_at (loc, "bad value %<%s%> for -mtls-size= switch", arg);
|
| 61 |
|
|
return true;
|
| 62 |
|
|
|
| 63 |
|
|
default:
|
| 64 |
|
|
return true;
|
| 65 |
|
|
}
|
| 66 |
|
|
}
|
| 67 |
|
|
|
| 68 |
|
|
/* Implement TARGET_EXCEPT_UNWIND_INFO. */
|
| 69 |
|
|
|
| 70 |
|
|
enum unwind_info_type
|
| 71 |
|
|
ia64_except_unwind_info (struct gcc_options *opts)
|
| 72 |
|
|
{
|
| 73 |
|
|
/* Honor the --enable-sjlj-exceptions configure switch. */
|
| 74 |
|
|
#ifdef CONFIG_UNWIND_EXCEPTIONS
|
| 75 |
|
|
if (CONFIG_UNWIND_EXCEPTIONS)
|
| 76 |
|
|
return UI_SJLJ;
|
| 77 |
|
|
#endif
|
| 78 |
|
|
|
| 79 |
|
|
/* For simplicity elsewhere in this file, indicate that all unwind
|
| 80 |
|
|
info is disabled if we're not emitting unwind tables. */
|
| 81 |
|
|
if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
|
| 82 |
|
|
return UI_NONE;
|
| 83 |
|
|
|
| 84 |
|
|
return UI_TARGET;
|
| 85 |
|
|
}
|
| 86 |
|
|
|
| 87 |
|
|
/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
|
| 88 |
|
|
|
| 89 |
|
|
static void
|
| 90 |
|
|
ia64_option_default_params (void)
|
| 91 |
|
|
{
|
| 92 |
|
|
/* Let the scheduler form additional regions. */
|
| 93 |
|
|
set_default_param_value (PARAM_MAX_SCHED_EXTEND_REGIONS_ITERS, 2);
|
| 94 |
|
|
|
| 95 |
|
|
/* Set the default values for cache-related parameters. */
|
| 96 |
|
|
set_default_param_value (PARAM_SIMULTANEOUS_PREFETCHES, 6);
|
| 97 |
|
|
set_default_param_value (PARAM_L1_CACHE_LINE_SIZE, 32);
|
| 98 |
|
|
|
| 99 |
|
|
set_default_param_value (PARAM_SCHED_MEM_TRUE_DEP_COST, 4);
|
| 100 |
|
|
}
|
| 101 |
|
|
|
| 102 |
|
|
#undef TARGET_OPTION_OPTIMIZATION_TABLE
|
| 103 |
|
|
#define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table
|
| 104 |
|
|
#undef TARGET_OPTION_DEFAULT_PARAMS
|
| 105 |
|
|
#define TARGET_OPTION_DEFAULT_PARAMS ia64_option_default_params
|
| 106 |
|
|
|
| 107 |
|
|
#undef TARGET_EXCEPT_UNWIND_INFO
|
| 108 |
|
|
#define TARGET_EXCEPT_UNWIND_INFO ia64_except_unwind_info
|
| 109 |
|
|
|
| 110 |
|
|
#undef TARGET_DEFAULT_TARGET_FLAGS
|
| 111 |
|
|
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
|
| 112 |
|
|
#undef TARGET_HANDLE_OPTION
|
| 113 |
|
|
#define TARGET_HANDLE_OPTION ia64_handle_option
|
| 114 |
|
|
|
| 115 |
|
|
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
|