+2015-03-05 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from trunk
+ 2015-03-03 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.
+
+ * config/rs6000/rs6000-tables.opt: Regenerate.
+
+ * doc/invoke.texi (IBM RS/6000 and PowerPC options): Document
+ -mcpu=powerpc64le.
+
+ Backport from trunk
+ 2015-01-19 David Edelsohn <dje.gcc@gmail.com>
+
+ * config/rs6000/default64.h: Include rs6000-cpus.def.
+ (TARGET_DEFAULT) [LITTLE_ENDIAN]: Use ISA 2.7 (POWER8).
+ (TARGET_DEFAULT) [BIG_ENDIAN]: Use POWER4.
+ * config/rs6000/driver-rs6000.c (detect_processor_aix): Add POWER7
+ and POWER8.
+ * config/rs6000/linux64.h (PROCESSOR_DEFAULT64): Always default to
+ POWER8.
+ * config/rs6000/rs6000.c (rs6000_file_start): Emit .machine
+ pseudo-op to specify assembler dialect.
+
2015-03-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
Backport from mainline
/* Definitions of target machine for GNU compiler,
for 64 bit powerpc linux defaulting to -m64.
- Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003-2015 Free Software Foundation, Inc.
This file is part of GCC.
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define RS6000_CPU(NAME, CPU, FLAGS)
+#include "rs6000-cpus.def"
+#undef RS6000_CPU
+
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_64BIT | MASK_LITTLE_ENDIAN)
+#define TARGET_DEFAULT (ISA_2_7_MASKS_SERVER | MASK_POWERPC64 | MASK_64BIT | MASK_LITTLE_ENDIAN)
#else
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_64BIT)
+#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64 | MASK_64BIT)
#endif
/* Subroutines for the gcc driver.
- Copyright (C) 2007-2013 Free Software Foundation, Inc.
+ Copyright (C) 2007-2015 Free Software Foundation, Inc.
This file is part of GCC.
case 0x4000:
return "power6";
+ case 0x8000:
+ return "power7";
+
+ case 0x10000:
+ return "power8";
+
default:
return "powerpc";
}
/* Definitions of target machine for GNU compiler,
for 64 bit PowerPC linux.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 2000-2015 Free Software Foundation, Inc.
This file is part of GCC.
#undef PROCESSOR_DEFAULT
#define PROCESSOR_DEFAULT PROCESSOR_POWER7
#undef PROCESSOR_DEFAULT64
-#ifdef LINUX64_DEFAULT_ABI_ELFv2
#define PROCESSOR_DEFAULT64 PROCESSOR_POWER8
-#else
-#define PROCESSOR_DEFAULT64 PROCESSOR_POWER7
-#endif
/* We don't need to generate entries in .fixup, except when
-mrelocatable or -mrelocatable-lib is given. */
/* IBM RS/6000 CPU names..
- Copyright (C) 1991-2013 Free Software Foundation, Inc.
+ Copyright (C) 1991-2015 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
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)
Enum(rs6000_cpu_opt_value) String(powerpc64) Value(52)
EnumValue
-Enum(rs6000_cpu_opt_value) String(rs64) Value(53)
+Enum(rs6000_cpu_opt_value) String(powerpc64le) Value(53)
+
+EnumValue
+Enum(rs6000_cpu_opt_value) String(rs64) Value(54)
/* Subroutines used for code generation on IBM RS/6000.
- Copyright (C) 1991-2014 Free Software Foundation, Inc.
+ Copyright (C) 1991-2015 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
}
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;
}
& 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;
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);
switch_to_section (toc_section);
switch_to_section (text_section);
}
+
+#ifdef USING_ELFOS_H
+ if (rs6000_default_cpu == 0 || rs6000_default_cpu[0] == '\0'
+ || !global_options_set.x_rs6000_cpu_index)
+ {
+ fputs ("\t.machine ", asm_out_file);
+ if ((rs6000_isa_flags & OPTION_MASK_DIRECT_MOVE) != 0)
+ fputs ("power8\n", asm_out_file);
+ else if ((rs6000_isa_flags & OPTION_MASK_POPCNTD) != 0)
+ fputs ("power7\n", asm_out_file);
+ else if ((rs6000_isa_flags & OPTION_MASK_CMPB) != 0)
+ fputs ("power6\n", asm_out_file);
+ else if ((rs6000_isa_flags & OPTION_MASK_POPCNTB) != 0)
+ fputs ("power5\n", asm_out_file);
+ else if ((rs6000_isa_flags & OPTION_MASK_MFCRF) != 0)
+ fputs ("power4\n", asm_out_file);
+ else if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) != 0)
+ fputs ("ppc64\n", asm_out_file);
+ else
+ fputs ("ppc\n", asm_out_file);
+ }
+#endif
}
\f
-@c Copyright (C) 1988-2013 Free Software Foundation, Inc.
+@c Copyright (C) 1988-2015 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
@samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
@samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
-@samp{powerpc64}, and @samp{rs64}.
+@samp{powerpc64}, @samp{powerpc64le}, and @samp{rs64}.
-@option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
-PowerPC and 64-bit PowerPC architecture machine
-types, with an appropriate, generic processor model assumed for
-scheduling purposes.
+@option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
+@option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
+endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
+architecture machine types, with an appropriate, generic processor
+model assumed for scheduling purposes.
The other options specify a specific processor. Code generated under
those options runs best on that processor, and may not run at all on