Commit 30102605 by Richard Henderson

Cray T3E port.

From-SVN: r45539
parent b1c4394d
2001-09-11 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c: Tidy formatting.
(local_symbolic_operand): Verify mode.
(alpha_sa_mask): Ignore unicos for eh_return.
(alpha_expand_epilogue): Handle sp_adj2 zero, not NULL.
* config/alpha/alpha.md (umk divsi patterns): Remove.
(extendsfdf2): Remove unicos check.
(tablejump): Merge vms and unicos code; always use direct set
plus label_ref use.
2001-09-11 Roman Lechtchinsky <rl@cs.tu-berlin.de>
* config.gcc (alpha*-*-unicosmk*): New target.
* config/alpha/alpha-protos.h (symbolic_operand,
unicosmk_add_call_info_word, unicosmk_add_extern,
unicosmk_defer_case_vector, unicosmk_unique_section,
unicosmk_output_align, unicosmk_text_section, unicosmk_data_section,
unicosmk_asm_file_start, unicosmk_asm_file_end,
unicosmk_output_common): Declare.
* config/alpha/alpha.c (NUM_ARGS, override_options, call_operand,
direct_return, function_arg, alpha_va_start, alpha_va_arg,
alpha_does_function_need_gp, alpha_end_function): Support Cray
Unicos/Mk.
(alpha_init_machine_status, alpha_mark_machine_status,
alpha_free_machine_status, unicosmk_output_deferred_case_vectors,
unicosmk_gen_dsib, unicosmk_output_ssib, unicosmk_need_dex,
unicosmk_asm_named_section, unicosmk_insert_attributes,
unicosmk_section_type_flags, symbolic_operand,
unicosmk_output_module_name, unicosmk_output_default_externs,
unicosmk_output_dex, unicosmk_output_externs,
unicosmk_output_addr_vec, unicosmk_ssib_name,
unicosmk_initial_elimination_offset, unicosmk_asm_file_start,
unicosmk_asm_file_end, unicosmk_output_common,
unicosmk_section_type_flags, unicosmk_unique_section,
unicosmk_add_call_info_word, unicosmk_text_section,
unicosmk_data_section, unicosmk_extern_list, unicosmk_extern_head,
unicosmk_add_extern, unicosmk_dex, unicosmk_dex_list,
unicosmk_dex_count, unicosmk_special_name): New.
(TARGET_INSERT_ATTRIBUTES, TARGET_SECTION_TYPE_FLAGS): Define for
TARGET_ABI_UNICOSMK.
(get_aligned_mem, alpha_expand_unaligned_load,
alpha_expand_unaligned_store, alpha_expand_unaligned_load_words,
alpha_expand_unaligned_store_words): Support big-endian mode.
(print_operand): Likewise. New format specifier 't'. Use
TARGET_AS_SLASH_BEFORE_SUFFIX.
(alpha_is_stack_procedure): Rename from vms_is_stack_procedure.
(alpha_pv_save_size): Update with above change.
(alpha_sa_mask, alpha_sa_size, alpha_expand_prologue,
alpha_start_function, alpha_expand_epilogue): Likewise. Support Cray
Unicos/Mk.
* config/alpha/alpha.h (TARGET_ABI_UNICOSMK): New.
(TARGET_ABI_OSF): Exclude TARGET_ABI_UNICOSMK.
(TARGET_AS_SLASH_BEFORE_SUFFIX): New.
(EXTRA_CONSTRAINT): New constraint 'U'.
(PREDICATE_CODES): Add symbolic_operand.
* config/alpha/alpha.md (UNSPEC_UMK_LAUM, UNSPEC_UMK_LALM,
UNSPEC_UMK_LAL, UNSPEC_UMK_LOAD_CIW): New constants.
(mulsi3, *mulsi_se, mulvsi3): Disable for TARGET_ABI_UNICOSMK.
(integer division and modulus patterns): Split in default and
Unicos/Mk versions.
(*divmodsi_internal, *divmoddi_internal): Disable for
TARGET_ABI_UNICOSMK.
(unaligned_extend?idi, unaligned_load?i, unaligned_store?i): Split in
little-endian and big-endian versions.
(ext, ins, msk): Likewise.
(extv, extzv, insv): Support big-endian mode.
(call, call_value, tablejump): Support TARGET_ABI_UNICOSMK.
(call_umk, call_value_umk, *call_umk, tablejump_umk,
*tablejump_umk_internal, *call_value_umk): New.
(*movdi_nofix): Add pattern for loading an address into a register on
TARGET_ABI_UNICOSMK.
(umk_laum, umk_lal, umk_lalm, *umk_load_ciw): New.
(umk_mismatch_args, arg_home_umk): New.
(various insns): Don't use mov, fmov, nop, fnop and unop.
(realign): Support TARGET_ABI_UNICOSMK.
* config/alpha/unicosmk.h: New file.
* config/alpha/t-unicosmk: New file.
* fixinc/inclhack.def (unicosmk_restrict): New.
* fixinc/fixincl.x: Regenerate.
* ginclude/stddef.h (size_t): Check for and define __SIZE_T__.
(wchar_t): Check for and define __WCHAR_T__.
2001-09-11 Richard Sandiford <rsandifo@redhat.com>
* combine.c (simplify_shift_const): Treat shifts by the mode
......
......@@ -398,6 +398,14 @@ a29k-wrs-vxworks*)
a29k-*-*) # Default a29k environment.
use_collect2=yes
;;
alpha*-*-unicosmk*)
use_collect2=yes
tm_file="${tm_file} alpha/unicosmk.h"
# Don't include t-ieee for now because we don't support that yet
# tmake_file="alpha/t-ieee"
tmake_file="alpha/t-unicosmk"
;;
alpha-*-interix)
tm_file="${tm_file} alpha/alpha32.h interix.h alpha/alpha-interix.h"
......
......@@ -56,6 +56,7 @@ extern int input_operand PARAMS ((rtx, enum machine_mode));
extern int current_file_function_operand PARAMS ((rtx, enum machine_mode));
extern int local_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int call_operand PARAMS ((rtx, enum machine_mode));
extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int alpha_comparison_operator PARAMS ((rtx, enum machine_mode));
extern int alpha_zero_comparison_operator PARAMS ((rtx, enum machine_mode));
extern int alpha_swapped_comparison_operator PARAMS ((rtx, enum machine_mode));
......@@ -149,3 +150,23 @@ extern void alpha_start_function PARAMS ((FILE *, const char *, tree));
extern void alpha_end_function PARAMS ((FILE *, const char *, tree));
extern void alpha_encode_section_info PARAMS ((tree));
#endif /* TREE CODE */
#ifdef RTX_CODE
extern rtx unicosmk_add_call_info_word PARAMS ((rtx));
#endif
#if TARGET_ABI_UNICOSMK
#ifdef RTX_CODE
extern void unicosmk_defer_case_vector PARAMS ((rtx, rtx));
#endif
#ifdef TREE_CODE
extern void unicosmk_unique_section PARAMS ((tree, int));
#endif
extern void unicosmk_add_extern PARAMS ((const char *));
extern void unicosmk_output_align PARAMS ((FILE *, int));
extern char * unicosmk_text_section PARAMS ((void));
extern char * unicosmk_data_section PARAMS ((void));
extern void unicosmk_asm_file_start PARAMS ((FILE *));
extern void unicosmk_asm_file_end PARAMS ((FILE *));
extern void unicosmk_output_common PARAMS ((FILE *, const char *, int, int));
#endif /* TARGET_ABI_UNICOSMK */
......@@ -179,11 +179,17 @@ extern enum alpha_fp_trap_mode alpha_fptm;
/* These are for target os support and cannot be changed at runtime. */
#define TARGET_ABI_WINDOWS_NT 0
#define TARGET_ABI_OPEN_VMS 0
#define TARGET_ABI_OSF (!TARGET_ABI_WINDOWS_NT && !TARGET_ABI_OPEN_VMS)
#define TARGET_ABI_UNICOSMK 0
#define TARGET_ABI_OSF (!TARGET_ABI_WINDOWS_NT \
&& !TARGET_ABI_OPEN_VMS \
&& !TARGET_ABI_UNICOSMK)
#ifndef TARGET_AS_CAN_SUBTRACT_LABELS
#define TARGET_AS_CAN_SUBTRACT_LABELS TARGET_GAS
#endif
#ifndef TARGET_AS_SLASH_BEFORE_SUFFIX
#define TARGET_AS_SLASH_BEFORE_SUFFIX TARGET_GAS
#endif
#ifndef TARGET_CAN_FAULT_IN_PROLOGUE
#define TARGET_CAN_FAULT_IN_PROLOGUE 0
#endif
......@@ -792,7 +798,9 @@ enum reg_class { NO_REGS, PV_REG, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
`R' is a SYMBOL_REF that has SYMBOL_REF_FLAG set or is the current
function.
'S' is a 6-bit constant (valid for a shift insn). */
'S' is a 6-bit constant (valid for a shift insn).
'U' is a symbolic operand. */
#define EXTRA_CONSTRAINT(OP, C) \
((C) == 'Q' ? normal_memory_operand (OP, VOIDmode) \
......@@ -800,6 +808,8 @@ enum reg_class { NO_REGS, PV_REG, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
: (C) == 'S' ? (GET_CODE (OP) == CONST_INT \
&& (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \
: (C) == 'T' ? GET_CODE (OP) == HIGH \
: (TARGET_ABI_UNICOSMK && (C) == 'U') \
? symbolic_operand (OP, VOIDmode) \
: 0)
/* Given an rtx X being reloaded into a reg required to be
......@@ -2174,7 +2184,8 @@ do { \
{"hard_int_register_operand", {SUBREG, REG}}, \
{"reg_not_elim_operand", {SUBREG, REG}}, \
{"reg_no_subreg_operand", {REG}}, \
{"addition_operation", {PLUS}},
{"addition_operation", {PLUS}}, \
{"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}},
/* Define the `__builtin_va_list' type for the ABI. */
#define BUILD_VA_LIST_TYPE(VALIST) \
......
# This file is empty for now.
......@@ -5,7 +5,7 @@
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
* This file contains 143 fixup descriptions.
* This file contains 144 fixup descriptions.
*
* See README for more information.
*
......@@ -1954,7 +1954,7 @@ tSCC zHpux10_Cpp_Pow_InlineName[] =
* File name selection pattern
*/
tSCC zHpux10_Cpp_Pow_InlineList[] =
"|math.h|";
"|fixinc-test-limits.h|math.h|";
/*
* Machine/OS name selection pattern
*/
......@@ -5107,6 +5107,43 @@ static const char* apzUndefine_NullPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Unicosmk_Restrict fix
*/
tSCC zUnicosmk_RestrictName[] =
"unicosmk_restrict";
/*
* File name selection pattern
*/
tSCC zUnicosmk_RestrictList[] =
"|stdio.h|stdlib.h|wchar.h|";
/*
* Machine/OS name selection pattern
*/
tSCC* apzUnicosmk_RestrictMachs[] = {
"*-*-unicosmk*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zUnicosmk_RestrictSelect0[] =
"(\\*[ \t]*)restrict([ \t]+)";
#define UNICOSMK_RESTRICT_TEST_CT 1
static tTestDesc aUnicosmk_RestrictTests[] = {
{ TT_EGREP, zUnicosmk_RestrictSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Unicosmk_Restrict
*/
static const char* apzUnicosmk_RestrictPatch[] = {
"format",
"%1__restrict__%2",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Uw7_Byteorder_Fix fix
*/
tSCC zUw7_Byteorder_FixName[] =
......@@ -5577,9 +5614,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
#define REGEX_COUNT 150
#define REGEX_COUNT 151
#define MACH_LIST_SIZE_LIMIT 279
#define FIX_COUNT 143
#define FIX_COUNT 144
/*
* Enumerate the fixes
......@@ -5717,6 +5754,7 @@ typedef enum {
ULTRIX_STATIC_FIXIDX,
ULTRIX_STRINGS_FIXIDX,
UNDEFINE_NULL_FIXIDX,
UNICOSMK_RESTRICT_FIXIDX,
UW7_BYTEORDER_FIX_FIXIDX,
VA_I960_MACRO_FIXIDX,
VOID_NULL_FIXIDX,
......@@ -6391,6 +6429,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
UNDEFINE_NULL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aUndefine_NullTests, apzUndefine_NullPatch, 0 },
{ zUnicosmk_RestrictName, zUnicosmk_RestrictList,
apzUnicosmk_RestrictMachs,
UNICOSMK_RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aUnicosmk_RestrictTests, apzUnicosmk_RestrictPatch, 0 },
{ zUw7_Byteorder_FixName, zUw7_Byteorder_FixList,
apzUw7_Byteorder_FixMachs,
UW7_BYTEORDER_FIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
......
......@@ -3102,6 +3102,23 @@ fix = {
test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
};
/*
* On Cray Unicos/Mk some standard headers use the C99 keyword "restrict"
* which must be replaced by __restrict__ for GCC.
*/
fix = {
hackname = unicosmk_restrict;
files = stdio.h;
files = stdlib.h;
files = wchar.h;
mach = "*-*-unicosmk*";
select = "(\\*[ \t]*)restrict([ \t]+)";
c_fix = format;
c_fix_arg = "%1__restrict__%2";
test_text = "void f (char * restrict x);";
};
/*
* If arpa/inet.h prototypes are incompatible with the ones we just
......
......@@ -165,6 +165,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_size_t)
#ifndef __size_t__ /* BeOS */
#ifndef __SIZE_T__ /* Cray Unicos/Mk */
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
#ifndef _SYS_SIZE_T_H
#ifndef _T_SIZE_
......@@ -179,6 +180,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#ifndef _SIZET_
#ifndef __size_t
#define __size_t__ /* BeOS */
#define __SIZE_T__ /* Cray Unicos/Mk */
#define _SIZE_T
#define _SYS_SIZE_T_H
#define _T_SIZE_
......@@ -214,6 +216,7 @@ typedef long ssize_t;
#endif /* _T_SIZE_ */
#endif /* _SYS_SIZE_T_H */
#endif /* _SIZE_T */
#endif /* __SIZE_T__ */
#endif /* __size_t__ */
#undef __need_size_t
#endif /* _STDDEF_H or __need_size_t. */
......@@ -228,6 +231,7 @@ typedef long ssize_t;
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_wchar_t)
#ifndef __wchar_t__ /* BeOS */
#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
#ifndef _WCHAR_T
#ifndef _T_WCHAR_
#ifndef _T_WCHAR
......@@ -242,6 +246,7 @@ typedef long ssize_t;
#ifndef __INT_WCHAR_T_H
#ifndef _GCC_WCHAR_T
#define __wchar_t__ /* BeOS */
#define __WCHAR_T__ /* Cray Unicos/Mk */
#define _WCHAR_T
#define _T_WCHAR_
#define _T_WCHAR
......@@ -300,6 +305,7 @@ typedef __WCHAR_TYPE__ wchar_t;
#endif
#endif
#endif
#endif /* __WCHAR_T__ */
#endif /* __wchar_t__ */
#undef __need_wchar_t
#endif /* _STDDEF_H or __need_wchar_t. */
......
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