comparison gcc/common/config/rs6000/rs6000-common.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Common hooks for IBM RS/6000. 1 /* Common hooks for IBM RS/6000.
2 Copyright (C) 1991-2018 Free Software Foundation, Inc. 2 Copyright (C) 1991-2020 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it 6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published 7 under the terms of the GNU General Public License as published
24 #include "tm.h" 24 #include "tm.h"
25 #include "common/common-target.h" 25 #include "common/common-target.h"
26 #include "common/common-target-def.h" 26 #include "common/common-target-def.h"
27 #include "opts.h" 27 #include "opts.h"
28 #include "flags.h" 28 #include "flags.h"
29 #include "params.h"
30 29
31 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ 30 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
32 static const struct default_options rs6000_option_optimization_table[] = 31 static const struct default_options rs6000_option_optimization_table[] =
33 { 32 {
33 /* Split multi-word types early. */
34 { OPT_LEVELS_ALL, OPT_fsplit_wide_types_early, NULL, 1 },
34 /* Enable -fsched-pressure for first pass instruction scheduling. */ 35 /* Enable -fsched-pressure for first pass instruction scheduling. */
35 { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, 36 { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 },
37 /* Enable -munroll-only-small-loops with -funroll-loops to unroll small
38 loops at -O2 and above by default. */
39 { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_funroll_loops, NULL, 1 },
40 { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_munroll_only_small_loops, NULL, 1 },
41 /* -fweb and -frename-registers are useless in general for rs6000,
42 turn them off. */
43 { OPT_LEVELS_ALL, OPT_fweb, NULL, 0 },
44 { OPT_LEVELS_ALL, OPT_frename_registers, NULL, 0 },
45
46 /* Double growth factor to counter reduced min jump length. */
47 { OPT_LEVELS_ALL, OPT__param_max_grow_copy_bb_insns_, NULL, 16 },
36 { OPT_LEVELS_NONE, 0, NULL, 0 } 48 { OPT_LEVELS_NONE, 0, NULL, 0 }
37 }; 49 };
38 50
39 /* Implement TARGET_OPTION_INIT_STRUCT. */ 51 /* Implement TARGET_OPTION_INIT_STRUCT. */
40 52
56 point in a function, without having to analyze the executable code (which 68 point in a function, without having to analyze the executable code (which
57 isn't even possible to do in the general case). */ 69 isn't even possible to do in the general case). */
58 #ifdef OBJECT_FORMAT_ELF 70 #ifdef OBJECT_FORMAT_ELF
59 opts->x_flag_asynchronous_unwind_tables = 1; 71 opts->x_flag_asynchronous_unwind_tables = 1;
60 #endif 72 #endif
61 }
62
63 /* Implement TARGET_OPTION_DEFAULT_PARAMS. */
64
65 static void
66 rs6000_option_default_params (void)
67 {
68 /* Double growth factor to counter reduced min jump length. */
69 set_default_param_value (PARAM_MAX_GROW_COPY_BB_INSNS, 16);
70 } 73 }
71 74
72 /* If not otherwise specified by a target, make 'long double' equivalent to 75 /* If not otherwise specified by a target, make 'long double' equivalent to
73 'double'. */ 76 'double'. */
74 77
176 else if (! strcmp (q, "target")) 179 else if (! strcmp (q, "target"))
177 mask = MASK_DEBUG_TARGET; 180 mask = MASK_DEBUG_TARGET;
178 else if (! strcmp (q, "builtin")) 181 else if (! strcmp (q, "builtin"))
179 mask = MASK_DEBUG_BUILTIN; 182 mask = MASK_DEBUG_BUILTIN;
180 else 183 else
181 error_at (loc, "unknown -mdebug-%s switch", q); 184 error_at (loc, "unknown %<-mdebug-%s%> switch", q);
182 185
183 if (invert) 186 if (invert)
184 opts->x_rs6000_debug &= ~mask; 187 opts->x_rs6000_debug &= ~mask;
185 else 188 else
186 opts->x_rs6000_debug |= mask; 189 opts->x_rs6000_debug |= mask;
215 #endif 218 #endif
216 219
217 case OPT_mlong_double_: 220 case OPT_mlong_double_:
218 if (value != 64 && value != 128) 221 if (value != 64 && value != 128)
219 { 222 {
220 error_at (loc, "unknown switch -mlong-double-%s", arg); 223 error_at (loc, "unknown switch %<-mlong-double-%s%>", arg);
221 opts->x_rs6000_long_double_type_size 224 opts->x_rs6000_long_double_type_size
222 = RS6000_DEFAULT_LONG_DOUBLE_SIZE; 225 = RS6000_DEFAULT_LONG_DOUBLE_SIZE;
223 return false; 226 return false;
224 } 227 }
225 break; 228 break;
260 #define TARGET_HANDLE_OPTION rs6000_handle_option 263 #define TARGET_HANDLE_OPTION rs6000_handle_option
261 264
262 #undef TARGET_OPTION_INIT_STRUCT 265 #undef TARGET_OPTION_INIT_STRUCT
263 #define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct 266 #define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct
264 267
265 #undef TARGET_OPTION_DEFAULT_PARAMS
266 #define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params
267
268 #undef TARGET_OPTION_OPTIMIZATION_TABLE 268 #undef TARGET_OPTION_OPTIMIZATION_TABLE
269 #define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table 269 #define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table
270 270
271 #undef TARGET_SUPPORTS_SPLIT_STACK 271 #undef TARGET_SUPPORTS_SPLIT_STACK
272 #define TARGET_SUPPORTS_SPLIT_STACK rs6000_supports_split_stack 272 #define TARGET_SUPPORTS_SPLIT_STACK rs6000_supports_split_stack