--- gcc/config/mips.h 2018/04/24 17:51:32 1.1.1.1 +++ gcc/config/mips.h 2018/04/24 18:04:04 1.1.1.4 @@ -28,12 +28,17 @@ the Free Software Foundation, 675 Mass A /* Standard GCC variables that we reference. */ -extern int target_flags; -extern int optimize; -extern int may_call_alloca; -extern int current_function_calls_alloca; -extern int frame_pointer_needed; -extern int flag_omit_frame_pointer; +extern char *asm_file_name; +extern char call_used_regs[]; +extern int current_function_calls_alloca; +extern int flag_omit_frame_pointer; +extern int frame_pointer_needed; +extern char *language_string; +extern int may_call_alloca; +extern int optimize; +extern char **save_argv; +extern int target_flags; +extern char *version_string; /* MIPS external variables defined in mips.c. */ @@ -49,12 +54,14 @@ enum cmp_type { enum delay_type { DELAY_NONE, /* no delay slot */ DELAY_LOAD, /* load from memory delay */ - DELAY_HILO /* move from/to hi/lo registers */ + DELAY_HILO, /* move from/to hi/lo registers */ + DELAY_FCMP /* delay after doing c..{d,s} */ }; /* Which processor to schedule for. Since there is no difference between a R2000 and R3000 in terms of the scheduler, we collapse them into - just an R3000. */ + just an R3000. The elements of the enumeration must match exactly + the cpu attribute in the mips.md machine description. */ enum processor_type { PROCESSOR_DEFAULT, @@ -63,6 +70,18 @@ enum processor_type { PROCESSOR_R4000 }; +/* Recast the cpu class to be the cpu attribute. */ +#define mips_cpu_attr ((enum attr_cpu)mips_cpu) + +/* Which type of block move to do (whether or not the last store is + split out so it can fill a branch delay slot). */ + +enum block_move_type { + BLOCK_MOVE_NORMAL, /* generate complete block move */ + BLOCK_MOVE_NOT_LAST, /* generate all but last store */ + BLOCK_MOVE_LAST /* generate just the last store */ +}; + extern char mips_reg_names[][8]; /* register names (a0 vs. $4). */ extern char mips_print_operand_punct[]; /* print_operand punctuation chars */ extern char *current_function_name; /* current function being compiled */ @@ -105,19 +124,22 @@ extern struct rtx_def *mips_load_reg4; / extern void abort_with_insn (); extern int arith32_operand (); extern int arith_operand (); -extern int call_memory_operand (); extern int cmp_op (); extern int cmp2_op (); -extern unsigned long compute_frame_size (); +extern long compute_frame_size (); +extern int epilogue_reg_mentioned_p (); extern void expand_block_move (); extern int equality_op (); extern int fcmp_op (); +extern void final_prescan_insn (); +extern int fpsw_register_operand (); extern struct rtx_def * function_arg (); extern void function_arg_advance (); extern int function_arg_partial_nregs (); extern void function_epilogue (); extern void function_prologue (); extern void gen_conditional_branch (); +extern struct rtx_def * gen_int_relational (); extern void init_cumulative_args (); extern int large_int (); extern int md_register_operand (); @@ -127,38 +149,81 @@ extern void mips_asm_file_start (); extern int mips_const_double_ok (); extern void mips_count_memory_refs (); extern int mips_debugger_offset (); +extern void mips_declare_object (); extern int mips_epilogue_delay_slots (); +extern void mips_expand_epilogue (); +extern void mips_expand_prologue (); extern char *mips_fill_delay_slot (); extern char *mips_move_1word (); extern char *mips_move_2words (); +extern void mips_output_double (); extern int mips_output_external (); +extern void mips_output_float (); extern void mips_output_filename (); extern void mips_output_lineno (); +extern char *output_block_move (); extern void override_options (); +extern int pc_or_label_operand (); extern void print_operand_address (); extern void print_operand (); extern void print_options (); extern int reg_or_0_operand (); +extern int simple_epilogue_p (); extern int simple_memory_operand (); extern int small_int (); extern void trace(); extern int uns_arith_operand (); extern int uns_cmp_op (); -/* Functions in varasm.c that we reference. */ +/* Recognition functions that return if a condition is true. */ +extern int address_operand (); +extern int const_double_operand (); +extern int const_int_operand (); +extern int general_operand (); +extern int immediate_operand (); +extern int memory_address_p (); +extern int memory_operand (); +extern int nonimmediate_operand (); +extern int nonmemory_operand (); +extern int register_operand (); +extern int scratch_operand (); + +/* Functions to change what output section we are using. */ extern void data_section (); extern void rdata_section (); extern void readonly_data_section (); extern void sdata_section (); extern void text_section (); +/* Functions in the rest of the compiler that we reference. */ +extern void abort_with_insn (); +extern void debug_rtx (); +extern void fatal_io_error (); +extern int get_frame_size (); +extern int offsettable_address_p (); +extern void output_address (); +extern char *permalloc (); +extern int reg_mentioned_p (); + +/* Functions in the standard library that we reference. */ +extern void abort (); +extern int atoi (); +extern char *getenv (); +extern char *mktemp (); + + /* Stubs for half-pic support if not OSF/1 reference platform. */ #ifndef HALF_PIC_P #define HALF_PIC_P() 0 +#define HALF_PIC_NUMBER_PTRS 0 +#define HALF_PIC_NUMBER_REFS 0 #define HALF_PIC_ENCODE(DECL) +#define HALF_PIC_DECLARE(NAME) #define HALF_PIC_INIT() error ("half-pic init called on systems that don't support it.") #define HALF_PIC_ADDRESS_P(X) 0 +#define HALF_PIC_PTR(X) X +#define HALF_PIC_FINISH(STREAM) #endif @@ -234,6 +299,9 @@ while (0) #define OPTIMIZATION_OPTIONS(LEVEL) \ { \ + flag_no_function_cse = TRUE; \ + flag_gnu_linker = FALSE; \ + \ if (LEVEL) \ { \ flag_omit_frame_pointer = TRUE; \ @@ -249,7 +317,6 @@ while (0) flag_expensive_optimizations = TRUE; \ flag_rerun_cse_after_loop = TRUE; \ flag_schedule_insns = TRUE; \ - flag_caller_saves = TRUE; \ } \ \ if (LEVEL >= 3) \ @@ -269,6 +336,7 @@ while (0) || defined(SGI_TARGET) \ || defined(MIPS_NEWS) \ || defined(MIPS_SYSV) \ + || defined(MIPS_SVR4) \ || defined(MIPS_BSD43) #ifndef CPP_PREDEFINES @@ -296,11 +364,17 @@ while (0) #endif #endif +/* Tell collect what flags to pass to nm. */ +#ifndef NM_FLAGS +#define NM_FLAGS "-Bp" +#endif + /* Names to predefine in the preprocessor for this target machine. */ #ifndef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000" +#define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43 \ +-D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_BSD43" #endif /* Extra switches sometimes passed to the assembler. */ @@ -308,10 +382,11 @@ while (0) #ifndef ASM_SPEC #define ASM_SPEC "\ %{!mgas: \ - %{!mrnames: -nocpp} \ + %{!mrnames: %{!.s:-nocpp} %{.s: %{cpp} %{nocpp}}} \ %{pipe: %e-pipe is not supported.} \ %{EB} %{!EB:-EB} \ %{EL: %e-EL not supported} \ + %{mips1} %{mips2} %{mips3} \ %{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3} \ %{g} %{g0} %{g1} %{g2} %{g3} %{v} %{K}} \ %{G*}" @@ -321,17 +396,31 @@ while (0) /* Specify to run a post-processor, mips-tfile after the assembler has run to stuff the mips debug information into the object file. This is needed because the $#!%^ MIPS assembler provides no way - of specifing such information in the assembly file. */ + of specifying such information in the assembly file. If we are + cross compiling, disable mips-tfile unless the user specifies + -mmips-tfile. */ #ifndef ASM_FINAL_SPEC +#ifndef CROSS_COMPILE #define ASM_FINAL_SPEC "\ %{!mgas: %{!mno-mips-tfile: \ \n mips-tfile %{v*: -v} \ %{K: -I %b.o~} \ %{!K: %{save-temps: -I %b.o~}} \ - %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %b.o} \ + %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \ %{.s:%i} %{!.s:%g.s}}}" -#endif + +#else /* CROSS_COMPILE */ +#define ASM_FINAL_SPEC "\ +%{!mgas: %{mmips-tfile: \ + \n mips-tfile %{v*: -v} \ + %{K: -I %b.o~} \ + %{!K: %{save-temps: -I %b.o~}} \ + %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \ + %{.s:%i} %{!.s:%g.s}}}" + +#endif /* CROSS_COMPILE */ +#endif /* ASM_FINAL_SPEC */ /* Redefinition of libraries used. Mips doesn't support normal UNIX style profiling via calling _mcount. It does offer @@ -350,7 +439,8 @@ while (0) %{pipe: %e-pipe is not supported.} \ %{EB} %{!EB:-EB} \ %{EL: %e-EL not supported} \ - %{bestGnum}}" + %{mips1} %{mips2} %{mips3} \ + %{bestGnum} %{shared} %{non_shared}}" #endif /* LINK_SPEC defined */ /* Specs for the compiler proper */ @@ -367,15 +457,10 @@ while (0) %{save-temps: }" #endif -#ifndef CC1PLUS_SPEC -#define CC1PLUS_SPEC "%{!fgnu-binutils: -fno-gnu-binutils}" -#endif - /* Preprocessor specs */ #ifndef CPP_SPEC #define CPP_SPEC "\ -%{!ansi:-DSYSTYPE_BSD} -D__SYSTYPE_BSD__ \ %{.cc: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ %{.cxx: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ %{.C: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ @@ -388,13 +473,17 @@ while (0) `STANDARD_EXEC_PREFIX'. */ #ifndef MD_EXEC_PREFIX -#define MD_EXEC_PREFIX "/usr/lib/cmplrs/cc" +#define MD_EXEC_PREFIX "/usr/lib/cmplrs/cc/" +#endif + +#ifndef MD_STARTFILE_PREFIX +#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/" #endif /* Print subsidiary information on the compiler version in use. */ -#define MIPS_VERSION "[AL 1.1, MM 12]" +#define MIPS_VERSION "[AL 1.1, MM 33]" #ifndef MACHINE_TYPE #define MACHINE_TYPE "BSD Mips" @@ -415,9 +504,12 @@ while (0) #define MIPS_DEBUGGING_INFO /* MIPS specific debugging info */ #ifndef PREFERRED_DEBUGGING_TYPE /* assume SDB_DEBUGGING_INFO */ -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG +#define PREFERRED_DEBUGGING_TYPE ((len > 1 && !strncmp (str, "ggdb", len)) ? DBX_DEBUG : SDB_DEBUG) #endif +/* By default, turn on GDB extensions. */ +#define DEFAULT_GDB_EXTENSIONS 1 + /* If we are passing smuggling stabs through the MIPS ECOFF object format, put a comment in front of the .stab operation so that the MIPS assembler does not choke. The mips-tfile program @@ -569,8 +661,12 @@ do { \ #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \ sprintf ((BUFFER), ".%dfake", (NUMBER)); -/* Correct the offset of automatic variables and arguments - if the frame pointer has been eliminated. */ +/* Correct the offset of automatic variables and arguments. Note that + the MIPS debug format wants all automatic variables and arguments + to be in terms of the virtual frame pointer (stack pointer before + any adjustment in the function), while the MIPS 3.0 linker wants + the frame pointer to be the stack pointer after the initial + adjustment. */ #define DEBUGGER_AUTO_OFFSET(X) mips_debugger_offset (X, 0) #define DEBUGGER_ARG_OFFSET(OFFSET, X) mips_debugger_offset (X, OFFSET) @@ -582,6 +678,13 @@ do { \ #define EXTENDED_COFF /* ECOFF, not normal coff */ #endif +/* Don't use the default definitions, because we don't have gld. + Also, we don't want stabs when generating ECOFF output. + Instead we depend on collect to handle these. */ + +#define ASM_OUTPUT_CONSTRUCTOR(file, name) +#define ASM_OUTPUT_DESTRUCTOR(file, name) + /* Run-time compilation parameters selecting different hardware subsets. */ @@ -615,14 +718,14 @@ do { \ /* switches not used yet */ #define MASK_WC8 0x00000000 /* wchar's are 8 bits, not 32 */ #define MASK_WC16 0x00000000 /* wchar's are 16 bits, not 32 */ -#define MASK_WC32 0x00000000 /* dummy for consistancy */ +#define MASK_WC32 0x00000000 /* dummy for consistency */ /* Debug switches, not documented */ #define MASK_DEBUG 0x40000000 /* Eliminate version # in .s file */ #define MASK_DEBUG_A 0x20000000 /* don't allow