📄 alpha.h
字号:
/* Definitions of target machine for GNU compiler, for DEC Alpha. Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)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. *//* Names to predefine in the preprocessor for this target machine. */#define CPP_PREDEFINES "\-Dunix -D__osf__ -D__alpha -D__alpha__ -D_LONGLONG -DSYSTYPE_BSD \-D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4) -Acpu(alpha) -Amachine(alpha)"/* Write out the correct language type definition for the header files. Unless we have assembler language, write out the symbols for C. */#define CPP_SPEC "\%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C}"/* Set the spec to use for signed char. The default tests the above macro but DEC's compiler can't handle the conditional in a "constant" operand. */#define SIGNED_CHAR_SPEC "%{funsigned-char:-D__CHAR_UNSIGNED__}"/* Under OSF/1, -p and -pg require -lprof1. */#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} %{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*}"#define WORD_SWITCH_TAKES_ARG(STR) \ (!strcmp (STR, "rpath") || !strcmp (STR, "include") \ || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \ || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ || !strcmp (STR, "isystem"))#define STARTFILE_SPEC \ "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"/* Print subsidiary information on the compiler version in use. */#define TARGET_VERSION/* Default this to not be compiling for Windows/NT. */#ifndef WINDOWS_NT#define WINDOWS_NT 0#endif/* Define the location for the startup file on OSF/1 for Alpha. */#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"/* Run-time compilation parameters selecting different hardware subsets. */extern int target_flags;/* This means that floating-point support exists in the target implementation of the Alpha architecture. This is usually the default. */#define TARGET_FP (target_flags & 1)/* This means that floating-point registers are allowed to be used. Note that Alpha implementations without FP operations are required to provide the FP registers. */#define TARGET_FPREGS (target_flags & 2)/* This means that gas is used to process the assembler file. */#define MASK_GAS 4#define TARGET_GAS (target_flags & MASK_GAS)/* Macro to define tables used to set the flags. This is a list in braces of pairs in braces, each pair being { "NAME", VALUE } where VALUE is the bits to set or minus the bits to clear. An empty string NAME is used to identify the default VALUE. */#define TARGET_SWITCHES \ { {"no-soft-float", 1}, \ {"soft-float", -1}, \ {"fp-regs", 2}, \ {"no-fp-regs", -3}, \ {"alpha-as", -MASK_GAS}, \ {"gas", MASK_GAS}, \ {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT} }#define TARGET_DEFAULT 3#ifndef TARGET_CPU_DEFAULT#define TARGET_CPU_DEFAULT 0#endif/* Define this macro to change register usage conditional on target flags. On the Alpha, we use this to disable the floating-point registers when they don't exist. */#define CONDITIONAL_REGISTER_USAGE \ if (! TARGET_FPREGS) \ for (i = 32; i < 63; i++) \ fixed_regs[i] = call_used_regs[i] = 1;/* Show we can debug even without a frame pointer. */#define CAN_DEBUG_WITHOUT_FP/* target machine storage layout *//* Define to enable software floating point emulation. */#define REAL_ARITHMETIC/* Define the size of `int'. The default is the same as the word size. */#define INT_TYPE_SIZE 32/* Define the size of `long long'. The default is the twice the word size. */#define LONG_LONG_TYPE_SIZE 64/* The two floating-point formats we support are S-floating, which is 4 bytes, and T-floating, which is 8 bytes. `float' is S and `double' and `long double' are T. */#define FLOAT_TYPE_SIZE 32#define DOUBLE_TYPE_SIZE 64#define LONG_DOUBLE_TYPE_SIZE 64#define WCHAR_TYPE "short unsigned int"#define WCHAR_TYPE_SIZE 16/* Define this macro if it is advisable to hold scalars in registers in a wider mode than that declared by the program. In such cases, the value is constrained to be within the bounds of the declared type, but kept valid in the wider mode. The signedness of the extension may differ from that of the type. For Alpha, we always store objects in a full register. 32-bit objects are always sign-extended, but smaller objects retain their signedness. */#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ if (GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ { \ if ((MODE) == SImode) \ (UNSIGNEDP) = 0; \ (MODE) = DImode; \ }/* Define this if function arguments should also be promoted using the above procedure. */#define PROMOTE_FUNCTION_ARGS/* Likewise, if the function return value is promoted. */#define PROMOTE_FUNCTION_RETURN/* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. There are no such instructions on the Alpha, but the documentation is little endian. */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. This is false on the Alpha. */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is lowest numbered. For Alpha we can decide arbitrarily since there are no machine instructions for them. Might as well be consistent with bytes. */#define WORDS_BIG_ENDIAN 0/* number of bits in an addressable storage unit */#define BITS_PER_UNIT 8/* Width in bits of a "word", which is the contents of a machine register. Note that this is not necessarily the width of data type `int'; if using 16-bit ints on a 68000, this would still be 32. But on a machine with 16-bit registers, this would be 16. */#define BITS_PER_WORD 64/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 8/* Width in bits of a pointer. See also the macro `Pmode' defined below. */#define POINTER_SIZE 64/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY 64/* Boundary (in *bits*) on which stack pointer should be aligned. */#define STACK_BOUNDARY 64/* Allocation boundary (in *bits*) for the code of a function. */#define FUNCTION_BOUNDARY 64/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 64/* Every structure's size must be a multiple of this. */#define STRUCTURE_SIZE_BOUNDARY 8/* A bitfield declared as `int' forces `int' alignment for the struct. */#define PCC_BITFIELD_TYPE_MATTERS 1/* Align loop starts for optimal branching. ??? Kludge this and the next macro for the moment by not doing anything if we don't optimize and also if we are writing ECOFF symbols to work around a bug in DEC's assembler. */#define ASM_OUTPUT_LOOP_ALIGN(FILE) \ if (optimize > 0 && write_symbols != SDB_DEBUG) \ ASM_OUTPUT_ALIGN (FILE, 5)/* This is how to align an instruction for optimal branching. On Alpha we'll get better performance by aligning on a quadword boundary. */#define ASM_OUTPUT_ALIGN_CODE(FILE) \ if (optimize > 0 && write_symbols != SDB_DEBUG) \ ASM_OUTPUT_ALIGN ((FILE), 4)/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 64/* Make strings word-aligned so strcpy from constants will be faster. */#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ (TREE_CODE (EXP) == STRING_CST \ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))/* Make arrays of chars word-aligned for the same reasons. */#define DATA_ALIGNMENT(TYPE, ALIGN) \ (TREE_CODE (TYPE) == ARRAY_TYPE \ && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))/* Set this non-zero if move instructions will actually fail to work when given unaligned data. Since we get an error message when we do one, call them invalid. */#define STRICT_ALIGNMENT 1/* Set this non-zero if unaligned move instructions are extremely slow. On the Alpha, they trap. */#define SLOW_UNALIGNED_ACCESS 1/* Standard register usage. *//* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler from 0 to just below FIRST_PSEUDO_REGISTER. All registers that the compiler knows about must be given numbers, even those that are not normally considered general registers. We define all 32 integer registers, even though $31 is always zero, and all 32 floating-point registers, even though $f31 is also always zero. We do not bother defining the FP status register and there are no other registers. Since $31 is always zero, we will use register number 31 as the argument pointer. It will never appear in the generated code because we will always be eliminating it in favor of the stack pointer or hardware frame pointer. Likewise, we use $f31 for the frame pointer, which will always be eliminated in favor of the hardware frame pointer or the stack pointer. */#define FIRST_PSEUDO_REGISTER 64/* 1 for registers that have pervasive standard uses and are not available for the register allocator. */#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, 0, 0, 0, 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 }/* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. The latter must include the registers where values are returned and the register where structure-value addresses are passed. Aside from that, you can include as many other registers as you like. */#define CALL_USED_REGISTERS \ {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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 }/* List the order in which to allocate registers. Each register must be listed once, even those in FIXED_REGISTERS. We allocate in the following order: $f1 (nonsaved floating-point register) $f10-$f15 (likewise) $f22-$f30 (likewise) $f21-$f16 (likewise, but input args) $f0 (nonsaved, but return value) $f2-$f9 (saved floating-point registers) $1-$8 (nonsaved integer registers) $22-$25 (likewise) $28 (likewise) $0 (likewise, but return value) $21-$16 (likewise, but input args) $27 (procedure value in OSF, nonsaved in NT) $9-$14 (saved integer registers) $26 (return PC) $15 (frame pointer) $29 (global pointer) $30, $31, $f31 (stack pointer and always zero/ap & fp) */#define REG_ALLOC_ORDER \ {33, \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -