Commit 2bfcf297 by Daniel Berlin Committed by Daniel Berlin

PowerPC reorg and support for powerpc64-*-linux*.

2001-07-31  Daniel Berlin  <dan@cgsoftware.com>

	PowerPC reorg and support for powerpc64-*-linux*.

	Also fixes emitting of constants on 32 bit and 64 bit
	platforms.

	* config.gcc: powerpc64-*-linux* is a new target.
	Things that needed aix.h now also include xcoff.h

	* config/rs6000/rs6000.h: Split XCOFF specific stuff into
	xcoff.h.
	Move AIX specific stuff into aix.h.
	(ASM_LONG): Use DOUBLE_INT_ASM_OP if we are on a 64 bit target.
	(ASM_OUTPUT_DOUBLE_INT): Ditto.
	(TARGET_AIX): Renamed to TARGET_XCOFF, since the AIX ABI is used
	with more than just XCOFF now.
	(SET_ASM_OP): Remove, now defined where needed.
	(FUNCTION_PROLOGUE): New macro definition.
	(FUNCTION_EPILOGUE): New macro definition.
	(CONST_OK_FOR_LETTER_P): Change N to require that value is
	positive, too.
	(ASM_OPEN_PAREN, ASM_CLOSE_PAREN): New macro definition.
	(PREDICATE_CODES): Added exact_log2_cint_operand,
	reg_or_add_cint64_operand, reg_or_sub_cint64_operand.

	* config/rs6000/rs6000.c: #ifdef XCOFF debugging info stuff on
	XCOFF_DEBUGGING_INFO.
	Use DOUBLE_INT_ASM_OP where approriate.
	(rs6000_emit_set_long_const): New function.
	(rs6000_emit_set_const): New function.
	(reg_or_sub_cint64_operand): New function.
	(reg_or_add_cint64_operand): New function.
	(exact_log2_cint_operand): New function.

	* config/rs6000/rs6000.md: Fix emitting of constants.
	Fix patterns that were AIX ABI specific, but depended on
	!TARGET_ELF (instead of DEFAULT_ABI == ABI_AIX).

	* config/rs6000/xcoff.h: New file.

	* config/rs6000/linux64.h: New file.

	* config/rs6000/darwin.h: Copy needed AIX alignment definitions.

From-SVN: r44516
parent befe7c61
2001-07-31 Daniel Berlin <dan@cgsoftware.com>
PowerPC reorg and support for powerpc64-*-linux*.
Also fixes emitting of constants on 32 bit and 64 bit
platforms.
* config.gcc: powerpc64-*-linux* is a new target.
Things that needed aix.h now also include xcoff.h
* config/rs6000/rs6000.h: Split XCOFF specific stuff into
xcoff.h.
Move AIX specific stuff into aix.h.
(ASM_LONG): Use DOUBLE_INT_ASM_OP if we are on a 64 bit target.
(ASM_OUTPUT_DOUBLE_INT): Ditto.
(TARGET_AIX): Renamed to TARGET_XCOFF, since the AIX ABI is used
with more than just XCOFF now.
(SET_ASM_OP): Remove, now defined where needed.
(FUNCTION_PROLOGUE): New macro definition.
(FUNCTION_EPILOGUE): New macro definition.
(CONST_OK_FOR_LETTER_P): Change N to require that value is
positive, too.
(ASM_OPEN_PAREN, ASM_CLOSE_PAREN): New macro definition.
(PREDICATE_CODES): Added exact_log2_cint_operand,
reg_or_add_cint64_operand, reg_or_sub_cint64_operand.
* config/rs6000/rs6000.c: #ifdef XCOFF debugging info stuff on
XCOFF_DEBUGGING_INFO.
Use DOUBLE_INT_ASM_OP where approriate.
(rs6000_emit_set_long_const): New function.
(rs6000_emit_set_const): New function.
(reg_or_sub_cint64_operand): New function.
(reg_or_add_cint64_operand): New function.
(exact_log2_cint_operand): New function.
* config/rs6000/rs6000.md: Fix emitting of constants.
Fix patterns that were AIX ABI specific, but depended on
!TARGET_ELF (instead of DEFAULT_ABI == ABI_AIX).
* config/rs6000/xcoff.h: New file.
* config/rs6000/linux64.h: New file.
* config/rs6000/darwin.h: Copy needed AIX alignment definitions.
2001-07-31 Graham Stott <grahams@redhat.com>
* function.c (pad_below): Revert 2001-07-26 patch.
......
......@@ -2559,9 +2559,16 @@ romp-*-openbsd*)
powerpc-*-openbsd*)
tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
;;
powerpc64-*-linux*)
tm_file="${tm_file} svr4.h rs6000/sysv4.h rs6000/linux64.h"
out_file=rs6000/rs6000.c
tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
xmake_file=x-linux
extra_headers=ppc-asm.h
;;
powerpc-*-beos*)
cpu_type=rs6000
tm_file="${tm_file} rs6000/aix.h rs6000/beos.h"
tm_file="${tm_file} rs6000/aix.h rs6000/beos.h rs6000/xcoff.h"
xm_defines=POSIX
xm_file=rs6000/xm-beos.h
tmake_file=rs6000/t-beos
......@@ -2700,27 +2707,27 @@ powerpcle-*-solaris2*)
;;
rs6000-ibm-aix3.[01]*)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h rs6000/aix31.h"
tm_file="${tm_file} rs6000/aix.h rs6000/aix31.h rs6000/xcoff.h"
float_format=none
use_collect2=yes
;;
rs6000-ibm-aix3.2.[456789]* | powerpc-ibm-aix3.2.[456789]*)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h rs6000/aix3newas.h"
tm_file="${tm_file} rs6000/aix.h rs6000/aix3newas.h rs6000/xcoff.h"
tmake_file=rs6000/t-newas
float_format=none
use_collect2=yes
;;
rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h"
tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h rs6000/xcoff.h"
tmake_file=rs6000/t-newas
float_format=none
use_collect2=yes
;;
rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h rs6000/aix43.h"
tm_file="${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h"
tmake_file=rs6000/t-aix43
float_format=none
use_collect2=yes
......@@ -2728,7 +2735,7 @@ rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
;;
rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h rs6000/aix51.h"
tm_file="${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h"
tmake_file=rs6000/t-aix43
float_format=none
use_collect2=yes
......@@ -2736,13 +2743,13 @@ rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
;;
rs6000-ibm-aix*)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h"
tm_file="${tm_file} rs6000/aix.h rs6000/xcoff.h"
float_format=none
use_collect2=yes
;;
rs6000-bull-bosx)
xm_defines=POSIX
tm_file="${tm_file} rs6000/aix.h"
tm_file="${tm_file} rs6000/aix.h rs6000/xcoff.h"
float_format=none
use_collect2=yes
;;
......
......@@ -173,3 +173,21 @@ Boston, MA 02111-1307, USA. */
/* Fix for emit_group_load (): force large constants to be pushed via regs. */
#define ALWAYS_PUSH_CONSTS_USING_REGS_P 1
/* Darwin 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 \
? get_inner_array_type (FIELD) \
: TREE_TYPE (FIELD)) == DFmode \
? MIN ((COMPUTED), 32) : (COMPUTED))
/* Darwin increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
((TREE_CODE (STRUCT) == RECORD_TYPE \
|| TREE_CODE (STRUCT) == UNION_TYPE \
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
&& TYPE_FIELDS (STRUCT) != 0 \
&& DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode \
? MAX (MAX ((COMPUTED), (SPECIFIED)), BIGGEST_ALIGNMENT) \
: MAX ((COMPUTED), (SPECIFIED)))
......@@ -69,6 +69,11 @@ Boston, MA 02111-1307, USA. */
#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"
#undef DEFAULT_VTABLE_THUNKS
#ifndef USE_GNULIBC_1
#define DEFAULT_VTABLE_THUNKS 1
#endif
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
......
......@@ -34,6 +34,7 @@ extern int any_operand PARAMS ((rtx, enum machine_mode));
extern int short_cint_operand PARAMS ((rtx, enum machine_mode));
extern int u_short_cint_operand PARAMS ((rtx, enum machine_mode));
extern int non_short_cint_operand PARAMS ((rtx, enum machine_mode));
extern int exact_log2_cint_operand PARAMS ((rtx, enum machine_mode));
extern int gpc_reg_operand PARAMS ((rtx, enum machine_mode));
extern int cc_reg_operand PARAMS ((rtx, enum machine_mode));
extern int cc_reg_not_cr0_operand PARAMS ((rtx, enum machine_mode));
......@@ -42,6 +43,8 @@ extern int reg_or_neg_short_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_u_short_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_cint_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_arith_cint_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_add_cint64_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_sub_cint64_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_logical_cint_operand PARAMS ((rtx, enum machine_mode));
extern int got_operand PARAMS ((rtx, enum machine_mode));
extern int got_no_const_operand PARAMS ((rtx, enum machine_mode));
......@@ -96,6 +99,7 @@ extern enum rtx_code rs6000_reverse_condition PARAMS ((enum machine_mode,
extern void rs6000_emit_sCOND PARAMS ((enum rtx_code, rtx));
extern void rs6000_emit_cbranch PARAMS ((enum rtx_code, rtx));
extern char * output_cbranch PARAMS ((rtx, const char *, int, rtx));
extern rtx rs6000_emit_set_const PARAMS ((rtx, enum machine_mode, rtx, int));
extern int rs6000_emit_cmove PARAMS ((rtx, rtx, rtx, rtx));
extern void rs6000_emit_minmax PARAMS ((rtx, enum rtx_code, rtx, rtx));
extern void output_toc PARAMS ((FILE *, rtx, int, enum machine_mode));
......
......@@ -37,6 +37,79 @@ Boston, MA 02111-1307, USA. */
/* Override rs6000.h definition. */
#undef CPP_DEFAULT_SPEC
#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
/* Common CPP definitions used by CPP_SPEC among the various targets
for handling -mcpu=xxx switches. */
#define CPP_CPU_SPEC \
"%{!mcpu*: \
%{mpower: %{!mpower2: -D_ARCH_PWR}} \
%{mpower2: -D_ARCH_PWR2} \
%{mpowerpc*: -D_ARCH_PPC} \
%{mno-power: %{!mpowerpc*: -D_ARCH_COM}} \
%{!mno-power: %{!mpower2: %(cpp_default)}}} \
%{mcpu=common: -D_ARCH_COM} \
%{mcpu=power: -D_ARCH_PWR} \
%{mcpu=power2: -D_ARCH_PWR2} \
%{mcpu=powerpc: -D_ARCH_PPC} \
%{mcpu=rios: -D_ARCH_PWR} \
%{mcpu=rios1: -D_ARCH_PWR} \
%{mcpu=rios2: -D_ARCH_PWR2} \
%{mcpu=rsc: -D_ARCH_PWR} \
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=401: -D_ARCH_PPC} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=505: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=602: -D_ARCH_PPC} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=603e: -D_ARCH_PPC} \
%{mcpu=ec603e: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC} \
%{mcpu=604e: -D_ARCH_PPC} \
%{mcpu=620: -D_ARCH_PPC} \
%{mcpu=740: -D_ARCH_PPC} \
%{mcpu=750: -D_ARCH_PPC} \
%{mcpu=801: -D_ARCH_PPC} \
%{mcpu=821: -D_ARCH_PPC} \
%{mcpu=823: -D_ARCH_PPC} \
%{mcpu=860: -D_ARCH_PPC}"
#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"
/* Common ASM definitions used by ASM_SPEC among the various targets
for handling -mcpu=xxx switches. */
#define ASM_CPU_SPEC \
"%{!mcpu*: \
%{mpower: %{!mpower2: -mpwr}} \
%{mpower2: -mpwrx} \
%{mpowerpc*: -mppc} \
%{mno-power: %{!mpowerpc*: -mcom}} \
%{!mno-power: %{!mpower2: %(asm_default)}}} \
%{mcpu=common: -mcom} \
%{mcpu=power: -mpwr} \
%{mcpu=power2: -mpwrx} \
%{mcpu=powerpc: -mppc} \
%{mcpu=rios: -mpwr} \
%{mcpu=rios1: -mpwr} \
%{mcpu=rios2: -mpwrx} \
%{mcpu=rsc: -mpwr} \
%{mcpu=rsc1: -mpwr} \
%{mcpu=401: -mppc} \
%{mcpu=403: -mppc} \
%{mcpu=505: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=602: -mppc} \
%{mcpu=603: -mppc} \
%{mcpu=603e: -mppc} \
%{mcpu=ec603e: -mppc} \
%{mcpu=604: -mppc} \
%{mcpu=604e: -mppc} \
%{mcpu=620: -mppc} \
%{mcpu=740: -mppc} \
%{mcpu=750: -mppc} \
%{mcpu=801: -mppc} \
%{mcpu=821: -mppc} \
%{mcpu=823: -mppc} \
%{mcpu=860: -mppc}"
/* Small data support types. */
enum rs6000_sdata_type {
......@@ -694,10 +767,9 @@ extern int rs6000_pic_labelno;
the return address. Hence returning from FUNCTION will return to whoever
called the current thunk'.
The effect must be as if FUNCTION had been called directly with
the adjusted first argument. This macro is responsible for
emitting all of the code for a thunk function;
output_function_prologue() and output_function_epilogue() are not
The effect must be as if FUNCTION had been called directly with the adjusted
first argument. This macro is responsible for emitting all of the code for
a thunk function; FUNCTION_PROLOGUE' and FUNCTION_EPILOGUE' are not
invoked.
The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
......@@ -1191,11 +1263,11 @@ do { \
#define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
#define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Aendian=big"
#define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian"
#define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Aendian=little"
#define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian"
#define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Aendian=little"
#define CPP_ENDIAN_SOLARIS_SPEC "-D__LITTLE_ENDIAN__ -Amachine=littleendian"
/* For solaris, don't define _LITTLE_ENDIAN, it conflicts with a header file. */
#define CPP_ENDIAN_SPEC \
......@@ -1606,3 +1678,4 @@ do { \
: DW_EH_PE_absptr)
#define EXCEPTION_SECTION readonly_data_section
#define DOUBLE_INT_ASM_OP ".quad"
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