📄 alpha.h
字号:
/* Definitions of target machine for GNU compiler, for DEC Alpha. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)This file is part of GCC.GCC 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.GCC 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 GCC; see the file COPYING. If not, write tothe Free Software Foundation, 51 Franklin Street, Fifth Floor,Boston, MA 02110-1301, USA. *//* Target CPU builtins. */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ builtin_define ("__alpha"); \ builtin_define ("__alpha__"); \ builtin_assert ("cpu=alpha"); \ builtin_assert ("machine=alpha"); \ if (TARGET_CIX) \ { \ builtin_define ("__alpha_cix__"); \ builtin_assert ("cpu=cix"); \ } \ if (TARGET_FIX) \ { \ builtin_define ("__alpha_fix__"); \ builtin_assert ("cpu=fix"); \ } \ if (TARGET_BWX) \ { \ builtin_define ("__alpha_bwx__"); \ builtin_assert ("cpu=bwx"); \ } \ if (TARGET_MAX) \ { \ builtin_define ("__alpha_max__"); \ builtin_assert ("cpu=max"); \ } \ if (alpha_cpu == PROCESSOR_EV6) \ { \ builtin_define ("__alpha_ev6__"); \ builtin_assert ("cpu=ev6"); \ } \ else if (alpha_cpu == PROCESSOR_EV5) \ { \ builtin_define ("__alpha_ev5__"); \ builtin_assert ("cpu=ev5"); \ } \ else /* Presumably ev4. */ \ { \ builtin_define ("__alpha_ev4__"); \ builtin_assert ("cpu=ev4"); \ } \ if (TARGET_IEEE || TARGET_IEEE_WITH_INEXACT) \ builtin_define ("_IEEE_FP"); \ if (TARGET_IEEE_WITH_INEXACT) \ builtin_define ("_IEEE_FP_INEXACT"); \ if (TARGET_LONG_DOUBLE_128) \ builtin_define ("__LONG_DOUBLE_128__"); \ \ /* Macros dependent on the C dialect. */ \ SUBTARGET_LANGUAGE_CPP_BUILTINS(); \} while (0)#ifndef SUBTARGET_LANGUAGE_CPP_BUILTINS#define SUBTARGET_LANGUAGE_CPP_BUILTINS() \ do \ { \ if (preprocessing_asm_p ()) \ builtin_define_std ("LANGUAGE_ASSEMBLY"); \ else if (c_dialect_cxx ()) \ { \ builtin_define ("__LANGUAGE_C_PLUS_PLUS"); \ builtin_define ("__LANGUAGE_C_PLUS_PLUS__"); \ } \ else \ builtin_define_std ("LANGUAGE_C"); \ if (c_dialect_objc ()) \ { \ builtin_define ("__LANGUAGE_OBJECTIVE_C"); \ builtin_define ("__LANGUAGE_OBJECTIVE_C__"); \ } \ } \ while (0)#endif#define CPP_SPEC "%(cpp_subtarget)"#ifndef CPP_SUBTARGET_SPEC#define CPP_SUBTARGET_SPEC ""#endif#define WORD_SWITCH_TAKES_ARG(STR) \ (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))/* Print subsidiary information on the compiler version in use. */#define TARGET_VERSION/* Run-time compilation parameters selecting different hardware subsets. *//* Which processor to schedule for. The cpu attribute defines a list that mirrors this list, so changes to alpha.md must be made at the same time. */enum processor_type{ PROCESSOR_EV4, /* 2106[46]{a,} */ PROCESSOR_EV5, /* 21164{a,pc,} */ PROCESSOR_EV6, /* 21264 */ PROCESSOR_MAX};extern enum processor_type alpha_cpu;extern enum processor_type alpha_tune;enum alpha_trap_precision{ ALPHA_TP_PROG, /* No precision (default). */ ALPHA_TP_FUNC, /* Trap contained within originating function. */ ALPHA_TP_INSN /* Instruction accuracy and code is resumption safe. */};enum alpha_fp_rounding_mode{ ALPHA_FPRM_NORM, /* Normal rounding mode. */ ALPHA_FPRM_MINF, /* Round towards minus-infinity. */ ALPHA_FPRM_CHOP, /* Chopped rounding mode (towards 0). */ ALPHA_FPRM_DYN /* Dynamic rounding mode. */};enum alpha_fp_trap_mode{ ALPHA_FPTM_N, /* Normal trap mode. */ ALPHA_FPTM_U, /* Underflow traps enabled. */ ALPHA_FPTM_SU, /* Software completion, w/underflow traps */ ALPHA_FPTM_SUI /* Software completion, w/underflow & inexact traps */};extern int target_flags;extern enum alpha_trap_precision alpha_tp;extern enum alpha_fp_rounding_mode alpha_fprm;extern enum alpha_fp_trap_mode alpha_fptm;/* Invert the easy way to make options work. */#define TARGET_FP (!TARGET_SOFT_FP)/* These are for target os support and cannot be changed at runtime. */#define TARGET_ABI_WINDOWS_NT 0#define TARGET_ABI_OPEN_VMS 0#define TARGET_ABI_UNICOSMK 0#define TARGET_ABI_OSF (!TARGET_ABI_WINDOWS_NT \ && !TARGET_ABI_OPEN_VMS \ && !TARGET_ABI_UNICOSMK)#ifndef TARGET_AS_CAN_SUBTRACT_LABELS#define TARGET_AS_CAN_SUBTRACT_LABELS TARGET_GAS#endif#ifndef TARGET_AS_SLASH_BEFORE_SUFFIX#define TARGET_AS_SLASH_BEFORE_SUFFIX TARGET_GAS#endif#ifndef TARGET_CAN_FAULT_IN_PROLOGUE#define TARGET_CAN_FAULT_IN_PROLOGUE 0#endif#ifndef TARGET_HAS_XFLOATING_LIBS#define TARGET_HAS_XFLOATING_LIBS TARGET_LONG_DOUBLE_128#endif#ifndef TARGET_PROFILING_NEEDS_GP#define TARGET_PROFILING_NEEDS_GP 0#endif#ifndef TARGET_LD_BUGGY_LDGP#define TARGET_LD_BUGGY_LDGP 0#endif#ifndef TARGET_FIXUP_EV5_PREFETCH#define TARGET_FIXUP_EV5_PREFETCH 0#endif#ifndef HAVE_AS_TLS#define HAVE_AS_TLS 0#endif#define TARGET_DEFAULT MASK_FPREGS#ifndef TARGET_CPU_DEFAULT#define TARGET_CPU_DEFAULT 0#endif#ifndef TARGET_DEFAULT_EXPLICIT_RELOCS#ifdef HAVE_AS_EXPLICIT_RELOCS#define TARGET_DEFAULT_EXPLICIT_RELOCS MASK_EXPLICIT_RELOCS#define TARGET_SUPPORT_ARCH 1#else#define TARGET_DEFAULT_EXPLICIT_RELOCS 0#endif#endif#ifndef TARGET_SUPPORT_ARCH#define TARGET_SUPPORT_ARCH 0#endif/* Support for a compile-time default CPU, et cetera. The rules are: --with-cpu is ignored if -mcpu is specified. --with-tune is ignored if -mtune is specified. */#define OPTION_DEFAULT_SPECS \ {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }/* This macro defines names of additional specifications to put in the specs that can be used in various specifications like CC1_SPEC. Its definition is an initializer with a subgrouping for each command option. Each subgrouping contains a string constant, that defines the specification name, and a string constant that used by the GCC driver program. Do not define this macro if it does not need to do anything. */#ifndef SUBTARGET_EXTRA_SPECS#define SUBTARGET_EXTRA_SPECS#endif#define EXTRA_SPECS \ { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \ SUBTARGET_EXTRA_SPECS/* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if defined, is executed once just after all the command options have been parsed. On the Alpha, it is used to translate target-option strings into numeric values. */#define OVERRIDE_OPTIONS override_options ()/* 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 \{ \ int i; \ 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 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/* We're IEEE unless someone says to use VAX. */#define TARGET_FLOAT_FORMAT \ (TARGET_FLOAT_VAX ? VAX_FLOAT_FORMAT : IEEE_FLOAT_FORMAT)/* 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 (TARGET_LONG_DOUBLE_128 ? 128 : 64)/* Define this to set long double type size to use in libgcc2.c, which can not depend on target_flags. */#ifdef __LONG_DOUBLE_128__#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128#else#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64#endif/* Work around target_flags dependency in ada/targtyps.c. */#define WIDEST_HARDWARE_FP_SIZE 64#define WCHAR_TYPE "unsigned int"#define WCHAR_TYPE_SIZE 32/* 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 integers are always sign-extended, but smaller objects retain their signedness. Note that small vector types can get mapped onto integer modes at the whim of not appearing in alpha-modes.def. We never promoted these values before; don't do so now that we've trimmed the set of modes to those actually implemented in the backend. */#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ if (GET_MODE_CLASS (MODE) == MODE_INT \ && (TYPE == NULL || TREE_CODE (TYPE) != VECTOR_TYPE) \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ { \ if ((MODE) == SImode) \ (UNSIGNEDP) = 0; \ (MODE) = DImode; \ }/* 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/* 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 128/* Allocation boundary (in *bits*) for the code of a function. */#define FUNCTION_BOUNDARY 32/* 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 bit-field declared as `int' forces `int' alignment for the struct. */#define PCC_BITFIELD_TYPE_MATTERS 1/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 128/* For atomic access to objects, must have at least 32-bit alignment unless the machine has byte operations. */#define MINIMUM_ATOMIC_ALIGNMENT ((unsigned int) (TARGET_BWX ? 8 : 32))/* Align all constants and variables to at least a word boundary so we can pick up pieces of them faster. *//* ??? Only if block-move stuff knows about different source/destination alignment. */#if 0#define CONSTANT_ALIGNMENT(EXP, ALIGN) MAX ((ALIGN), BITS_PER_WORD)#define DATA_ALIGNMENT(EXP, ALIGN) MAX ((ALIGN), BITS_PER_WORD)#endif/* Set this nonzero 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 nonzero if unaligned move instructions are extremely slow. On the Alpha, they trap. */#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1/* Standard register usage. *//* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -