--- gcc/config/a29k/a29k.h 2018/04/24 18:15:30 1.1.1.2 +++ gcc/config/a29k/a29k.h 2018/04/24 18:29:18 1.1.1.4 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for AMD Am29000 CPU. - Copyright (C) 1988, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1988, 90-94, 1995 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) This file is part of GNU CC. @@ -16,7 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* Names to predefine in the preprocessor for this target machine. */ @@ -85,6 +86,16 @@ extern int target_flags; #define TARGET_NO_REUSE_ARGS (target_flags & 256) +/* This means that neither builtin nor emulated float operations are + available, and that GCC should generate libcalls instead. */ + +#define TARGET_SOFT_FLOAT (target_flags & 512) + +/* This means that we should not emit the multm or mutmu instructions + that some embedded systems' trap handlers don't support. */ + +#define TARGET_MULTM ((target_flags & 1024) == 0) + #define TARGET_SWITCHES \ { {"dw", 1}, \ {"ndw", -1}, \ @@ -103,21 +114,14 @@ extern int target_flags; {"no-storem-bug", 128}, \ {"reuse-arg-regs", -256}, \ {"no-reuse-arg-regs", 256}, \ + {"soft-float", 512}, \ + {"no-multm", 1024}, \ {"", TARGET_DEFAULT}} #define TARGET_DEFAULT 3 -/* Define this to change the optimizations performed by default. */ - -#define OPTIMIZATION_OPTIONS(LEVEL) \ -{ \ - if ((LEVEL) > 0) \ - { \ - flag_force_addr = 1; \ - flag_force_mem = 1; \ - flag_omit_frame_pointer = 1; \ - } \ -} +/* Show we can debug even without a frame pointer. */ +#define CAN_DEBUG_WITHOUT_FP /* target machine storage layout */ @@ -292,7 +296,7 @@ extern int target_flags; #define R_EXO 199 /* Define the number for floating-point accumulator N. */ -#define R_ACC(N) ((N) + 200) +#define R_ACU(N) ((N) + 200) /* Now define the registers used in the calling sequence. */ #define R_TAV R_GR (121) @@ -390,7 +394,7 @@ extern int target_flags; R_LR (117), R_LR (118), R_LR (119), R_LR (120), R_LR (121), \ R_LR (122), R_LR (123), R_LR (124), R_LR (124), R_LR (126), \ R_LR (127), \ - R_ACC (3), R_ACC (2), R_ACC (1), R_ACC (0), \ + R_ACU (3), R_ACU (2), R_ACU (1), R_ACU (0), \ R_GR (112), R_GR (113), R_GR (114), R_GR (115), R_GR (121), \ R_GR (122), R_GR (123), R_GR (124), R_GR (125), R_GR (126), \ R_GR (127), \ @@ -411,7 +415,7 @@ extern int target_flags; but can be less for certain modes in special long registers. */ #define HARD_REGNO_NREGS(REGNO, MODE) \ - ((REGNO) >= R_ACC (0) && (REGNO) <= R_ACC (3)? 1 \ + ((REGNO) >= R_ACU (0) && (REGNO) <= R_ACU (3)? 1 \ : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. @@ -428,12 +432,12 @@ extern int target_flags; (I'd like to use the "?:" syntax to make this more readable, but Sun's compiler doesn't seem to accept it.) */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ -(((REGNO) >= R_ACC (0) && (REGNO) <= R_ACC (3) \ +(((REGNO) >= R_ACU (0) && (REGNO) <= R_ACU (3) \ && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)) \ || ((REGNO) >= R_BP && (REGNO) <= R_CR \ && GET_MODE_CLASS (MODE) == MODE_PARTIAL_INT) \ - || ((REGNO) >= R_Q && (REGNO) < R_ACC (0) \ + || ((REGNO) >= R_Q && (REGNO) < R_ACU (0) \ && GET_MODE_CLASS (MODE) != MODE_FLOAT \ && GET_MODE_CLASS (MODE) != MODE_COMPLEX_FLOAT) \ || (((REGNO) < R_BP || (REGNO) >= R_KR (0)) \ @@ -534,7 +538,7 @@ enum reg_class { NO_REGS, LR0_REGS, GENE #define REG_CLASS_CONTENTS \ { {0, 0, 0, 0, 0, 0, 0, 0}, \ {0, 1, 0, 0, 0, 0, 0, 0}, \ - {~0, ~0, ~0, ~0, ~0, ~ 0xfffe0000, ~ 0xfff, 0xfffff}, \ + {~0, ~0, ~0, ~0, ~0, ~ 0xfffe0000, ~ 0xfff, 0xfff}, \ {0, 0, 0, 0, 0, 0x20000, 0, 0}, \ {0, 0, 0, 0, 0, 0x40000, 0, 0}, \ {0, 0, 0, 0, 0, 0x80000, 0, 0}, \ @@ -542,8 +546,8 @@ enum reg_class { NO_REGS, LR0_REGS, GENE {0, 0, 0, 0, 0, 0xfffe0000, 0xff, 0}, \ {0, 0, 0, 0, 0, 0, 0x100, 0}, \ {0, 0, 0, 0, 0, 0, 0xf00, 0}, \ - {~0, ~0, ~0, ~0, ~0, ~ 0xfffe0000, ~ 0xff, ~0}, \ - {~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0} } + {~0, ~0, ~0, ~0, ~0, ~ 0xfffe0000, ~ 0xff, 0xfff}, \ + {~0, ~0, ~0, ~0, ~0, ~0, ~0, 0xfff} } /* The same information, inverted: Return the class number of the smallest class containing @@ -556,9 +560,9 @@ enum reg_class { NO_REGS, LR0_REGS, GENE : (REGNO) == R_CR ? CR_REGS \ : (REGNO) == R_Q ? Q_REGS \ : (REGNO) > R_BP && (REGNO) <= R_EXO ? SPECIAL_REGS \ - : (REGNO) == R_ACC (0) ? ACCUM0_REGS \ + : (REGNO) == R_ACU (0) ? ACCUM0_REGS \ : (REGNO) >= R_KR (0) ? GENERAL_REGS \ - : (REGNO) > R_ACC (0) ? ACCUM_REGS \ + : (REGNO) > R_ACU (0) ? ACCUM_REGS \ : (REGNO) == R_LR (0) ? LR0_REGS \ : GENERAL_REGS) @@ -670,6 +674,15 @@ extern struct rtx_def *a29k_get_reloaded #define REGISTER_MOVE_COST(CLASS1, CLASS2) \ ((CLASS1) == GENERAL_REGS || (CLASS2) == GENERAL_REGS ? 2 : 4) +/* A C expressions returning the cost of moving data of MODE from a register to + or from memory. + + It takes extra insns on the 29k to form addresses, so we want to make + this higher. In addition, we need to keep it more expensive than the + most expensive register-register copy. */ + +#define MEMORY_MOVE_COST(MODE) 6 + /* A C statement (sans semicolon) to update the integer variable COST based on the relationship between INSN that is dependent on DEP_INSN through the dependence LINK. The default is to make no @@ -718,11 +731,12 @@ extern struct rtx_def *a29k_get_reloaded /* Value is the number of bytes of arguments automatically popped when returning from a subroutine call. + FUNDECL is the declaration node of the function (as a tree), FUNTYPE is the data type of the function (as a tree), or for a library call it is an identifier node for the subroutine name. SIZE is the number of bytes of arguments passed on the stack. */ -#define RETURN_POPS_ARGS(FUNTYPE,SIZE) 0 +#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 /* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree). @@ -771,19 +785,21 @@ extern struct rtx_def *a29k_get_reloaded /* Same, but called for incoming args. On the 29k, we use this to set all argument registers to fixed and - set the last 16 local regs (lr112-lr127) to available. Some - will later be changed to call-saved by FUNCTION_INCOMING_ARG. */ + set the last 16 local regs, less two, (lr110-lr125) to available. Some + will later be changed to call-saved by FUNCTION_INCOMING_ARG. + lr126,lr127 are always fixed, they are place holders for the caller's + lr0,lr1. */ -#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \ +#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \ { int i; \ - for (i = R_AR (0); i < R_AR (16); i++) \ + for (i = R_AR (0) - 2; i < R_AR (16); i++) \ { \ fixed_regs[i] = call_used_regs[i] = call_fixed_regs[i] = 1; \ SET_HARD_REG_BIT (fixed_reg_set, i); \ SET_HARD_REG_BIT (call_used_reg_set, i); \ SET_HARD_REG_BIT (call_fixed_reg_set, i); \ } \ - for (i = R_LR (112); i < R_LR (128); i++) \ + for (i = R_LR (110); i < R_LR (126); i++) \ { \ fixed_regs[i] = call_used_regs[i] = call_fixed_regs[i] = 0; \ CLEAR_HARD_REG_BIT (fixed_reg_set, i); \ @@ -1076,10 +1092,10 @@ extern char *a29k_function_name; /* Maximum number of registers that can appear in a valid memory address. */ #define MAX_REGS_PER_ADDRESS 1 -/* Recognize any constant value that is a valid address. +/* Recognize any constant value that is a valid address. */ - None are on the 29K. */ -#define CONSTANT_ADDRESS_P(X) 0 +#define CONSTANT_ADDRESS_P(X) \ +(GET_CODE (X) == CONST_INT && (unsigned) INTVAL (X) < 0x100) /* Include all constant integers and constant doubles */ #define LEGITIMATE_CONSTANT_P(X) 1 @@ -1427,6 +1443,12 @@ literal_section () \ extern int a29k_debug_reg_map[]; #define DBX_REGISTER_NUMBER(REGNO) a29k_debug_reg_map[REGNO] +/* This how to write an assembler directive to FILE to switch to + section NAME for DECL. */ + +#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ + fprintf (FILE, "\t.sect %s, bss\n\t.use %s\n", NAME, NAME) + /* This is how to output the definition of a user-level label named NAME, such as the label on a static function or variable NAME. */ @@ -1624,6 +1646,7 @@ extern int a29k_debug_reg_map[]; {"spec_reg_operand", {REG}}, \ {"accum_reg_operand", {REG}}, \ {"srcb_operand", {SUBREG, REG, CONST_INT}}, \ + {"cmplsrcb_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_immediate_operand", {SUBREG, REG, CONST_INT, CONST, \ CONST_DOUBLE, CONST, SYMBOL_REF, LABEL_REF}}, \ {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \