Commit cacf1ca8 by Michael Meissner Committed by Michael Meissner

Step 1 of VSX changes: Powerpc infrstructure changes

Co-Authored-By: Pat Haugen <pthaugen@us.ibm.com>
Co-Authored-By: Revital Eres <eres@il.ibm.com>

From-SVN: r148869
parent 59ab92d2
2009-06-23 Michael Meissner <meissner@linux.vnet.ibm.com>
Pat Haugen <pthaugen@us.ibm.com>
Revital1 Eres <ERES@il.ibm.com>
* config.in (HAVE_AS_POPCNTD): Add default definition.
(HAVE_AS_LWSYNC): Ditto.
* configure.ac (gcc_cv_as_powerpc_mfpgpr): Provide real binutils
release number.
(gcc_cv_as_powerpc_cmpb): Ditto.
(gcc_cv_as_powerpc_dfp): Ditto.
(gcc_cv_as_powerpc_vsx): Ditto.
(gcc_cv_as_powerpc_popcntd): Add feature test for assembler
supporting the popcntd/lwsync instructions.
(gcc_cv_as_powerpc_lwsync): Ditto.
* configure: Regenerate.
* config/rs6000/aix53.h (ASM_CPU_SPEC): Add support for
-mcpu=native and -mcpu=power7.
* config/rs6000/aix61.h (ASM_CPU_SPEC): Ditto.
* config/rs6000/linux64.opt (-mprofile-kernel): Move switch to be
a variable instead of a mask to reduce the number of mask bits.
* config/rs6000/sysv4.opt (-mbit-align): Ditto.
(-mbit-word): Ditto.
(-mregnames): Ditto.
* config/rs6000/rs6000.opt (-mupdate): Ditto.
(-mfused-madd): Ditto.
* config/rs6000/rs6000.opt (-mpopcntd): New switch for non-VSX ISA
2.06 instructions.
(-mvsx): New switch for VSX instructions.
(-misel): Move from a variable to a mask to allow it to be set by
-mcpu=.
* config/rs6000/rs6000-protos.h (rs6000_hard_regno_nregs): Change
function declaration to an array declaration.
(rs6000_hard_regno_nregs): New external array declaration.
* config/rs6000/t-rs6000 (MD_INCLUDES): Define, add all of the .md
files included by rs6000.md.
* config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
SET_PROFILE_KERNEL macro to reset the -mprofile-kernel switch.
* config/rs6000/rs6000.c (rs6000_isel): Delete, -misel moved to be
a target mask.
(rs6000_debug_reg): New -mdebug= variables.
(rs6000_debug_addr): Ditto.
(rs6000_debug_cost): Ditto.
(rs6000_pmode): New variable to hold Pmode.
(rs6000_pointer_size): New variable to hold POINTER_SIZE.
(rs6000_class_max_nregs): New array to hold CLASS_MAX_NREGS
calculated at compiler start.
(rs6000_hard_regno_nregs): Change function to an array which holds
HARD_REGNO_NREGS calculated at compiler start.
(rs6000_explicit_options): Delete isel field.
(rs6000_vector_unit): New array to hold which vector unit
supports arithmetic options for a given type.
(rs6000_vector_mem): New array to hold which vector unit supports
memory reference operations for a given type.
(rs6000_vector_align): New array to given the alignment of each
vector type.
(power7_cost): New basic costs for power7.
(SET_PROFILE_KERNEL): New macro for resetting -mprofile-kernel.
(rs6000_hard_regno_nregs_internal): New function, moved from
HARD_REGNO_NREGS, to calculate the number of registers each hard
register takes for each type.
(rs6000_debug_reg_print): New function for -mdebug=reg support.
(rs6000_debug_vector_unit): New array, map rs6000_vector to
string.
(+rs6000_init_hard_regno_mode_ok): New function, move calculation
of HARD_REGNO_NREGS, CLASS_MAX_NREGS, REGNO_REG_CLASS, and vector
unit information here so it is calculated once at compiler startup
time.
(rs6000_override_options): Make -misel a target mask. Add more
power7 target masks. Setup Pmode and POINTER_SIZE. Add initial
VSX support. Add support for -mdebug=reg, -mdebug=addr, and
-mdebug=cost.
(POWERPC_MASKS): Add MASK_POPCNTD, MASK_VSX, and MASK_ISEL.
(rs6000_handle_option): Move -misel from variable to target mask.
(rs6000_builtin_mask_for_load): Add VSX support.
(rs6000_conditional_register_usage): Ditto.
(USE_ALTIVEC_FOR_ARG_P): Ditto.
(function_arg_boundary): Ditto.
(rs6000_expand_builtin): Ditto.
(def_builtin): Make abort message a little friendlier.
(rs6000_emit_int_cmove): Add support for 64-bit isel.
* config/rs6000/rs6000.h (ASM_CPU_POWER7_SPEC): Depend on the
assembler support the popcntd instruction instead of a vsx
instruction to enable power7 support.
(ASM_CPU_SPEC): Add support for -mcpu=native and -mcpu=power7.
(EXTRA_SPECS): Add ASM_CPU_NATIVE_SPEC to allow passing the right
option to the assembler if -mcpu=native.
(ASM_CPU_NATIVE_SPEC): Ditto.
(TARGET_POPCNTD): If assembler doesn't support popcntd, turn off
ISA 2.06 features.
(TARGET_LWSYNC_INSTRUCTION): Define whether it is safe to issue
the lwsync instruction.
(enum processor_type): Add PROCESSOR_POWER7.
(rs6000_debug_reg): New -mdebug= options.
(rs6000_debug_addr): Ditto.
(rs6000_debug_cost): Ditto.
(rs6000_isel): Delete.
(enum rs6000_vector): New enum to say what vector unit we have.
(VECTOR_UNIT_*): New macros to say which vector unit has
arithmetic operations for a given type.
(VECTOR_MEM_*): New macros to say which vector unit has memory
operations for a given type.
(TARGET_LDBRX): Whether the machine supports the ldbrx
instruction.
(TARGET_ISEL): Delete, -misel moved to be a mask.
(TARGET_ISEL64): New macro for 64-bit isel support.
(UNITS_PER_VSX_WORD): New macro.
(POINTER_SIZE): Move to be an external variable, rather than
calculating whether we are generating 32 ot 64-bit code.
(Pmode): Ditto.
(STACK_BOUNDARY): Add VSX support.
(LOCAL_ALIGNMENT): Ditto.
(SLOW_UNALIGNED_ACCESS): Ditto.
(VSX_REGNO_P): New macro for VSX support.
(VFLOAT_REGNO_P): Ditto.
(VINT_REGNO_P): Ditto.
(VLOGICAL_REGNO_P): Ditto.
(VSX_VECTOR_MODE): Ditto.
(VSX_SCALAR_MODE): Ditto.
(VSX_MODE): Ditto.
(VSX_MOVE_MODE): Ditto.
(VSX_REG_CLASS_P): Ditto.
(HARD_REGNO_NREGS): Instead of calling a function, use an array
lookup.
(UNITS_PER_SIMD_WORD): Add VSX support.
(MODES_TIEABLE_P): Ditto.
(STARTING_FRAME_OFFSET): Ditto.
(STACK_DYNAMIC_OFFSET): Ditto.
(EPILOGUE_USES): Ditto.
(REGNO_REG_CLASS): Move to array lookup.
(CLASS_MAX_NREGS): Ditto.
(rs6000_vector_reg_class): Add declaration.
(ADDITIONAL_REGISTER_NAMES): Add VSX names for the registers that
overlap with the floating point and Altivec registers.
* config/rs6000/e500.h (CHECK_E500_OPTIONS): Disallow -mvsx.
* config/rs6000/driver-rs6000.c (asm_names): New static array to
give the appropriate asm switches if -mcpu=native.
(host_detect_local_cpu): Add support for "asm".
(host_detect_local_cpu): Follow GNU code guidelines for name.
* config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Move
-mbit-word to a variable instead of being a target mask.
* config/rs6000/sync.md (lwsync): If the assembler supports it,
emit the lwsync instruction instead of emitting the instruction as
an integer constant.
* config/rs6000/spe.md (spe_fixuns_truncdfsi2): Rename from
fixuns_trundfsi2, move expander into rs6000.md.
* config/rs6000/rs6000.md (cpu): Add power7.
(sel, *ptrsize): New mode attributes for 32/64-bit isel.
(logical predicate patterns): Change the single instruction
primitives that set CR0 to be fast_compare instead of compare.
(norsi*): Ditto.
(popcntwsi2): Add support for ISA 2.06 popcount instructions.
(popcntddi2): Ditto.
(popcount<mode>): Ditto.
(floating multiply/add insns): Name the floating point
multiply/add insns.
(isel_signed_<mode>): Add support for -misel on 64-bit systems.
(isel_unsigned_<mode>): Ditto.
(fixuns_trundfsi2): Move expander here from spe.md.
(smindi3): Define if we have -misel on 64-bit systems.
(smaxdi3): Ditto.
(umindi3): Ditto.
(umaxdi3): Ditto.
2009-06-23 Anatoly Sokolov <aesok@post.ru> 2009-06-23 Anatoly Sokolov <aesok@post.ru>
* config.gcc (avr-*-rtems*, avr-*-*): Set extra_gcc_objs and * config.gcc (avr-*-rtems*, avr-*-*): Set extra_gcc_objs and
......
...@@ -351,12 +351,23 @@ ...@@ -351,12 +351,23 @@
#endif #endif
/* Define if your assembler supports popcntb field. */ /* Define if your assembler supports popcntb instruction. */
#ifndef USED_FOR_TARGET #ifndef USED_FOR_TARGET
#undef HAVE_AS_POPCNTB #undef HAVE_AS_POPCNTB
#endif #endif
/* Define if your assembler supports popcntd instruction. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_POPCNTD
#endif
/* Define if your assembler supports lwsync instruction. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_LWSYNC
#endif
/* Define if your assembler supports .register. */ /* Define if your assembler supports .register. */
#ifndef USED_FOR_TARGET #ifndef USED_FOR_TARGET
#undef HAVE_AS_REGISTER_PSEUDO_OP #undef HAVE_AS_REGISTER_PSEUDO_OP
......
/* Definitions of target machine for GNU compiler, /* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX V5.3. for IBM RS/6000 POWER running AIX V5.3.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@gnu.org). Contributed by David Edelsohn (edelsohn@gnu.org).
...@@ -57,20 +57,24 @@ do { \ ...@@ -57,20 +57,24 @@ do { \
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)" #define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)"
/* Common ASM definitions used by ASM_SPEC amongst the various targets /* Common ASM definitions used by ASM_SPEC amongst the various targets for
for handling -mcpu=xxx switches. */ handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.c to
provide the default assembler options if the user uses -mcpu=native, so if
you make changes here, make them there also. */
#undef ASM_CPU_SPEC #undef ASM_CPU_SPEC
#define ASM_CPU_SPEC \ #define ASM_CPU_SPEC \
"%{!mcpu*: %{!maix64: \ "%{!mcpu*: %{!maix64: \
%{mpowerpc64: -mppc64} \ %{mpowerpc64: -mppc64} \
%{maltivec: -m970} \ %{maltivec: -m970} \
%{!maltivec: %{!mpower64: %(asm_default)}}}} \ %{!maltivec: %{!mpower64: %(asm_default)}}}} \
%{mcpu=native: %(asm_cpu_native)} \
%{mcpu=power3: -m620} \ %{mcpu=power3: -m620} \
%{mcpu=power4: -mpwr4} \ %{mcpu=power4: -mpwr4} \
%{mcpu=power5: -mpwr5} \ %{mcpu=power5: -mpwr5} \
%{mcpu=power5+: -mpwr5x} \ %{mcpu=power5+: -mpwr5x} \
%{mcpu=power6: -mpwr6} \ %{mcpu=power6: -mpwr6} \
%{mcpu=power6x: -mpwr6} \ %{mcpu=power6x: -mpwr6} \
%{mcpu=power7: -mpwr7} \
%{mcpu=powerpc: -mppc} \ %{mcpu=powerpc: -mppc} \
%{mcpu=rs64a: -mppc} \ %{mcpu=rs64a: -mppc} \
%{mcpu=603: -m603} \ %{mcpu=603: -m603} \
......
/* Definitions of target machine for GNU compiler, /* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX V6.1. for IBM RS/6000 POWER running AIX V6.1.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@gnu.org). Contributed by David Edelsohn (edelsohn@gnu.org).
...@@ -57,20 +57,24 @@ do { \ ...@@ -57,20 +57,24 @@ do { \
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)" #define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)"
/* Common ASM definitions used by ASM_SPEC amongst the various targets /* Common ASM definitions used by ASM_SPEC amongst the various targets for
for handling -mcpu=xxx switches. */ handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.c to
provide the default assembler options if the user uses -mcpu=native, so if
you make changes here, make them there also. */
#undef ASM_CPU_SPEC #undef ASM_CPU_SPEC
#define ASM_CPU_SPEC \ #define ASM_CPU_SPEC \
"%{!mcpu*: %{!maix64: \ "%{!mcpu*: %{!maix64: \
%{mpowerpc64: -mppc64} \ %{mpowerpc64: -mppc64} \
%{maltivec: -m970} \ %{maltivec: -m970} \
%{!maltivec: %{!mpower64: %(asm_default)}}}} \ %{!maltivec: %{!mpower64: %(asm_default)}}}} \
%{mcpu=native: %(asm_cpu_native)} \
%{mcpu=power3: -m620} \ %{mcpu=power3: -m620} \
%{mcpu=power4: -mpwr4} \ %{mcpu=power4: -mpwr4} \
%{mcpu=power5: -mpwr5} \ %{mcpu=power5: -mpwr5} \
%{mcpu=power5+: -mpwr5x} \ %{mcpu=power5+: -mpwr5x} \
%{mcpu=power6: -mpwr6} \ %{mcpu=power6: -mpwr6} \
%{mcpu=power6x: -mpwr6} \ %{mcpu=power6x: -mpwr6} \
%{mcpu=power7: -mpwr7} \
%{mcpu=powerpc: -mppc} \ %{mcpu=powerpc: -mppc} \
%{mcpu=rs64a: -mppc} \ %{mcpu=rs64a: -mppc} \
%{mcpu=603: -m603} \ %{mcpu=603: -m603} \
......
/* Subroutines for the gcc driver. /* Subroutines for the gcc driver.
Copyright (C) 2007, 2008 Free Software Foundation, Inc. Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -343,47 +343,156 @@ detect_processor_aix (void) ...@@ -343,47 +343,156 @@ detect_processor_aix (void)
#endif /* _AIX */ #endif /* _AIX */
/*
* Array to map -mcpu=native names to the switches passed to the assembler.
* This list mirrors the specs in ASM_CPU_SPEC, and any changes made here
* should be made there as well.
*/
struct asm_name {
const char *cpu;
const char *asm_sw;
};
static const struct asm_name asm_names[] = {
#if defined (_AIX)
{ "power3", "-m620" },
{ "power4", "-mpwr4" },
{ "power5", "-mpwr5" },
{ "power5+", "-mpwr5x" },
{ "power6", "-mpwr6" },
{ "power6x", "-mpwr6" },
{ "power7", "-mpwr7" },
{ "powerpc", "-mppc" },
{ "rs64a", "-mppc" },
{ "603", "-m603" },
{ "603e", "-m603" },
{ "604", "-m604" },
{ "604e", "-m604" },
{ "620", "-m620" },
{ "630", "-m620" },
{ "970", "-m970" },
{ "G5", "-m970" },
{ NULL, "\
%{!maix64: \
%{mpowerpc64: -mppc64} \
%{maltivec: -m970} \
%{!maltivec: %{!mpower64: %(asm_default)}}}" },
#else
{ "common", "-mcom" },
{ "cell", "-mcell" },
{ "power", "-mpwr" },
{ "power2", "-mpwrx" },
{ "power3", "-mppc64" },
{ "power4", "-mpower4" },
{ "power5", "%(asm_cpu_power5)" },
{ "power5+", "%(asm_cpu_power5)" },
{ "power6", "%(asm_cpu_power6) -maltivec" },
{ "power6x", "%(asm_cpu_power6) -maltivec" },
{ "power7", "%(asm_cpu_power7)" },
{ "powerpc", "-mppc" },
{ "rios", "-mpwr" },
{ "rios1", "-mpwr" },
{ "rios2", "-mpwrx" },
{ "rsc", "-mpwr" },
{ "rsc1", "-mpwr" },
{ "rs64a", "-mppc64" },
{ "401", "-mppc" },
{ "403", "-m403" },
{ "405", "-m405" },
{ "405fp", "-m405" },
{ "440", "-m440" },
{ "440fp", "-m440" },
{ "464", "-m440" },
{ "464fp", "-m440" },
{ "505", "-mppc" },
{ "601", "-m601" },
{ "602", "-mppc" },
{ "603", "-mppc" },
{ "603e", "-mppc" },
{ "ec603e", "-mppc" },
{ "604", "-mppc" },
{ "604e", "-mppc" },
{ "620", "-mppc64" },
{ "630", "-mppc64" },
{ "740", "-mppc" },
{ "750", "-mppc" },
{ "G3", "-mppc" },
{ "7400", "-mppc -maltivec" },
{ "7450", "-mppc -maltivec" },
{ "G4", "-mppc -maltivec" },
{ "801", "-mppc" },
{ "821", "-mppc" },
{ "823", "-mppc" },
{ "860", "-mppc" },
{ "970", "-mpower4 -maltivec" },
{ "G5", "-mpower4 -maltivec" },
{ "8540", "-me500" },
{ "8548", "-me500" },
{ "e300c2", "-me300" },
{ "e300c3", "-me300" },
{ "e500mc", "-me500mc" },
{ NULL, "\
%{mpower: %{!mpower2: -mpwr}} \
%{mpower2: -mpwrx} \
%{mpowerpc64*: -mppc64} \
%{!mpowerpc64*: %{mpowerpc*: -mppc}} \
%{mno-power: %{!mpowerpc*: -mcom}} \
%{!mno-power: %{!mpower*: %(asm_default)}}" },
#endif
};
/* This will be called by the spec parser in gcc.c when it sees /* This will be called by the spec parser in gcc.c when it sees
a %:local_cpu_detect(args) construct. Currently it will be called a %:local_cpu_detect(args) construct. Currently it will be called
with either "arch" or "tune" as argument depending on if -march=native with either "arch" or "tune" as argument depending on if -march=native
or -mtune=native is to be substituted. or -mtune=native is to be substituted.
Additionally it will be called with "asm" to select the appropriate flags
for the assembler.
It returns a string containing new command line parameters to be It returns a string containing new command line parameters to be
put at the place of the above two options, depending on what CPU put at the place of the above two options, depending on what CPU
this is executed. this is executed.
ARGC and ARGV are set depending on the actual arguments given ARGC and ARGV are set depending on the actual arguments given
in the spec. */ in the spec. */
const char const char *
*host_detect_local_cpu (int argc, const char **argv) host_detect_local_cpu (int argc, const char **argv)
{ {
const char *cpu = NULL; const char *cpu = NULL;
const char *cache = ""; const char *cache = "";
const char *options = ""; const char *options = "";
bool arch; bool arch;
bool assembler;
size_t i;
if (argc < 1) if (argc < 1)
return NULL; return NULL;
arch = strcmp (argv[0], "cpu") == 0; arch = strcmp (argv[0], "cpu") == 0;
if (!arch && strcmp (argv[0], "tune")) assembler = (!arch && strcmp (argv[0], "asm") == 0);
if (!arch && !assembler && strcmp (argv[0], "tune"))
return NULL; return NULL;
if (! assembler)
{
#if defined (_AIX) #if defined (_AIX)
cache = detect_caches_aix (); cache = detect_caches_aix ();
#elif defined (__APPLE__) #elif defined (__APPLE__)
cache = detect_caches_darwin (); cache = detect_caches_darwin ();
#elif defined (__FreeBSD__) #elif defined (__FreeBSD__)
cache = detect_caches_freebsd (); cache = detect_caches_freebsd ();
/* FreeBSD PPC does not provide any cache information yet. */ /* FreeBSD PPC does not provide any cache information yet. */
cache = ""; cache = "";
#elif defined (__linux__) #elif defined (__linux__)
cache = detect_caches_linux (); cache = detect_caches_linux ();
/* PPC Linux does not provide any cache information yet. */ /* PPC Linux does not provide any cache information yet. */
cache = ""; cache = "";
#else #else
cache = ""; cache = "";
#endif #endif
}
#if defined (_AIX) #if defined (_AIX)
cpu = detect_processor_aix (); cpu = detect_processor_aix ();
...@@ -397,6 +506,17 @@ const char ...@@ -397,6 +506,17 @@ const char
cpu = "powerpc"; cpu = "powerpc";
#endif #endif
if (assembler)
{
for (i = 0; i < sizeof (asm_names) / sizeof (asm_names[0]); i++)
{
if (!asm_names[i].cpu || !strcmp (asm_names[i].cpu, cpu))
return asm_names[i].asm_sw;
}
return NULL;
}
return concat (cache, "-m", argv[0], "=", cpu, " ", options, NULL); return concat (cache, "-m", argv[0], "=", cpu, " ", options, NULL);
} }
...@@ -404,7 +524,8 @@ const char ...@@ -404,7 +524,8 @@ const char
/* If we aren't compiling with GCC we just provide a minimal /* If we aren't compiling with GCC we just provide a minimal
default value. */ default value. */
const char *host_detect_local_cpu (int argc, const char **argv) const char *
host_detect_local_cpu (int argc, const char **argv)
{ {
const char *cpu; const char *cpu;
bool arch; bool arch;
......
/* Enable E500 support. /* Enable E500 support.
Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
This file is part of GCC. This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it GCC is free software; you can redistribute it and/or modify it
...@@ -37,6 +38,8 @@ ...@@ -37,6 +38,8 @@
{ \ { \
if (TARGET_ALTIVEC) \ if (TARGET_ALTIVEC) \
error ("AltiVec and E500 instructions cannot coexist"); \ error ("AltiVec and E500 instructions cannot coexist"); \
if (TARGET_VSX) \
error ("VSX and E500 instructions cannot coexist"); \
if (TARGET_64BIT) \ if (TARGET_64BIT) \
error ("64-bit E500 not supported"); \ error ("64-bit E500 not supported"); \
if (TARGET_HARD_FLOAT && TARGET_FPRS) \ if (TARGET_HARD_FLOAT && TARGET_FPRS) \
......
...@@ -119,7 +119,7 @@ extern int dot_symbols; ...@@ -119,7 +119,7 @@ extern int dot_symbols;
error (INVALID_32BIT, "32"); \ error (INVALID_32BIT, "32"); \
if (TARGET_PROFILE_KERNEL) \ if (TARGET_PROFILE_KERNEL) \
{ \ { \
target_flags &= ~MASK_PROFILE_KERNEL; \ SET_PROFILE_KERNEL (0); \
error (INVALID_32BIT, "profile-kernel"); \ error (INVALID_32BIT, "profile-kernel"); \
} \ } \
} \ } \
......
; Options for 64-bit PowerPC Linux. ; Options for 64-bit PowerPC Linux.
; ;
; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>. ; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
; ;
; This file is part of GCC. ; This file is part of GCC.
...@@ -20,5 +20,5 @@ ...@@ -20,5 +20,5 @@
; <http://www.gnu.org/licenses/>. ; <http://www.gnu.org/licenses/>.
mprofile-kernel mprofile-kernel
Target Report Mask(PROFILE_KERNEL) Target Report Var(TARGET_PROFILE_KERNEL)
Call mcount for profiling before a function prologue Call mcount for profiling before a function prologue
...@@ -284,6 +284,8 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) ...@@ -284,6 +284,8 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
builtin_define ("_ARCH_PWR6X"); builtin_define ("_ARCH_PWR6X");
if (! TARGET_POWER && ! TARGET_POWER2 && ! TARGET_POWERPC) if (! TARGET_POWER && ! TARGET_POWER2 && ! TARGET_POWERPC)
builtin_define ("_ARCH_COM"); builtin_define ("_ARCH_COM");
if (TARGET_POPCNTD)
builtin_define ("_ARCH_PWR7");
if (TARGET_ALTIVEC) if (TARGET_ALTIVEC)
{ {
builtin_define ("__ALTIVEC__"); builtin_define ("__ALTIVEC__");
...@@ -326,6 +328,8 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) ...@@ -326,6 +328,8 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
/* Used by libstdc++. */ /* Used by libstdc++. */
if (TARGET_NO_LWSYNC) if (TARGET_NO_LWSYNC)
builtin_define ("__NO_LWSYNC__"); builtin_define ("__NO_LWSYNC__");
if (TARGET_VSX)
builtin_define ("__VSX__");
/* May be overridden by target configuration. */ /* May be overridden by target configuration. */
RS6000_CPU_CPP_ENDIAN_BUILTINS(); RS6000_CPU_CPP_ENDIAN_BUILTINS();
......
...@@ -168,7 +168,6 @@ extern int rs6000_register_move_cost (enum machine_mode, ...@@ -168,7 +168,6 @@ extern int rs6000_register_move_cost (enum machine_mode,
enum reg_class, enum reg_class); enum reg_class, enum reg_class);
extern int rs6000_memory_move_cost (enum machine_mode, enum reg_class, int); extern int rs6000_memory_move_cost (enum machine_mode, enum reg_class, int);
extern bool rs6000_tls_referenced_p (rtx); extern bool rs6000_tls_referenced_p (rtx);
extern int rs6000_hard_regno_nregs (int, enum machine_mode);
extern void rs6000_conditional_register_usage (void); extern void rs6000_conditional_register_usage (void);
/* Declare functions in rs6000-c.c */ /* Declare functions in rs6000-c.c */
...@@ -187,4 +186,6 @@ const char * rs6000_xcoff_strip_dollar (const char *); ...@@ -187,4 +186,6 @@ const char * rs6000_xcoff_strip_dollar (const char *);
void rs6000_final_prescan_insn (rtx, rtx *operand, int num_operands); void rs6000_final_prescan_insn (rtx, rtx *operand, int num_operands);
extern bool rs6000_hard_regno_mode_ok_p[][FIRST_PSEUDO_REGISTER]; extern bool rs6000_hard_regno_mode_ok_p[][FIRST_PSEUDO_REGISTER];
extern unsigned char rs6000_class_max_nregs[][LIM_REG_CLASSES];
extern unsigned char rs6000_hard_regno_nregs[][FIRST_PSEUDO_REGISTER];
#endif /* rs6000-protos.h */ #endif /* rs6000-protos.h */
...@@ -111,24 +111,24 @@ mhard-float ...@@ -111,24 +111,24 @@ mhard-float
Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT)
Use hardware floating point Use hardware floating point
mno-update mpopcntd
Target Report RejectNegative Mask(NO_UPDATE) Target Report Mask(POPCNTD)
Do not generate load/store with update instructions Use PowerPC V2.06 popcntd instruction
mvsx
Target Report Mask(VSX)
Use vector/scalar (VSX) instructions
mupdate mupdate
Target Report RejectNegative InverseMask(NO_UPDATE, UPDATE) Target Report Var(TARGET_UPDATE) Init(1)
Generate load/store with update instructions Generate load/store with update instructions
mavoid-indexed-addresses mavoid-indexed-addresses
Target Report Var(TARGET_AVOID_XFORM) Init(-1) Target Report Var(TARGET_AVOID_XFORM) Init(-1)
Avoid generation of indexed load/store instructions when possible Avoid generation of indexed load/store instructions when possible
mno-fused-madd
Target Report RejectNegative Mask(NO_FUSED_MADD)
Do not generate fused multiply/add instructions
mfused-madd mfused-madd
Target Report RejectNegative InverseMask(NO_FUSED_MADD, FUSED_MADD) Target Report Var(TARGET_FUSED_MADD) Init(1)
Generate fused multiply/add instructions Generate fused multiply/add instructions
mtls-markers mtls-markers
...@@ -198,7 +198,7 @@ Target RejectNegative Joined ...@@ -198,7 +198,7 @@ Target RejectNegative Joined
-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead -mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
misel misel
Target Target Report Mask(ISEL)
Generate isel instructions Generate isel instructions
misel= misel=
......
;; e500 SPE description ;; e500 SPE description
;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc. ;; Free Software Foundation, Inc.
;; Contributed by Aldy Hernandez (aldy@quesejoda.com) ;; Contributed by Aldy Hernandez (aldy@quesejoda.com)
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
;; Floating point conversion instructions. ;; Floating point conversion instructions.
(define_insn "fixuns_truncdfsi2" (define_insn "spe_fixuns_truncdfsi2"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r") [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] (unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
......
...@@ -616,7 +616,7 @@ ...@@ -616,7 +616,7 @@
if (TARGET_NO_LWSYNC) if (TARGET_NO_LWSYNC)
return "sync"; return "sync";
else else
return ".long 0x7c2004ac"; return (TARGET_LWSYNC_INSTRUCTION) ? "lwsync" : ".long 0x7c2004ac";
} }
[(set_attr "type" "sync")]) [(set_attr "type" "sync")])
...@@ -125,9 +125,9 @@ do { \ ...@@ -125,9 +125,9 @@ do { \
else if (!strcmp (rs6000_abi_name, "i960-old")) \ else if (!strcmp (rs6000_abi_name, "i960-old")) \
{ \ { \
rs6000_current_abi = ABI_V4; \ rs6000_current_abi = ABI_V4; \
target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI \ target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI); \
| MASK_NO_BITFIELD_WORD); \
target_flags &= ~MASK_STRICT_ALIGN; \ target_flags &= ~MASK_STRICT_ALIGN; \
TARGET_NO_BITFIELD_WORD = 1; \
} \ } \
else \ else \
{ \ { \
......
; SYSV4 options for PPC port. ; SYSV4 options for PPC port.
; ;
; Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. ; Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>. ; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
; ;
; This file is part of GCC. ; This file is part of GCC.
...@@ -32,7 +32,7 @@ Target RejectNegative Joined ...@@ -32,7 +32,7 @@ Target RejectNegative Joined
Specify bit size of immediate TLS offsets Specify bit size of immediate TLS offsets
mbit-align mbit-align
Target Report Mask(NO_BITFIELD_TYPE) Target Report Var(TARGET_NO_BITFIELD_TYPE)
Align to the base type of the bit-field Align to the base type of the bit-field
mstrict-align mstrict-align
...@@ -87,11 +87,11 @@ Target Report Mask(EABI) ...@@ -87,11 +87,11 @@ Target Report Mask(EABI)
Use EABI Use EABI
mbit-word mbit-word
Target Report Mask(NO_BITFIELD_WORD) Target Report Var(TARGET_NO_BITFIELD_WORD)
Allow bit-fields to cross word boundaries Allow bit-fields to cross word boundaries
mregnames mregnames
Target Mask(REGNAMES) Target Var(TARGET_REGNAMES)
Use alternate register names Use alternate register names
;; This option does nothing and only exists because the compiler ;; This option does nothing and only exists because the compiler
......
...@@ -36,3 +36,30 @@ rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \ ...@@ -36,3 +36,30 @@ rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \
# The rs6000 backend doesn't cause warnings in these files. # The rs6000 backend doesn't cause warnings in these files.
insn-conditions.o-warn = insn-conditions.o-warn =
MD_INCLUDES = $(srcdir)/config/rs6000/rios1.md \
$(srcdir)/config/rs6000/rios2.md \
$(srcdir)/config/rs6000/rs64.md \
$(srcdir)/config/rs6000/mpc.md \
$(srcdir)/config/rs6000/40x.md \
$(srcdir)/config/rs6000/440.md \
$(srcdir)/config/rs6000/603.md \
$(srcdir)/config/rs6000/6xx.md \
$(srcdir)/config/rs6000/7xx.md \
$(srcdir)/config/rs6000/7450.md \
$(srcdir)/config/rs6000/8540.md \
$(srcdir)/config/rs6000/e300c2c3.md \
$(srcdir)/config/rs6000/e500mc.md \
$(srcdir)/config/rs6000/power4.md \
$(srcdir)/config/rs6000/power5.md \
$(srcdir)/config/rs6000/power6.md \
$(srcdir)/config/rs6000/cell.md \
$(srcdir)/config/rs6000/xfpu.md \
$(srcdir)/config/rs6000/predicates.md \
$(srcdir)/config/rs6000/constraints.md \
$(srcdir)/config/rs6000/darwin.md \
$(srcdir)/config/rs6000/sync.md \
$(srcdir)/config/rs6000/altivec.md \
$(srcdir)/config/rs6000/spe.md \
$(srcdir)/config/rs6000/dfp.md \
$(srcdir)/config/rs6000/paired.md
...@@ -23234,7 +23234,7 @@ if test "${gcc_cv_as_powerpc_mfpgpr+set}" = set; then ...@@ -23234,7 +23234,7 @@ if test "${gcc_cv_as_powerpc_mfpgpr+set}" = set; then
else else
gcc_cv_as_powerpc_mfpgpr=no gcc_cv_as_powerpc_mfpgpr=no
if test $in_tree_gas = yes; then if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0` if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
then gcc_cv_as_powerpc_mfpgpr=yes then gcc_cv_as_powerpc_mfpgpr=yes
fi fi
elif test x$gcc_cv_as != x; then elif test x$gcc_cv_as != x; then
...@@ -23330,7 +23330,7 @@ if test "${gcc_cv_as_powerpc_cmpb+set}" = set; then ...@@ -23330,7 +23330,7 @@ if test "${gcc_cv_as_powerpc_cmpb+set}" = set; then
else else
gcc_cv_as_powerpc_cmpb=no gcc_cv_as_powerpc_cmpb=no
if test $in_tree_gas = yes; then if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0` if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
then gcc_cv_as_powerpc_cmpb=yes then gcc_cv_as_powerpc_cmpb=yes
fi fi
elif test x$gcc_cv_as != x; then elif test x$gcc_cv_as != x; then
...@@ -23376,7 +23376,7 @@ if test "${gcc_cv_as_powerpc_dfp+set}" = set; then ...@@ -23376,7 +23376,7 @@ if test "${gcc_cv_as_powerpc_dfp+set}" = set; then
else else
gcc_cv_as_powerpc_dfp=no gcc_cv_as_powerpc_dfp=no
if test $in_tree_gas = yes; then if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0` if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
then gcc_cv_as_powerpc_dfp=yes then gcc_cv_as_powerpc_dfp=yes
fi fi
elif test x$gcc_cv_as != x; then elif test x$gcc_cv_as != x; then
...@@ -23422,7 +23422,7 @@ if test "${gcc_cv_as_powerpc_vsx+set}" = set; then ...@@ -23422,7 +23422,7 @@ if test "${gcc_cv_as_powerpc_vsx+set}" = set; then
else else
gcc_cv_as_powerpc_vsx=no gcc_cv_as_powerpc_vsx=no
if test $in_tree_gas = yes; then if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0` if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
then gcc_cv_as_powerpc_vsx=yes then gcc_cv_as_powerpc_vsx=yes
fi fi
elif test x$gcc_cv_as != x; then elif test x$gcc_cv_as != x; then
...@@ -23452,6 +23452,96 @@ _ACEOF ...@@ -23452,6 +23452,96 @@ _ACEOF
fi fi
case $target in
*-*-aix*) conftest_s=' .machine "pwr7"
.csect .text[PR]
popcntd 3,3';;
*) conftest_s=' .machine power7
.text
popcntd 3,3';;
esac
echo "$as_me:$LINENO: checking assembler for popcntd support" >&5
echo $ECHO_N "checking assembler for popcntd support... $ECHO_C" >&6
if test "${gcc_cv_as_powerpc_popcntd+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
gcc_cv_as_powerpc_popcntd=no
if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
then gcc_cv_as_powerpc_popcntd=yes
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as -a32 -o conftest.o conftest.s >&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }
then
gcc_cv_as_powerpc_popcntd=yes
else
echo "configure: failed program was" >&5
cat conftest.s >&5
fi
rm -f conftest.o conftest.s
fi
fi
echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_popcntd" >&5
echo "${ECHO_T}$gcc_cv_as_powerpc_popcntd" >&6
if test $gcc_cv_as_powerpc_popcntd = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_AS_POPCNTD 1
_ACEOF
fi
case $target in
*-*-aix*) conftest_s=' .csect .text[PR]
lwsync';;
*) conftest_s=' .text
lwsync';;
esac
echo "$as_me:$LINENO: checking assembler for lwsync support" >&5
echo $ECHO_N "checking assembler for lwsync support... $ECHO_C" >&6
if test "${gcc_cv_as_powerpc_lwsync+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
gcc_cv_as_powerpc_lwsync=no
if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
then gcc_cv_as_powerpc_lwsync=yes
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as -a32 -o conftest.o conftest.s >&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }
then
gcc_cv_as_powerpc_lwsync=yes
else
echo "configure: failed program was" >&5
cat conftest.s >&5
fi
rm -f conftest.o conftest.s
fi
fi
echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_lwsync" >&5
echo "${ECHO_T}$gcc_cv_as_powerpc_lwsync" >&6
if test $gcc_cv_as_powerpc_lwsync = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_AS_LWSYNC 1
_ACEOF
fi
echo "$as_me:$LINENO: checking assembler for .gnu_attribute support" >&5 echo "$as_me:$LINENO: checking assembler for .gnu_attribute support" >&5
echo $ECHO_N "checking assembler for .gnu_attribute support... $ECHO_C" >&6 echo $ECHO_N "checking assembler for .gnu_attribute support... $ECHO_C" >&6
if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then
......
...@@ -3125,7 +3125,7 @@ foo: nop ...@@ -3125,7 +3125,7 @@ foo: nop
esac esac
gcc_GAS_CHECK_FEATURE([move fp gpr support], gcc_GAS_CHECK_FEATURE([move fp gpr support],
gcc_cv_as_powerpc_mfpgpr, [9,99,0],, gcc_cv_as_powerpc_mfpgpr, [2,19,2],,
[$conftest_s],, [$conftest_s],,
[AC_DEFINE(HAVE_AS_MFPGPR, 1, [AC_DEFINE(HAVE_AS_MFPGPR, 1,
[Define if your assembler supports mffgpr and mftgpr.])]) [Define if your assembler supports mffgpr and mftgpr.])])
...@@ -3159,7 +3159,7 @@ LCF0: ...@@ -3159,7 +3159,7 @@ LCF0:
esac esac
gcc_GAS_CHECK_FEATURE([compare bytes support], gcc_GAS_CHECK_FEATURE([compare bytes support],
gcc_cv_as_powerpc_cmpb, [9,99,0], -a32, gcc_cv_as_powerpc_cmpb, [2,19,2], -a32,
[$conftest_s],, [$conftest_s],,
[AC_DEFINE(HAVE_AS_CMPB, 1, [AC_DEFINE(HAVE_AS_CMPB, 1,
[Define if your assembler supports cmpb.])]) [Define if your assembler supports cmpb.])])
...@@ -3174,7 +3174,7 @@ LCF0: ...@@ -3174,7 +3174,7 @@ LCF0:
esac esac
gcc_GAS_CHECK_FEATURE([decimal float support], gcc_GAS_CHECK_FEATURE([decimal float support],
gcc_cv_as_powerpc_dfp, [9,99,0], -a32, gcc_cv_as_powerpc_dfp, [2,19,2], -a32,
[$conftest_s],, [$conftest_s],,
[AC_DEFINE(HAVE_AS_DFP, 1, [AC_DEFINE(HAVE_AS_DFP, 1,
[Define if your assembler supports DFP instructions.])]) [Define if your assembler supports DFP instructions.])])
...@@ -3189,11 +3189,39 @@ LCF0: ...@@ -3189,11 +3189,39 @@ LCF0:
esac esac
gcc_GAS_CHECK_FEATURE([vector-scalar support], gcc_GAS_CHECK_FEATURE([vector-scalar support],
gcc_cv_as_powerpc_vsx, [9,99,0], -a32, gcc_cv_as_powerpc_vsx, [2,19,2], -a32,
[$conftest_s],, [$conftest_s],,
[AC_DEFINE(HAVE_AS_VSX, 1, [AC_DEFINE(HAVE_AS_VSX, 1,
[Define if your assembler supports VSX instructions.])]) [Define if your assembler supports VSX instructions.])])
case $target in
*-*-aix*) conftest_s=' .machine "pwr7"
.csect .text[[PR]]
popcntd 3,3';;
*) conftest_s=' .machine power7
.text
popcntd 3,3';;
esac
gcc_GAS_CHECK_FEATURE([popcntd support],
gcc_cv_as_powerpc_popcntd, [2,19,2], -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_POPCNTD, 1,
[Define if your assembler supports POPCNTD instructions.])])
case $target in
*-*-aix*) conftest_s=' .csect .text[[PR]]
lwsync';;
*) conftest_s=' .text
lwsync';;
esac
gcc_GAS_CHECK_FEATURE([lwsync support],
gcc_cv_as_powerpc_lwsync, [2,19,2], -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_LWSYNC, 1,
[Define if your assembler supports LWSYNC instructions.])])
gcc_GAS_CHECK_FEATURE([.gnu_attribute support], gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
gcc_cv_as_powerpc_gnu_attribute, [2,18,0],, gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
[.gnu_attribute 4,1],, [.gnu_attribute 4,1],,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment