--- gcc/config/vax/vax.h 2018/04/24 18:10:25 1.1 +++ gcc/config/vax/vax.h 2018/04/24 18:35:23 1.1.1.5 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Vax version. - Copyright (C) 1987, 1988, 1991, 1993 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 91, 93, 94, 95 Free Software Foundation, Inc. This file is part of GNU CC. @@ -15,12 +15,13 @@ 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. */ -#define CPP_PREDEFINES "-Dvax -Dunix" +#define CPP_PREDEFINES "-Dvax -D__vax__ -Dunix -Asystem(unix) -Asystem(bsd) -Acpu(vax) -Amachine(vax)" /* If using g-format floating point, alter math.h. */ @@ -352,13 +353,14 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO /* 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. On the Vax, the RET insn always pops all the args for any function. */ -#define RETURN_POPS_ARGS(FUNTYPE,SIZE) (SIZE) +#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE) /* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree). @@ -541,12 +543,28 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO to the start of the trampoline. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ + emit_insn (gen_rtx (ASM_INPUT, VOIDmode, \ + "movpsl -(sp)\n\tpushal 1(pc)\n\trei")); \ emit_move_insn (gen_rtx (MEM, HImode, TRAMP), \ gen_rtx (MEM, HImode, FNADDR)); \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), CXT);\ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 11)), \ plus_constant (FNADDR, 2)); \ } + +/* Byte offset of return address in a stack frame. The "saved PC" field + is in element [4] when treating the frame as an array of longwords. */ + +#define RETURN_ADDRESS_OFFSET (4 * UNITS_PER_WORD) /* 16 */ + +/* A C expression whose value is RTL representing the value of the return + address for the frame COUNT steps up from the current frame. + FRAMEADDR is already the frame pointer of the COUNT frame, so we + can ignore COUNT. */ + +#define RETURN_ADDR_RTX(COUNT, FRAME) \ + gen_rtx (MEM, Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) + /* Addressing modes, and classification of registers for them. */ @@ -675,7 +693,14 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO (This much is the easy part.) */ #define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \ { register rtx xfoob = (X); \ - if (GET_CODE (xfoob) == REG) goto ADDR; \ + if (GET_CODE (xfoob) == REG) \ + { \ + extern rtx *reg_equiv_mem; \ + if (! reload_in_progress \ + || reg_equiv_mem[REGNO (xfoob)] == 0 \ + || INDIRECTABLE_ADDRESS_P (reg_equiv_mem[REGNO (xfoob)])) \ + goto ADDR; \ + } \ if (CONSTANT_ADDRESS_P (xfoob)) goto ADDR; \ if (INDIRECTABLE_ADDRESS_P (xfoob)) goto ADDR; \ xfoob = XEXP (X, 0); \ @@ -875,7 +900,7 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO #define RTX_COSTS(RTX,CODE,OUTER_CODE) case FIX: case FLOAT: \ case MULT: case DIV: case UDIV: case MOD: case UMOD: \ - case LSHIFT: case ASHIFT: case LSHIFTRT: case ASHIFTRT: \ + case ASHIFT: case LSHIFTRT: case ASHIFTRT: \ case ROTATE: case ROTATERT: case PLUS: case MINUS: case IOR: \ case XOR: case AND: case NEG: case NOT: case ZERO_EXTRACT: \ case SIGN_EXTRACT: case MEM: return vax_rtx_cost(RTX) @@ -903,7 +928,8 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO /* note that it is very hard to accidentally create a number that fits in a double but not in a float, since their ranges are almost the same */ -#define CHECK_FLOAT_VALUE(mode, d) (check_float_value (mode, &d)) +#define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \ + ((OVERFLOW) = check_float_value (MODE, &D, OVERFLOW)) /* For future reference: D Float: 9 bit, sign magnitude, excess 128 binary exponent @@ -937,7 +963,8 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO { if (GET_CODE (EXP) == SET) \ { if (GET_CODE (SET_SRC (EXP)) == CALL) \ CC_STATUS_INIT; \ - else if (GET_CODE (SET_DEST (EXP)) != PC) \ + else if (GET_CODE (SET_DEST (EXP)) != ZERO_EXTRACT \ + && GET_CODE (SET_DEST (EXP)) != PC) \ { cc_status.flags = 0; \ cc_status.value1 = SET_DEST (EXP); \ cc_status.value2 = SET_SRC (EXP); } } \ @@ -945,13 +972,15 @@ gen_rtx (PLUS, Pmode, frame, gen_rtx (CO && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \ { \ if (GET_CODE (SET_SRC (XVECEXP (EXP, 0, 0))) == CALL) \ - CC_STATUS_INIT; \ + CC_STATUS_INIT; \ else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) != PC) \ { cc_status.flags = 0; \ cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0)); \ - cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0)); } } \ - /* PARALLELs whose first element sets the PC are aob, sob insns. \ - They do change the cc's. So drop through and forget the cc's. */ \ + cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0)); } \ + else \ + /* PARALLELs whose first element sets the PC are aob, \ + sob insns. They do change the cc's. */ \ + CC_STATUS_INIT; } \ else CC_STATUS_INIT; \ if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \ && cc_status.value2 \ @@ -1163,6 +1192,17 @@ do { char dstr[30]; \ ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) +/* When debugging, we want to output an extra dummy label so that gas + can distinguish between D_float and G_float prior to processing the + .stabs directive identifying type double. */ + +#define ASM_IDENTIFY_LANGUAGE(FILE) \ + do { \ + output_lang_identify (FILE); \ + if (write_symbols == DBX_DEBUG) \ + fprintf (FILE, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR); \ + } while (0) + /* Define the parentheses used to group arithmetic operations in assembler code. */