📄 unicosmk.h
字号:
/* Definitions of target machine for GNU compiler, for DEC Alpha on Cray T3E running Unicos/Mk. Copyright (C) 2001, 2002 Free Software Foundation, Inc. Contributed by Roman Lechtchinsky (rl@cs.tu-berlin.de)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. */#undef TARGET_ABI_UNICOSMK#define TARGET_ABI_UNICOSMK 1/* CAM requires a slash before floating-pointing instruction suffixes. */#undef TARGET_AS_SLASH_BEFORE_SUFFIX#define TARGET_AS_SLASH_BEFORE_SUFFIX 1/* The following defines are necessary for the standard headers to work correctly. */#define TARGET_OS_CPP_BUILTINS() \ do { \ builtin_define ("__unix"); \ builtin_define ("_UNICOS=205"); \ builtin_define ("_CRAY"); \ builtin_define ("_CRAYT3E"); \ builtin_define ("_CRAYMPP"); \ builtin_define ("_CRAYIEEE"); \ builtin_define ("_ADDR64"); \ builtin_define ("_LD64"); \ builtin_define ("__UNICOSMK__"); \ } while (0)#define SHORT_TYPE_SIZE 32#undef INT_TYPE_SIZE#define INT_TYPE_SIZE 64/* This is consistent with the definition Cray CC uses. */#undef WCHAR_TYPE#define WCHAR_TYPE "int"#undef WCHAR_TYPE_SIZE#define WCHAR_TYPE_SIZE 64/*#define SIZE_TYPE "unsigned int"#define PTRDIFF_TYPE "int"*//* Alphas are operated in big endian mode on the Cray T3E. */#undef BITS_BIG_ENDIAN#undef BYTES_BIG_ENDIAN#undef WORDS_BIG_ENDIAN#define BITS_BIG_ENDIAN 0#define BYTES_BIG_ENDIAN 1#define WORDS_BIG_ENDIAN 1/* Every structure's size must be a multiple of this. */#undef STRUCTURE_SIZE_BOUNDARY#define STRUCTURE_SIZE_BOUNDARY 64/* No data type wants to be aligned rounder than this. */#undef BIGGEST_ALIGNMENT#define BIGGEST_ALIGNMENT 256/* Include the frame pointer in fixed_regs and call_used_regs as it can't be used as a general-purpose register even in frameless functions. ??? The global_regs hack is needed for now because -O2 sometimes tries to eliminate $15 increments/decrements in frameless functions. */#undef CONDITIONAL_REGISTER_USAGE#define CONDITIONAL_REGISTER_USAGE \ do { \ fixed_regs[15] = 1; \ call_used_regs[15] = 1; \ global_regs[15] = 1; \ } while(0)/* The stack frame grows downward. */#define FRAME_GROWS_DOWNWARD/* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. This is somewhat complicated on the T3E which is why we use a function. */extern int unicosmk_initial_elimination_offset PARAMS ((int, int));#undef INITIAL_ELIMINATION_OFFSET#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ do { \ (OFFSET) = unicosmk_initial_elimination_offset ((FROM), (TO)); \ } while (0)/* Define this if stack space is still allocated for a parameter passed in a register. On the T3E, stack space is preallocated for all outgoing arguments, including those passed in registers. To avoid problems, we assume that at least 48 bytes (i.e. enough space for all arguments passed in registers) are allocated. */#define REG_PARM_STACK_SPACE(DECL) 48#define OUTGOING_REG_PARM_STACK_SPACE/* If an argument can't be passed in registers even though not all argument registers have been used yet, it is passed on the stack in the space preallocated for these registers. */#define STACK_PARMS_IN_REG_PARM_AREA/* This evaluates to nonzero if we do not know how to pass TYPE solely in registers. This is the case for all arguments that do not fit in two registers. */#define MUST_PASS_IN_STACK(MODE,TYPE) \ ((TYPE) != 0 \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ || (TREE_ADDRESSABLE (TYPE) || ALPHA_ARG_SIZE (MODE, TYPE, 0) > 2)))/* 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 Unicos/Mk, this is a structure that contains various information for the static subroutine information block (SSIB) and the call information word (CIW). */typedef struct { /* The overall number of arguments. */ int num_args; /* The overall size of the arguments in words. */ int num_arg_words; /* The number of words passed in registers. */ int num_reg_words; /* If an argument must be passed in the stack, all subsequent arguments must be passed there, too. This flag indicates whether this is the case. */ int force_stack; /* This array indicates whether a word is passed in an integer register or a floating point one. */ /* For each of the 6 register arguments, the corresponding flag in this array indicates whether the argument is passed in an integer or a floating point register. */ int reg_args_type[6];} unicosmk_arg_info;#undef CUMULATIVE_ARGS#define CUMULATIVE_ARGS unicosmk_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) \ do { (CUM).num_args = 0; \ (CUM).num_arg_words = 0; \ (CUM).num_reg_words = 0; \ (CUM).force_stack = 0; \ } while(0)/* 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.) On Unicos/Mk, at most 6 words can be passed in registers. Structures which fit in two words are passed in registers, larger structures are passed on stack. */#undef FUNCTION_ARG_ADVANCE#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \do { \ int size; \ \ size = ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \ \ if (size > 2 || MUST_PASS_IN_STACK (MODE, TYPE) \ || (CUM).num_reg_words + size > 6) \ (CUM).force_stack = 1; \ \ if (! (CUM).force_stack) \ { \ int i; \ int isfloat; \ isfloat = (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_FLOAT); \ for (i = 0; i < size; i++) \ { \ (CUM).reg_args_type[(CUM).num_reg_words] = isfloat; \ ++(CUM).num_reg_words; \ } \ } \ (CUM).num_arg_words += size; \ ++(CUM).num_args; \} while(0)/* We want the default definition for this. ??? In fact, we should delete the definition from alpha.h as it corresponds to the default definition for little-endian machines. */#undef FUNCTION_ARG_PADDING/* An argument is passed either entirely in registers or entirely on stack. */ #undef FUNCTION_ARG_PARTIAL_NREGS/* #define FUNCTION_ARG_PARTIAL_NREGS(CUM,MODE,TYPE,NAMED) 0 *//* Perform any needed actions needed for a function that is receiving a variable number of arguments. On Unicos/Mk, the standard subroutine __T3E_MISMATCH stores all register arguments on the stack. Unfortunately, it doesn't always store the first one (i.e. the one that arrives in $16 or $f16). This is not a problem with stdargs as we always have at least one named argument there. */#undef SETUP_INCOMING_VARARGS#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \{ if ((CUM).num_reg_words < 6) \ { \ if (! (NO_RTL)) \ { \ int start = (CUM).num_reg_words + 1; \ \ emit_insn (gen_umk_mismatch_args (GEN_INT (start))); \ emit_insn (gen_arg_home_umk ()); \ } \ \ PRETEND_SIZE = 0; \ } \}/* This ensures that $15 increments/decrements in leaf functions won't get eliminated. */#undef EPILOGUE_USES#define EPILOGUE_USES(REGNO) ((REGNO) == 26 || (REGNO) == 15)/* Would have worked, only the stack doesn't seem to be executable#undef TRAMPOLINE_TEMPLATE#define TRAMPOLINE_TEMPLATE(FILE) \do { fprintf (FILE, "\tbr $1,0\n"); \ fprintf (FILE, "\tldq $0,12($1)\n"); \ fprintf (FILE, "\tldq $1,20($1)\n"); \ fprintf (FILE, "\tjmp $31,(r0)\n"); \ fprintf (FILE, "\tbis $31,$31,$31\n"); \ fprintf (FILE, "\tbis $31,$31,$31\n"); \} while (0) *//* We don't support nested functions (yet). */#undef TRAMPOLINE_TEMPLATE#define TRAMPOLINE_TEMPLATE(FILE) abort ()/* Specify the machine mode that this machine uses for the index in the tablejump instruction. On Unicos/Mk, we don't support relative case vectors yet, thus the entries should be absolute addresses. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -