aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@cygnus.com>2000-01-12 22:01:44 +0000
committerGeoffrey Keating <geoffk@cygnus.com>2000-01-12 22:01:44 +0000
commit7d217e893214d9853e98b0c5882d300af60caf82 (patch)
treeec2e1bb8fe63e61426ef72bd86c8411ecfbf93bc
parent33b6a48b27ab15a7624bcbc91896ed4e483bf58e (diff)
2000-01-12 Geoff Keating <geoffk@cygnus.com>
* rs6000.h (ASM_FILE_END): Move to aix.h. (EXTRA_SECTIONS): Move to aix.h. (READONLY_DATA_SECTION): Move to aix.h. (EXTRA_SECTION_FUNCTIONS): Move to aix.h. (SELECT_SECTION): Move to aix.h. (JUMP_TABLES_IN_TEXT_SECTION): Move to aix.h. (INT_REGNO_P): Use symbolic name for ARG_POINTER_REGNUM. (LINK_REGISTER_REGNUM): New definition. (RETURN_ADDR_RTX): Use symbolic name for LINK_REGISTER_REGNUM. (SLOW_UNALIGNED_ACCESS): Define in a way suitable for both AIX and SVR4. * sysv4.h: Delete the code between the inclusion of rs6000.h and svr4.h. (DWARF_DEBUGGING_INFO): Don't define, it's defined in elfos.h. (FP_ARG_MAX_REG): Move generic definition to rs6000.h. (RS6000_REG_SAVE): Move generic definition to rs6000.h. (RS6000_SAVE_AREA): Move generic definition to rs6000.h. * rs6000.md (floatsidf2_loadaddr): The first arg here is Pmode. (fix_truncdfsi2_internal): Rename to fix_truncdfsi2_internal_si. (fix_truncdfsi2_internal_di): New pattern. (fix_truncdfsi2_store): The second arg here is Pmode too. (fix_truncdfsi2_load): The second arg here is Pmode too. (tablejumpdi): Now that switch tables hold only SImode values, gcc needs to know how to add them to the pc which is DImode. * rs6000.c (rs6000_stack_info): Use symbolic name for LINK_REGISTER_REGNUM. (output_mi_thunk) [!TARGET_ELF]: Don't define sp, it's not used. (output_toc): Delete unused variables s1 and s2. (output_ascii): Use fputs not fprintf on a variable string. 2000-01-07 David Edelsohn <edelsohn@gnu.org> * rs6000.c (processor_target_table): Add power3 as alias for 630. * aix43.h: Revert Aug 2 change. (HAS_INIT_SECTION): Define, not visible yet. (LD_INIT_SWITCH): Define, not visible yet. * t-aix43 (MULTILIB_OPTIONS): Revert Aug 2 change. 2000-01-04 Joel Sherrill (joel@OARcorp.com> * config/rs6000/rtems.h: Include config/rtems.h. 2000-01-04 David Edelsohn <edelsohn@gnu.org> * rs6000.h (HANDLE_PRAGMA_PACK): Define. (SLOW_UNALIGNED_ACCESS): Define. (CASE_VECTOR_MODE): Always use 32-bit offsets. (ASM_FILE_END): Generate 64-bit symbol in 64-bit mode. (EXTRA_SECTOIN_FUNCTIONS): Indent .csect pseudo-op. (toc_section): Likewise and .toc pseudo-op. (ASM_DECLARE_FUNCTION): Likewise. Align text more strictly in 64-bit mode. (TEXT_SECTION_ASM_OP): Likewise. (ASM_OUTPUT_ADD_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Always use 32-bit offsets. 1999-12-17 Jakub Jelinek <jakub@redhat.com> * config/rs6000/rs6000.h (TARGET_POWERPC64): Make sure UNITS_PER_WORD and BITS_PER_WORD are compile time constants when compiling libgcc2. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/newppc-branch@31361 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/rs6000/ChangeLog64
-rw-r--r--gcc/config/rs6000/aix.h125
-rw-r--r--gcc/config/rs6000/aix43.h38
-rw-r--r--gcc/config/rs6000/rs6000.c13
-rw-r--r--gcc/config/rs6000/rs6000.h205
-rw-r--r--gcc/config/rs6000/rs6000.md30
-rw-r--r--gcc/config/rs6000/rtems.h5
-rw-r--r--gcc/config/rs6000/sysv4.h20
-rw-r--r--gcc/config/rs6000/t-aix432
9 files changed, 302 insertions, 200 deletions
diff --git a/gcc/config/rs6000/ChangeLog b/gcc/config/rs6000/ChangeLog
index bcfc5f18356..2c1214e0595 100644
--- a/gcc/config/rs6000/ChangeLog
+++ b/gcc/config/rs6000/ChangeLog
@@ -1,3 +1,67 @@
+2000-01-12 Geoff Keating <geoffk@cygnus.com>
+
+ * rs6000.h (ASM_FILE_END): Move to aix.h.
+ (EXTRA_SECTIONS): Move to aix.h.
+ (READONLY_DATA_SECTION): Move to aix.h.
+ (EXTRA_SECTION_FUNCTIONS): Move to aix.h.
+ (SELECT_SECTION): Move to aix.h.
+ (JUMP_TABLES_IN_TEXT_SECTION): Move to aix.h.
+ (INT_REGNO_P): Use symbolic name for ARG_POINTER_REGNUM.
+ (LINK_REGISTER_REGNUM): New definition.
+ (RETURN_ADDR_RTX): Use symbolic name for LINK_REGISTER_REGNUM.
+ (SLOW_UNALIGNED_ACCESS): Define in a way suitable for both
+ AIX and SVR4.
+ * sysv4.h: Delete the code between the inclusion of rs6000.h
+ and svr4.h.
+ (DWARF_DEBUGGING_INFO): Don't define, it's defined in elfos.h.
+ (FP_ARG_MAX_REG): Move generic definition to rs6000.h.
+ (RS6000_REG_SAVE): Move generic definition to rs6000.h.
+ (RS6000_SAVE_AREA): Move generic definition to rs6000.h.
+ * rs6000.md (floatsidf2_loadaddr): The first arg here is Pmode.
+ (fix_truncdfsi2_internal): Rename to fix_truncdfsi2_internal_si.
+ (fix_truncdfsi2_internal_di): New pattern.
+ (fix_truncdfsi2_store): The second arg here is Pmode too.
+ (fix_truncdfsi2_load): The second arg here is Pmode too.
+ (tablejumpdi): Now that switch tables hold only SImode values,
+ gcc needs to know how to add them to the pc which is DImode.
+ * rs6000.c (rs6000_stack_info): Use symbolic name for
+ LINK_REGISTER_REGNUM.
+ (output_mi_thunk) [!TARGET_ELF]: Don't define sp, it's not used.
+ (output_toc): Delete unused variables s1 and s2.
+ (output_ascii): Use fputs not fprintf on a variable string.
+
+2000-01-07 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.c (processor_target_table): Add power3 as alias for 630.
+ * aix43.h: Revert Aug 2 change.
+ (HAS_INIT_SECTION): Define, not visible yet.
+ (LD_INIT_SWITCH): Define, not visible yet.
+ * t-aix43 (MULTILIB_OPTIONS): Revert Aug 2 change.
+
+2000-01-04 Joel Sherrill (joel@OARcorp.com>
+
+ * config/rs6000/rtems.h: Include config/rtems.h.
+
+2000-01-04 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.h (HANDLE_PRAGMA_PACK): Define.
+ (SLOW_UNALIGNED_ACCESS): Define.
+ (CASE_VECTOR_MODE): Always use 32-bit offsets.
+ (ASM_FILE_END): Generate 64-bit symbol in 64-bit mode.
+ (EXTRA_SECTOIN_FUNCTIONS): Indent .csect pseudo-op.
+ (toc_section): Likewise and .toc pseudo-op.
+ (ASM_DECLARE_FUNCTION): Likewise. Align text more strictly in
+ 64-bit mode.
+ (TEXT_SECTION_ASM_OP): Likewise.
+ (ASM_OUTPUT_ADD_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Always use
+ 32-bit offsets.
+
+1999-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.h (TARGET_POWERPC64): Make sure
+ UNITS_PER_WORD and BITS_PER_WORD are compile time constants when
+ compiling libgcc2.
+
2000-01-06 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* rs6000.h: Move more stuff from here...
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index d906da46135..0541cb15124 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -125,6 +125,131 @@ Boston, MA 02111-1307, USA. */
} \
}
+/* Output at end of assembler file.
+
+ On the RS/6000, referencing data should automatically pull in text. */
+
+#define ASM_FILE_END(FILE) \
+{ \
+ text_section (); \
+ fputs ("_section_.text:\n", FILE); \
+ data_section (); \
+ fputs (TARGET_32BIT \
+ ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", FILE); \
+}
+
+/* Define the extra sections we need. We define three: one is the read-only
+ data section which is used for constants. This is a csect whose name is
+ derived from the name of the input file. The second is for initialized
+ global variables. This is a csect whose name is that of the variable.
+ The third is the TOC. */
+
+#define EXTRA_SECTIONS \
+ read_only_data, private_data, read_only_private_data, toc, bss
+
+/* Define the routines to implement these extra sections.
+ BIGGEST_ALIGNMENT is 64, so align the sections that much. */
+
+#define EXTRA_SECTION_FUNCTIONS \
+ \
+void \
+read_only_data_section () \
+{ \
+ if (in_section != read_only_data) \
+ { \
+ fprintf (asm_out_file, "\t.csect %s[RO],3\n", \
+ xcoff_read_only_section_name); \
+ in_section = read_only_data; \
+ } \
+} \
+ \
+void \
+private_data_section () \
+{ \
+ if (in_section != private_data) \
+ { \
+ fprintf (asm_out_file, "\t.csect %s[RW],3\n", \
+ xcoff_private_data_section_name); \
+ in_section = private_data; \
+ } \
+} \
+ \
+void \
+read_only_private_data_section () \
+{ \
+ if (in_section != read_only_private_data) \
+ { \
+ fprintf (asm_out_file, "\t.csect %s[RO],3\n", \
+ xcoff_private_data_section_name); \
+ in_section = read_only_private_data; \
+ } \
+} \
+ \
+void \
+toc_section () \
+{ \
+ if (TARGET_MINIMAL_TOC) \
+ { \
+ /* toc_section is always called at least once from ASM_FILE_START, \
+ so this is guaranteed to always be defined once and only once \
+ in each file. */ \
+ if (! toc_initialized) \
+ { \
+ fputs ("\t.toc\nLCTOC..0:\n", asm_out_file); \
+ fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
+ toc_initialized = 1; \
+ } \
+ \
+ if (in_section != toc) \
+ fprintf (asm_out_file, "\t.csect toc_table[RW]%s\n", \
+ (TARGET_32BIT ? "" : ",3")); \
+ } \
+ else \
+ { \
+ if (in_section != toc) \
+ fputs ("\t.toc\n", asm_out_file); \
+ } \
+ in_section = toc; \
+}
+
+/* Define the name of our readonly data section. */
+
+#define READONLY_DATA_SECTION read_only_data_section
+
+/* Select the section for an initialized data object.
+
+ On the RS/6000, we have a special section for all variables except those
+ that are static. */
+
+#define SELECT_SECTION(EXP,RELOC) \
+{ \
+ if ((TREE_CODE (EXP) == STRING_CST \
+ && ! flag_writable_strings) \
+ || (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'd' \
+ && TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \
+ && DECL_INITIAL (EXP) \
+ && (DECL_INITIAL (EXP) == error_mark_node \
+ || TREE_CONSTANT (DECL_INITIAL (EXP))) \
+ && ! (RELOC))) \
+ { \
+ if (TREE_PUBLIC (EXP)) \
+ read_only_data_section (); \
+ else \
+ read_only_private_data_section (); \
+ } \
+ else \
+ { \
+ if (TREE_PUBLIC (EXP)) \
+ data_section (); \
+ else \
+ private_data_section (); \
+ } \
+}
+
+/* Indicate that jump tables go in the text section. */
+
+#define JUMP_TABLES_IN_TEXT_SECTION 1
+
/* Enable AIX XL compiler calling convention breakage compatibility. */
#undef TARGET_XL_CALL
#define MASK_XL_CALL 0x40000000
diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h
index 6f99d43ff26..04de18bb2e7 100644
--- a/gcc/config/rs6000/aix43.h
+++ b/gcc/config/rs6000/aix43.h
@@ -24,11 +24,11 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/rs6000.h"
#include "rs6000/aix.h"
-/* Enable AIX XL compiler calling convention breakage compatibility. */
+/* AIX 4.3 and above support 64-bit executables. */
#undef SUBSUBTARGET_SWITCHES
#define SUBSUBTARGET_SWITCHES \
- {"64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC}, \
- {"32", - (MASK_64BIT | MASK_POWERPC64)}, \
+ {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC}, \
+ {"aix32", - (MASK_64BIT | MASK_POWERPC64)}, \
{"threads", 0}, \
{"pe", 0},
@@ -47,23 +47,23 @@ do { \
if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \
{ \
target_flags &= ~NON_POWERPC_MASKS; \
- warning ("-m64 and POWER architecture are incompatible."); \
+ warning ("-maix64 and POWER architecture are incompatible."); \
} \
if (TARGET_64BIT && ! (target_flags & MASK_POWERPC64)) \
{ \
target_flags |= MASK_POWERPC64; \
- warning ("-m64 requires PowerPC64 architecture remain enabled."); \
+ warning ("-maix64 requires PowerPC64 architecture remain enabled."); \
} \
} while (0);
#undef ASM_SPEC
-#define ASM_SPEC "-u %{m64:-a64 -mppc64} %(asm_cpu)"
+#define ASM_SPEC "-u %{maix64:-a64 -mppc64} %(asm_cpu)"
/* Common ASM definitions used by ASM_SPEC amonst the various targets
for handling -mcpu=xxx switches. */
#undef ASM_CPU_SPEC
#define ASM_CPU_SPEC \
-"%{!mcpu*: %{!m64: \
+"%{!mcpu*: %{!maix64: \
%{mpower: %{!mpower2: -mpwr}} \
%{mpower2: -mpwr2} \
%{mpowerpc*: %{!mpowerpc64: -mppc}} \
@@ -101,7 +101,7 @@ do { \
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
- %{m64: -D__64BIT__ -D_ARCH_PPC}\
+ %{maix64: -D__64BIT__ -D_ARCH_PPC}\
%{mpe: -I/usr/lpp/ppe.poe/include}\
%{mthreads: -D_THREAD_SAFE}\
%(cpp_cpu)"
@@ -110,7 +110,7 @@ do { \
for handling -mcpu=xxx switches. */
#undef CPP_CPU_SPEC
#define CPP_CPU_SPEC \
-"%{!mcpu*: %{!m64: \
+"%{!mcpu*: %{!maix64: \
%{mpower: %{!mpower2: -D_ARCH_PWR}} \
%{mpower2: -D_ARCH_PWR2} \
%{mpowerpc*: -D_ARCH_PPC} \
@@ -161,15 +161,15 @@ do { \
#undef LIB_SPEC
#define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
%{p:-L/lib/profiled -L/usr/lib/profiled}\
- %{!m64:%{!shared:%{g*:-lg}}}\
+ %{!maix64:%{!shared:%{g*:-lg}}}\
%{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
%{mthreads:-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a}\
%{!mthreads:-lc}"
#undef LINK_SPEC
#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
- %{static:-bnso %(link_syscalls) } %{!m64:%{!shared:%{g*: %(link_libg) }}}\
- %{shared:-bM:SRE %{!e:-bnoentry}} %{m64:-b64}"
+ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\
+ %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared:\
@@ -177,8 +177,8 @@ do { \
%{!pg:%{p:/usr/lpp/ppe.poe/lib/mcrt0.o}\
%{!p:/usr/lpp/ppe.poe/lib/crt0.o}}}\
%{!mpe:\
- %{m64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
- %{!m64:\
+ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
+ %{!maix64:\
%{mthreads:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
%{!mthreads:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
@@ -192,3 +192,13 @@ do { \
#undef RS6000_CALL_GLUE
#define RS6000_CALL_GLUE "{cror 31,31,31|nop}"
+
+#if 0
+/* AIX 4.2 and above provides initialization and finalization function
+ support from linker command line. */
+#undef HAS_INIT_SECTION
+#define HAS_INIT_SECTION
+
+#undef LD_INIT_SWITCH
+#define LD_INIT_SWITCH "-binitfini"
+#endif
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 96be67e1190..a6c5d21c218 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -186,6 +186,9 @@ rs6000_override_options (default_cpu)
{"power2", PROCESSOR_POWER,
MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING,
POWERPC_MASKS | MASK_NEW_MNEMONICS},
+ {"power3", PROCESSOR_PPC630,
+ MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
+ POWER_MASKS | MASK_PPC_GPOPT},
{"powerpc", PROCESSOR_POWERPC,
MASK_POWERPC | MASK_NEW_MNEMONICS,
POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
@@ -1243,7 +1246,6 @@ small_data_operand (op, mode)
return 0;
#endif
}
-
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
@@ -3804,7 +3806,7 @@ rs6000_stack_info ()
}
/* Determine if we need to save the link register */
- if (regs_ever_live[65]
+ if (regs_ever_live[LINK_REGISTER_REGNUM]
|| (DEFAULT_ABI == ABI_AIX && profile_flag)
#ifdef TARGET_RELOCATABLE
|| (TARGET_RELOCATABLE && (get_pool_size () != 0))
@@ -3816,7 +3818,7 @@ rs6000_stack_info ()
|| info_ptr->calls_p)
{
info_ptr->lr_save_p = 1;
- regs_ever_live[65] = 1;
+ regs_ever_live[LINK_REGISTER_REGNUM] = 1;
if (abi == ABI_NT)
info_ptr->lr_size = reg_size;
}
@@ -4895,7 +4897,9 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
const char *prefix;
char *fname;
const char *r0 = reg_names[0];
+#if TARGET_ELF
const char *sp = reg_names[1];
+#endif
const char *toc = reg_names[2];
const char *schain = reg_names[11];
const char *r12 = reg_names[12];
@@ -5287,7 +5291,6 @@ output_toc (file, x, labelno)
else /* This is indeed a duplicate.
Set this label equal to that label. */
{
- char s1[40], s2[40];
fputs ("\t.set ", file);
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LC");
fprintf (file, "%d,", labelno);
@@ -5536,7 +5539,7 @@ output_ascii (file, p, n)
/* Now close the string if we have written one. Then end the line. */
if (to_close)
- fprintf (file, to_close);
+ fputs (to_close, file);
}
/* Generate a unique section name for FILENAME for a section type
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 4bb9d1591aa..697dc519150 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
- Copyright (C) 1992, 93-8, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93-99, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
@@ -219,7 +219,6 @@ extern int target_flags;
#define TARGET_POWERPC (target_flags & MASK_POWERPC)
#define TARGET_PPC_GPOPT (target_flags & MASK_PPC_GPOPT)
#define TARGET_PPC_GFXOPT (target_flags & MASK_PPC_GFXOPT)
-#define TARGET_POWERPC64 (target_flags & MASK_POWERPC64)
#define TARGET_NEW_MNEMONICS (target_flags & MASK_NEW_MNEMONICS)
#define TARGET_NO_FP_IN_TOC (target_flags & MASK_NO_FP_IN_TOC)
#define TARGET_NO_SUM_IN_TOC (target_flags & MASK_NO_SUM_IN_TOC)
@@ -240,6 +239,17 @@ extern int target_flags;
#define TARGET_UPDATE (! TARGET_NO_UPDATE)
#define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD)
+#ifdef IN_LIBGCC2
+/* For libgcc2 we make sure this is a compile time constant */
+#ifdef __64BIT__
+#define TARGET_POWERPC64 1
+#else
+#define TARGET_POWERPC64 0
+#endif
+#else
+#define TARGET_POWERPC64 (target_flags & MASK_POWERPC64)
+#endif
+
#define TARGET_XL_CALL 0
/* Run-time compilation parameters selecting different hardware subsets.
@@ -440,7 +450,6 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* Define this to change the optimizations performed by default. */
#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
-
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
@@ -568,6 +577,9 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 64
+/* Handle #pragma pack. */
+#define HANDLE_PRAGMA_PACK 1
+
/* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
(TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
@@ -609,6 +621,14 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* Non-zero if move instructions will actually fail to work
when given unaligned data. */
#define STRICT_ALIGNMENT 0
+
+/* Define this macro to be the value 1 if unaligned accesses have a cost
+ many times greater than aligned accesses, for example if they are
+ emulated in a trap handler. */
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) \
+ ((STRICT_ALIGNMENT \
+ || (((MODE) == SFmode || (MODE) == DFmode || (MODE) == DImode) \
+ && (ALIGN) < 4)) ? 1 : 0)
/* Standard register usage. */
@@ -715,7 +735,7 @@ extern int rs6000_debug_arg; /* debug argument handling */
#define CR_REGNO_NOT_CR0_P(N) ((N) >= 69 && (N) <= 75)
/* True if register is an integer register. */
-#define INT_REGNO_P(N) ((N) <= 31 || (N) == 67)
+#define INT_REGNO_P(N) ((N) <= 31 || (N) == ARG_POINTER_REGNUM)
/* True if register is the temporary memory location used for int/float
conversion. */
@@ -789,8 +809,8 @@ extern int rs6000_debug_arg; /* debug argument handling */
On the RS/6000, bump this up a bit. */
-#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
- ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
+#define MEMORY_MOVE_COST(MODE, CLASS, IN) \
+ ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
&& (rs6000_cpu == PROCESSOR_RIOS1 || rs6000_cpu == PROCESSOR_PPC601) \
? 3 : 2) \
+ 4)
@@ -810,7 +830,7 @@ extern int rs6000_debug_arg; /* debug argument handling */
output-dependencies. In fact, output dependencies on the CR do have
a cost, but it is probably not worthwhile to track it. */
-#define ADJUST_COST(INSN,LINK,DEP_INSN,COST) \
+#define ADJUST_COST(INSN, LINK, DEP_INSN, COST) \
(COST) = rs6000_adjust_cost (INSN,LINK,DEP_INSN,COST)
/* A C statement (sans semicolon) to update the integer scheduling priority
@@ -866,7 +886,10 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* Place to put static chain when calling a function that requires it. */
#define STATIC_CHAIN_REGNUM 11
-/* count register number for special purposes */
+/* Link register number. */
+#define LINK_REGISTER_REGNUM 65
+
+/* Count register number. */
#define COUNT_REGISTER_REGNUM 66
/* Special register that represents memory, used for float/int conversions. */
@@ -1187,10 +1210,15 @@ typedef struct rs6000_stack {
/* #define FRAME_GROWS_DOWNWARD */
/* Size of the outgoing register save area */
-#define RS6000_REG_SAVE (TARGET_32BIT ? 32 : 64)
+#define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \
+ || DEFAULT_ABI == ABI_AIX_NODESC) \
+ ? (TARGET_64BIT ? 64 : 32) \
+ : 0)
/* Size of the fixed area on the stack */
-#define RS6000_SAVE_AREA (TARGET_32BIT ? 24 : 48)
+#define RS6000_SAVE_AREA \
+ (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) \
+ << (TARGET_64BIT ? 1 : 0))
/* MEM representing address to save the TOC register */
#define RS6000_SAVE_TOC gen_rtx_MEM (Pmode, \
@@ -1330,7 +1358,9 @@ extern int rs6000_sysv_varargs_p;
#define FP_ARG_MIN_REG 33
#define FP_ARG_AIX_MAX_REG 45
#define FP_ARG_V4_MAX_REG 40
-#define FP_ARG_MAX_REG FP_ARG_AIX_MAX_REG
+#define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX \
+ || DEFAULT_ABI == ABI_AIX_NODESC) \
+ ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
#define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1)
/* Return registers */
@@ -1614,7 +1644,7 @@ typedef struct rs6000_args
frame pointer. */
#define RETURN_ADDR_RTX(count, frame) \
((count == -1) \
- ? gen_rtx_REG (Pmode, 65) \
+ ? gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM) \
: gen_rtx_MEM (Pmode, \
memory_address \
(Pmode, \
@@ -2063,7 +2093,7 @@ do { \
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
-#define CASE_VECTOR_MODE (TARGET_32BIT ? SImode : DImode)
+#define CASE_VECTOR_MODE SImode
/* Define as C expression which evaluates to nonzero if the tablejump
instruction expects the table to contain offsets from the address of the
@@ -2355,18 +2385,6 @@ extern int rs6000_trunc_used;
rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
}
-/* Output at end of assembler file.
-
- On the RS/6000, referencing data should automatically pull in text. */
-
-#define ASM_FILE_END(FILE) \
-{ \
- text_section (); \
- fputs ("_section_.text:\n", FILE); \
- data_section (); \
- fputs ("\t.long _section_.text\n", FILE); \
-}
-
/* We define this to prevent the name mangler from putting dollar signs into
function names. */
@@ -2382,20 +2400,6 @@ extern int rs6000_trunc_used;
#define TARGET_MEM_FUNCTIONS
-/* Define the extra sections we need. We define three: one is the read-only
- data section which is used for constants. This is a csect whose name is
- derived from the name of the input file. The second is for initialized
- global variables. This is a csect whose name is that of the variable.
- The third is the TOC. */
-
-#define EXTRA_SECTIONS \
- read_only_data, private_data, read_only_private_data, toc, bss
-
-/* Define the name of our readonly data section. */
-
-#define READONLY_DATA_SECTION read_only_data_section
-
-
/* Define the name of the section to use for the exception tables.
TODO: test and see if we can use read_only_data_section, if so,
remove this. */
@@ -2407,81 +2411,12 @@ extern int rs6000_trunc_used;
that we can branch to this function without emitting a no-op after the
call. Do not set this flag if the function is weakly defined. */
-#define ENCODE_SECTION_INFO(DECL) \
+#define ENCODE_SECTION_INFO(DECL) \
if (TREE_CODE (DECL) == FUNCTION_DECL \
&& (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
- && !DECL_WEAK (DECL)) \
+ && ! DECL_WEAK (DECL)) \
SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
-/* Indicate that jump tables go in the text section. */
-
-#define JUMP_TABLES_IN_TEXT_SECTION 1
-
-/* Define the routines to implement these extra sections.
- BIGGEST_ALIGNMENT is 64, so align the sections that much. */
-
-#define EXTRA_SECTION_FUNCTIONS \
- \
-void \
-read_only_data_section () \
-{ \
- if (in_section != read_only_data) \
- { \
- fprintf (asm_out_file, ".csect %s[RO],3\n", \
- xcoff_read_only_section_name); \
- in_section = read_only_data; \
- } \
-} \
- \
-void \
-private_data_section () \
-{ \
- if (in_section != private_data) \
- { \
- fprintf (asm_out_file, ".csect %s[RW],3\n", \
- xcoff_private_data_section_name); \
- in_section = private_data; \
- } \
-} \
- \
-void \
-read_only_private_data_section () \
-{ \
- if (in_section != read_only_private_data) \
- { \
- fprintf (asm_out_file, ".csect %s[RO],3\n", \
- xcoff_private_data_section_name); \
- in_section = read_only_private_data; \
- } \
-} \
- \
-void \
-toc_section () \
-{ \
- if (TARGET_MINIMAL_TOC) \
- { \
- /* toc_section is always called at least once from ASM_FILE_START, \
- so this is guaranteed to always be defined once and only once \
- in each file. */ \
- if (! toc_initialized) \
- { \
- fputs (".toc\nLCTOC..0:\n", asm_out_file); \
- fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
- toc_initialized = 1; \
- } \
- \
- if (in_section != toc) \
- fprintf (asm_out_file, ".csect toc_table[RW]%s\n", \
- (TARGET_32BIT ? "" : ",3")); \
- } \
- else \
- { \
- if (in_section != toc) \
- fputs (".toc\n", asm_out_file); \
- } \
- in_section = toc; \
-}
-
/* Flag to say the TOC is initialized */
extern int toc_initialized;
@@ -2491,9 +2426,10 @@ extern int toc_initialized;
The csect for the function will have already been created by the
`text_section' call previously done. We do have to go back to that
- csect, however. */
+ csect, however.
-/* ??? What do the 16 and 044 in the .function line really mean? */
+ The third and fourth parameters to the .function pseudo-op (16 and 044)
+ are placeholders which no longer have any use. */
#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
{ if (TREE_PUBLIC (DECL)) \
@@ -2508,7 +2444,7 @@ extern int toc_initialized;
RS6000_OUTPUT_BASENAME (FILE, NAME); \
putc ('\n', FILE); \
} \
- fputs (".csect ", FILE); \
+ fputs ("\t.csect ", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
@@ -2516,7 +2452,8 @@ extern int toc_initialized;
fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (", TOC[tc0], 0\n", FILE); \
- fputs (".csect .text[PR]\n.", FILE); \
+ fputs (TARGET_32BIT \
+ ? "\t.csect .text[PR]\n." : "\t.csect .text[PR],3\n.", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (":\n", FILE); \
if (write_symbols == XCOFF_DEBUG) \
@@ -2571,36 +2508,6 @@ extern int toc_initialized;
} \
}
-/* Select the section for an initialized data object.
-
- On the RS/6000, we have a special section for all variables except those
- that are static. */
-
-#define SELECT_SECTION(EXP,RELOC) \
-{ \
- if ((TREE_CODE (EXP) == STRING_CST \
- && ! flag_writable_strings) \
- || (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'd' \
- && TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \
- && DECL_INITIAL (EXP) \
- && (DECL_INITIAL (EXP) == error_mark_node \
- || TREE_CONSTANT (DECL_INITIAL (EXP))) \
- && ! (RELOC))) \
- { \
- if (TREE_PUBLIC (EXP)) \
- read_only_data_section (); \
- else \
- read_only_private_data_section (); \
- } \
- else \
- { \
- if (TREE_PUBLIC (EXP)) \
- data_section (); \
- else \
- private_data_section (); \
- } \
-}
-
/* This outputs NAME to FILE up to the first null or '['. */
#define RS6000_OUTPUT_BASENAME(FILE, NAME) \
@@ -2658,7 +2565,7 @@ do { \
Text section for 64-bit target may contain 64-bit address jump table. */
#define TEXT_SECTION_ASM_OP (TARGET_32BIT \
- ? ".csect .text[PR]" : ".csect .text[PR],3")
+ ? "\t.csect .text[PR]" : "\t.csect .text[PR],3")
/* Output before writable data.
Align entire section to BIGGEST_ALIGNMENT. */
@@ -2923,7 +2830,7 @@ do { \
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { char buf[100]; \
- fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
+ fputs ("\t.long ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
putc ('\n', FILE); \
@@ -2931,9 +2838,9 @@ do { \
/* This is how to output an element of a case-vector that is relative. */
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do { char buf[100]; \
- fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
+ fputs ("\t.long ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
putc ('-', FILE); \
@@ -3126,7 +3033,7 @@ extern struct rtx_def *function_arg ();
extern int function_arg_partial_nregs ();
extern int function_arg_pass_by_reference ();
extern void setup_incoming_varargs ();
-extern union tree_node *rs6000_va_list ();
+extern union tree_node *rs6000_build_va_list ();
extern void rs6000_va_start ();
extern struct rtx_def *rs6000_va_arg ();
extern struct rtx_def *rs6000_stack_temp ();
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 292a4f280f8..a7e4953a441 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -4288,7 +4288,7 @@
;; Load up scratch register with base address + offset if needed
(define_insn "*floatsidf2_loadaddr"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
+ [(set (match_operand 0 "gpc_reg_operand" "=b")
(unspec [(const_int 0)] 11))]
"TARGET_HARD_FLOAT"
"*
@@ -4409,13 +4409,23 @@
operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);
}")
-(define_insn "*fix_truncdfsi2_internal"
+(define_insn "*fix_truncdfsi2_internal_si"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
(clobber (match_operand:SI 3 "gpc_reg_operand" "=b"))
(clobber (reg:DI 76))]
- "TARGET_HARD_FLOAT"
+ "TARGET_HARD_FLOAT && ! TARGET_POWERPC64"
+ "#"
+ [(set_attr "length" "12")])
+
+(define_insn "*fix_truncdfsi2_internal_di"
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
+ (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
+ (clobber (match_operand:DI 3 "gpc_reg_operand" "=b"))
+ (clobber (reg:DI 76))]
+ "TARGET_HARD_FLOAT && TARGET_POWERPC64"
"#"
[(set_attr "length" "12")])
@@ -4442,7 +4452,7 @@
(define_insn "*fix_truncdfsi2_store"
[(set (reg:DI 76)
(unspec [(match_operand:DI 0 "gpc_reg_operand" "f")
- (match_operand:SI 1 "gpc_reg_operand" "b")] 15))]
+ (match_operand 1 "gpc_reg_operand" "b")] 15))]
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
"*
{
@@ -4467,7 +4477,7 @@
(define_insn "*fix_truncdfsi2_load"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(unspec [(reg:DI 76)
- (match_operand:SI 1 "gpc_reg_operand" "b")] 16))]
+ (match_operand 1 "gpc_reg_operand" "b")] 16))]
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
"*
{
@@ -10666,16 +10676,18 @@
}")
(define_expand "tablejumpdi"
- [(set (match_dup 3)
- (plus:DI (match_operand:DI 0 "" "")
+ [(set (match_dup 4)
+ (sign_extend:DI (match_operand:SI 0 "lwa_operand" "rm")))
+ (set (match_dup 3)
+ (plus:DI (match_dup 4)
(match_dup 2)))
(parallel [(set (pc) (match_dup 3))
(use (label_ref (match_operand 1 "" "")))])]
"TARGET_64BIT"
"
-{ operands[0] = force_reg (DImode, operands[0]);
- operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
+{ operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
operands[3] = gen_reg_rtx (DImode);
+ operands[4] = gen_reg_rtx (DImode);
}")
(define_insn ""
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index bf14072f0d3..1215c7283e3 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a PowerPC using elf.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -35,4 +35,5 @@ Boston, MA 02111-1307, USA. */
#undef STARTFILE_DEFAULT_SPEC
#define STARTFILE_DEFAULT_SPEC "crt0.o%s"
-/* end of rs6000/rtems.h */
+/* Get machine-independent configuration parameters for RTEMS. */
+#include <rtems.h>
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 1778cb58837..07f2cc944ad 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -21,12 +21,6 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/rs6000.h"
-/* Undefine some things which are defined by the generic svr4.h. */
-
-#undef ASM_FILE_END
-#undef READONLY_DATA_SECTION
-#undef SELECT_SECTION
-
/* Use the regular svr4 definitions. */
#include "svr4.h"
@@ -297,12 +291,6 @@ do { \
#define FIXED_R13 1
-/* System V.4 passes the first 8 floating arguments in registers,
- instead of the first 13 like AIX does. */
-#undef FP_ARG_MAX_REG
-#define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) \
- ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
-
/* Size of the V.4 varargs area if needed */
#undef RS6000_VARARGS_AREA
#define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)
@@ -328,19 +316,12 @@ do { \
? (TARGET_64BIT ? 64 : 32) \
: 0)
-/* Size of the fixed area on the stack. For AIX, use the standard 6 word
- area, otherwise use 2 words to store back chain & LR. */
-#undef RS6000_SAVE_AREA
-#define RS6000_SAVE_AREA \
- (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) << (TARGET_64BIT ? 1 : 0))
-
/* Define cutoff for using external functions to save floating point.
Currently on V.4, always use inline stores */
#undef FP_SAVE_INLINE
#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
/* Put jump tables in read-only memory, rather than in .text. */
-#undef JUMP_TABLES_IN_TEXT_SECTION
#define JUMP_TABLES_IN_TEXT_SECTION 0
/* Prefix and suffix to use to saving floating point */
@@ -827,7 +808,6 @@ do { \
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#define DBX_DEBUGGING_INFO
-#define DWARF_DEBUGGING_INFO
/* If we are referencing a function that is static or is known to be
in this file, make the SYMBOL_REF special. We can use this to indicate
diff --git a/gcc/config/rs6000/t-aix43 b/gcc/config/rs6000/t-aix43
index 6a7a96babca..fcc18a168b9 100644
--- a/gcc/config/rs6000/t-aix43
+++ b/gcc/config/rs6000/t-aix43
@@ -18,7 +18,7 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
# different processor models
MULTILIB_OPTIONS = msoft-float \
- mcpu=common/mcpu=power/mcpu=powerpc/m64
+ mcpu=common/mcpu=power/mcpu=powerpc/maix64
MULTILIB_DIRNAMES = soft-float \
common power powerpc ppc64