📄 vms.h
字号:
/* Output variables, constants and external declarations, for GNU compiler. Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA. */#define OPEN_VMS 1/* This enables certain macros in alpha.h, which will make an indirect reference to an external symbol an invalid address. This needs to be defined before we include alpha.h, since it determines which macros are used for GO_IF_*. */#define NO_EXTERNAL_INDIRECT_ADDRESS#include "alpha/alpha.h"#undef CPP_PREDEFINES#define CPP_PREDEFINES \"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem(vms)"#undef CPP_SUBTARGET_SPEC#define CPP_SUBTARGET_SPEC "\%{mfloat-ieee:-D__IEEE_FLOAT} \%{mfloat-vax:-D__G_FLOAT} \%{!mfloat-vax:-D__IEEE_FLOAT}"/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */#define LIB_SPEC "%{p:-lprof1 -lpdf} %{pg:-lprof1 -lpdf} %{a:-lprof2} -lc"/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are optimizing, -O1 if we are not. Pass -shared, -non_shared or -call_shared as appropriate. Also pass -pg. */#define LINK_SPEC \ "-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \ %{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \ %{rpath*}"/* We allow $'s in identifiers unless -ansi is used .. */#define DOLLARS_IN_IDENTIFIERS 2/* These match the definitions used in DECCRTL, the VMS C run-time library#define SIZE_TYPE "unsigned int"#define PTRDIFF_TYPE "int"*//* Use memcpy for structure copying, and so forth. */#define TARGET_MEM_FUNCTIONS/* By default, allow $ to be part of an identifier. */#define DOLLARS_IN_IDENTIFIERS 2#undef TARGET_DEFAULT#define TARGET_DEFAULT (MASK_FP|MASK_FPREGS|MASK_GAS)#undef TARGET_OPEN_VMS#define TARGET_OPEN_VMS 1#undef TARGET_NAME #define TARGET_NAME "OpenVMS/Alpha"#undef TARGET_VERSION#define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME); /* The structure return address arrives as an "argument" on VMS. */#undef STRUCT_VALUE_REGNUM#define STRUCT_VALUE 0#undef PCC_STATIC_STRUCT_RETURN/* no floating emulation. */#undef REAL_ARITHMETIC/* "long" is 32 bits. */#undef LONG_TYPE_SIZE#define LONG_TYPE_SIZE 32/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */#undef POINTER_SIZE#define POINTER_SIZE 32#define POINTERS_EXTEND_UNSIGNED 0#define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */#undef FIXED_REGISTERS#define FIXED_REGISTERS \ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }#undef CALL_USED_REGISTERS#define CALL_USED_REGISTERS \ {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }#undef HARD_FRAME_POINTER_REGNUM#define HARD_FRAME_POINTER_REGNUM 29#undef CAN_ELIMINATE#define CAN_ELIMINATE(FROM, TO) \((TO) != STACK_POINTER_REGNUM || ! alpha_using_fp ())#undef INITIAL_ELIMINATION_OFFSET#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \{ if ((FROM) == FRAME_POINTER_REGNUM) \ (OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \ else if ((FROM) == ARG_POINTER_REGNUM) \ (OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \ + get_frame_size () \ + current_function_pretend_args_size) \ - current_function_pretend_args_size); \ if ((TO) == STACK_POINTER_REGNUM) \ (OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \}/* Define a data type for recording info about an argument list during the scan of that argument list. This data type should hold all necessary information about the function itself and about the args processed so far, enough to enable macros such as FUNCTION_ARG to determine where the next arg should go. On Alpha/VMS, this is a structure that contains the number of arguments and, for each argument, the datatype of that argument. The number of arguments is a number of words of arguments scanned so far. Thus 6 or more means all following args should go on the stack. */enum avms_arg_type {I64, FF, FD, FG, FS, FT};typedef struct {char num_args; enum avms_arg_type atypes[6];} avms_arg_info;#undef CUMULATIVE_ARGS#define CUMULATIVE_ARGS avms_arg_info/* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */#undef INIT_CUMULATIVE_ARGS#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ (CUM).num_args = 0; \ (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \ (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;/* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. (TYPE is null for libcalls where that information may not be available.) */extern enum avms_arg_type alpha_arg_type ();/* Determine where to put an argument to a function. Value is zero to push the argument on the stack, or a hard register in which to store the argument. MODE is the argument's machine mode (or VOIDmode for no more args). TYPE is the data type of the argument (as a tree). This is null for libcalls where that information may not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. NAMED is nonzero if this argument is a named parameter (otherwise it is an extra parameter matching an ellipsis). On Alpha the first 6 words of args are normally in registers and the rest are pushed. */extern struct rtx_def *alpha_arg_info_reg_val ();#undef FUNCTION_ARG#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \((MODE) == VOIDmode ? alpha_arg_info_reg_val (CUM) \ : ((CUM.num_args) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \ ? gen_rtx(REG, (MODE), \ ((CUM).num_args + 16 \ + ((TARGET_FPREGS \ && (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_FLOAT)) \ * 32))) \ : 0))#undef FUNCTION_ARG_ADVANCE#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ if (MUST_PASS_IN_STACK (MODE, TYPE)) \ (CUM).num_args += 6; \ else \ { \ if ((CUM).num_args < 6) \ (CUM).atypes[(CUM).num_args] = alpha_arg_type (MODE); \ \ (CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \ }/* For an arg passed partly in registers and partly in memory, this is the number of registers used. For args passed entirely in registers or entirely in memory, zero. */#undef FUNCTION_ARG_PARTIAL_NREGS#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \((CUM).num_args < 6 && 6 < (CUM).num_args \ + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \ ? 6 - (CUM).num_args : 0)/* Perform any needed actions needed for a function that is receiving a variable number of arguments. CUM is as for INIT_CUMULATIVE_ARGS. MODE and TYPE are the mode and type of the current parameter. PRETEND_SIZE is a variable that should be set to the amount of stack that must be pushed by the prolog to pretend that our caller pushed it. Normally, this macro will push all remaining incoming registers on the stack and set PRETEND_SIZE to the length of the registers pushed. For VMS, we allocate space for all 6 arg registers plus a count. However, if NO registers need to be saved, don't allocate any space. This is not only because we won't need the space, but because AP includes the current_pretend_args_size and we don't want to mess up any ap-relative addresses already made. */#undef SETUP_INCOMING_VARARGS#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \{ if ((CUM).num_args < 6) \ { \ if (! (NO_RTL)) \ { \ emit_move_insn (gen_rtx (REG, DImode, 1), \ virtual_incoming_args_rtx); \ emit_insn (gen_arg_home ()); \ } \ \ PRETEND_SIZE = 7 * UNITS_PER_WORD; \ } \}#undef ASM_FILE_START
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -