diff options
author | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-03 00:59:56 +0000 |
---|---|---|
committer | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-03 00:59:56 +0000 |
commit | 49a1b909a619d6033a9ab02758bc4c88a8bd20ec (patch) | |
tree | 1d92bd9c4ab9004fc0eb4467dd25b32ebaa2f193 /gcc/config/rs6000 | |
parent | 3dbfd0b8d65d7106224be6b765409a3b96c45fd7 (diff) | |
download | gcc-49a1b909a619d6033a9ab02758bc4c88a8bd20ec.tar.gz |
2015-03-02 Michael Meissner <meissner@linux.vnet.ibm.com>
PR 65138/target
* config/rs6000/rs6000-cpus.def (powerpc64le): Add new generic
processor type for 64-bit little endian PowerPC.
* config/rs6000/rs6000.c (rs6000_option_override_internal): If
-mdebug=reg, print TARGET_DEFAULT. Fix logic to use
TARGET_DEFAULT if there is no default cpu. Fix -mdebug=reg
printing built-in mask so it does not pass NULL pointers.
* doc/invoke.texi (IBM RS/6000 and PowerPC options): Document
-mcpu=powerpc64le.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221132 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/rs6000-cpus.def | 1 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 39 |
2 files changed, 25 insertions, 15 deletions
diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def index e94994ab306..9fd565286f2 100644 --- a/gcc/config/rs6000/rs6000-cpus.def +++ b/gcc/config/rs6000/rs6000-cpus.def @@ -193,4 +193,5 @@ RS6000_CPU ("power7", PROCESSOR_POWER7, /* Don't add MASK_ISEL by default */ RS6000_CPU ("power8", PROCESSOR_POWER8, MASK_POWERPC64 | ISA_2_7_MASKS_SERVER) RS6000_CPU ("powerpc", PROCESSOR_POWERPC, 0) RS6000_CPU ("powerpc64", PROCESSOR_POWERPC64, MASK_PPC_GFXOPT | MASK_POWERPC64) +RS6000_CPU ("powerpc64le", PROCESSOR_POWER8, MASK_POWERPC64 | ISA_2_7_MASKS_SERVER) RS6000_CPU ("rs64", PROCESSOR_RS64A, MASK_PPC_GFXOPT | MASK_POWERPC64) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index e72fa654f5f..3171eef2323 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3211,6 +3211,10 @@ rs6000_option_override_internal (bool global_init_p) = ((global_init_p || target_option_default_node == NULL) ? NULL : TREE_TARGET_OPTION (target_option_default_node)); + /* Print defaults. */ + if ((TARGET_DEBUG_REG || TARGET_DEBUG_TARGET) && global_init_p) + rs6000_print_isa_options (stderr, 0, "TARGET_DEFAULT", TARGET_DEFAULT); + /* Remember the explicit arguments. */ if (global_init_p) rs6000_isa_flags_explicit = global_options_set.x_rs6000_isa_flags; @@ -3287,7 +3291,13 @@ rs6000_option_override_internal (bool global_init_p) } else { - const char *default_cpu = (TARGET_POWERPC64 ? "powerpc64" : "powerpc"); + /* PowerPC 64-bit LE requires at least ISA 2.07. */ + const char *default_cpu = ((!TARGET_POWERPC64) + ? "powerpc" + : ((BYTES_BIG_ENDIAN) + ? "powerpc64" + : "powerpc64le")); + rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (default_cpu); have_cpu = false; } @@ -3306,15 +3316,18 @@ rs6000_option_override_internal (bool global_init_p) & set_masks); } else - rs6000_isa_flags |= (processor_target_table[cpu_index].target_enable - & ~rs6000_isa_flags_explicit); + { + /* If no -mcpu=<xxx>, inherit any default options that were cleared via + POWERPC_MASKS. Originally, TARGET_DEFAULT was used to initialize + target_flags via the TARGET_DEFAULT_TARGET_FLAGS hook. When we switched + to using rs6000_isa_flags, we need to do the initialization here. - /* If no -mcpu=<xxx>, inherit any default options that were cleared via - POWERPC_MASKS. Originally, TARGET_DEFAULT was used to initialize - target_flags via the TARGET_DEFAULT_TARGET_FLAGS hook. When we switched - to using rs6000_isa_flags, we need to do the initialization here. */ - if (!have_cpu) - rs6000_isa_flags |= (TARGET_DEFAULT & ~rs6000_isa_flags_explicit); + If there is a TARGET_DEFAULT, use that. Otherwise fall back to using + -mcpu=powerpc, -mcpu=powerpc64, or -mcpu=powerpc64le defaults. */ + HOST_WIDE_INT flags = ((TARGET_DEFAULT) ? TARGET_DEFAULT + : processor_target_table[cpu_index].target_enable); + rs6000_isa_flags |= (flags & ~rs6000_isa_flags_explicit); + } if (rs6000_tune_index >= 0) tune_index = rs6000_tune_index; @@ -4214,12 +4227,8 @@ rs6000_option_override_internal (bool global_init_p) target_flags. */ rs6000_builtin_mask = rs6000_builtin_mask_calculate (); if (TARGET_DEBUG_BUILTIN || TARGET_DEBUG_TARGET) - { - fprintf (stderr, - "new builtin mask = " HOST_WIDE_INT_PRINT_HEX ", ", - rs6000_builtin_mask); - rs6000_print_builtin_options (stderr, 0, NULL, rs6000_builtin_mask); - } + rs6000_print_builtin_options (stderr, 0, "builtin mask", + rs6000_builtin_mask); /* Initialize all of the registers. */ rs6000_init_hard_regno_mode_ok (global_init_p); |