From b9f12a01bedb54d5cd503af4dcfbc696c90afd5c Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Mon, 19 Jan 2015 18:33:24 +0000 Subject: [PATCH] default64.h: Include rs6000-cpus.def. * 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. From-SVN: r219854 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/rs6000/default64.h | 8 ++++++-- gcc/config/rs6000/driver-rs6000.c | 6 ++++++ gcc/config/rs6000/linux64.h | 4 ---- gcc/config/rs6000/rs6000.c | 22 ++++++++++++++++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac1e45935c5..7bcc9bc9ac3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2015-01-19 David Edelsohn + + * 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-01-19 Martin Liska PR ipa/64664 diff --git a/gcc/config/rs6000/default64.h b/gcc/config/rs6000/default64.h index 1e7966ed134..7a29672a1ea 100644 --- a/gcc/config/rs6000/default64.h +++ b/gcc/config/rs6000/default64.h @@ -18,10 +18,14 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +#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 diff --git a/gcc/config/rs6000/driver-rs6000.c b/gcc/config/rs6000/driver-rs6000.c index 18c8f25e7fa..af324712b20 100644 --- a/gcc/config/rs6000/driver-rs6000.c +++ b/gcc/config/rs6000/driver-rs6000.c @@ -327,6 +327,12 @@ detect_processor_aix (void) case 0x4000: return "power6"; + case 0x8000: + return "power7"; + + case 0x10000: + return "power8"; + default: return "powerpc"; } diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 1ec9e61986a..0fb3911a165 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -71,11 +71,7 @@ extern int dot_symbols; #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. */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 80fcd655fff..aad4c02132d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5077,6 +5077,28 @@ rs6000_file_start (void) putc ('\n', file); } +#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 ((TARGET_DEFAULT & OPTION_MASK_DIRECT_MOVE) != 0) + fputs ("power8\n", asm_out_file); + else if ((TARGET_DEFAULT & OPTION_MASK_POPCNTD) != 0) + fputs ("power7\n", asm_out_file); + else if ((TARGET_DEFAULT & OPTION_MASK_CMPB) != 0) + fputs ("power6\n", asm_out_file); + else if ((TARGET_DEFAULT & OPTION_MASK_POPCNTB) != 0) + fputs ("power5\n", asm_out_file); + else if ((TARGET_DEFAULT & OPTION_MASK_MFCRF) != 0) + fputs ("power4\n", asm_out_file); + else if ((TARGET_DEFAULT & OPTION_MASK_POWERPC64) != 0) + fputs ("ppc64\n", asm_out_file); + else + fputs ("ppc\n", asm_out_file); + } +#endif + if (DEFAULT_ABI == ABI_ELFv2) fprintf (file, "\t.abiversion 2\n"); -- 2.30.2