📄 arm.h
字号:
/* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) Minor hacks by Nick Clifton (nickc@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the 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 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */#ifndef GCC_ARM_H#define GCC_ARM_H/* The architecture define. */extern char arm_arch_name[];/* Target CPU builtins. */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ /* Define __arm__ even when in thumb mode, for \ consistency with armcc. */ \ builtin_define ("__arm__"); \ builtin_define ("__APCS_32__"); \ if (TARGET_THUMB) \ builtin_define ("__thumb__"); \ \ if (TARGET_BIG_END) \ { \ builtin_define ("__ARMEB__"); \ if (TARGET_THUMB) \ builtin_define ("__THUMBEB__"); \ if (TARGET_LITTLE_WORDS) \ builtin_define ("__ARMWEL__"); \ } \ else \ { \ builtin_define ("__ARMEL__"); \ if (TARGET_THUMB) \ builtin_define ("__THUMBEL__"); \ } \ \ if (TARGET_SOFT_FLOAT) \ builtin_define ("__SOFTFP__"); \ \ if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ /* Add a define for interworking. \ Needed when building libgcc.a. */ \ if (arm_cpp_interwork) \ builtin_define ("__THUMB_INTERWORK__"); \ \ builtin_assert ("cpu=arm"); \ builtin_assert ("machine=arm"); \ \ builtin_define (arm_arch_name); \ if (arm_arch_cirrus) \ builtin_define ("__MAVERICK__"); \ if (arm_arch_xscale) \ builtin_define ("__XSCALE__"); \ if (arm_arch_iwmmxt) \ builtin_define ("__IWMMXT__"); \ if (TARGET_AAPCS_BASED) \ builtin_define ("__ARM_EABI__"); \ } while (0)/* The various ARM cores. */enum processor_type{#define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ IDENT,#include "arm-cores.def"#undef ARM_CORE /* Used to indicate that no processor has been specified. */ arm_none};enum target_cpus{#define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ TARGET_CPU_##IDENT,#include "arm-cores.def"#undef ARM_CORE TARGET_CPU_generic};/* The processor for which instructions should be scheduled. */extern enum processor_type arm_tune;typedef enum arm_cond_code{ ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC, ARM_HI, ARM_LS, ARM_GE, ARM_LT, ARM_GT, ARM_LE, ARM_AL, ARM_NV}arm_cc;extern arm_cc arm_current_cc;#define ARM_INVERSE_CONDITION_CODE(X) ((arm_cc) (((int)X) ^ 1))extern int arm_target_label;extern int arm_ccfsm_state;extern GTY(()) rtx arm_target_insn;/* Define the information needed to generate branch insns. This is stored from the compare operation. */extern GTY(()) rtx arm_compare_op0;extern GTY(()) rtx arm_compare_op1;/* The label of the current constant pool. */extern rtx pool_vector_label;/* Set to 1 when a return insn is output, this means that the epilogue is not needed. */extern int return_used_this_function;/* Used to produce AOF syntax assembler. */extern GTY(()) rtx aof_pic_label;/* Just in case configure has failed to define anything. */#ifndef TARGET_CPU_DEFAULT#define TARGET_CPU_DEFAULT TARGET_CPU_generic#endif#undef CPP_SPEC#define CPP_SPEC "%(subtarget_cpp_spec) \%{msoft-float:%{mhard-float: \ %e-msoft-float and -mhard_float may not be used together}} \%{mbig-endian:%{mlittle-endian: \ %e-mbig-endian and -mlittle-endian may not be used together}}"#ifndef CC1_SPEC#define CC1_SPEC ""#endif/* 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. */#define EXTRA_SPECS \ { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ SUBTARGET_EXTRA_SPECS#ifndef SUBTARGET_EXTRA_SPECS#define SUBTARGET_EXTRA_SPECS#endif#ifndef SUBTARGET_CPP_SPEC#define SUBTARGET_CPP_SPEC ""#endif/* Run-time Target Specification. */#ifndef TARGET_VERSION#define TARGET_VERSION fputs (" (ARM/generic)", stderr);#endif#define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT)/* Use hardware floating point instructions. */#define TARGET_HARD_FLOAT (arm_float_abi != ARM_FLOAT_ABI_SOFT)/* Use hardware floating point calling convention. */#define TARGET_HARD_FLOAT_ABI (arm_float_abi == ARM_FLOAT_ABI_HARD)#define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA)#define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK)#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP)#define TARGET_IWMMXT (arm_arch_iwmmxt)#define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM)#define TARGET_IWMMXT_ABI (TARGET_ARM && arm_abi == ARM_ABI_IWMMXT)#define TARGET_ARM (! TARGET_THUMB)#define TARGET_EITHER 1 /* (TARGET_ARM | TARGET_THUMB) */#define TARGET_BACKTRACE (leaf_function_p () \ ? TARGET_TPCS_LEAF_FRAME \ : TARGET_TPCS_FRAME)#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN)#define TARGET_AAPCS_BASED \ (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS)#define TARGET_HARD_TP (target_thread_pointer == TP_CP15)#define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT)/* True iff the full BPABI is being used. If TARGET_BPABI is true, then TARGET_AAPCS_BASED must be true -- but the converse does not hold. TARGET_BPABI implies the use of the BPABI runtime library, etc., in addition to just the AAPCS calling conventions. */#ifndef TARGET_BPABI#define TARGET_BPABI false#endif/* Support for a compile-time default CPU, et cetera. The rules are: --with-arch is ignored if -march or -mcpu are specified. --with-cpu is ignored if -march or -mcpu are specified, and is overridden by --with-arch. --with-tune is ignored if -mtune or -mcpu are specified (but not affected by -march). --with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are specified. --with-fpu is ignored if -mfpu is specified. --with-abi is ignored is -mabi is specified. */#define OPTION_DEFAULT_SPECS \ {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \ {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \ {"float", \ "%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \ {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \ {"abi", "%{!mabi=*:-mabi=%(VALUE)}"},/* Which floating point model to use. */enum arm_fp_model{ ARM_FP_MODEL_UNKNOWN, /* FPA model (Hardware or software). */ ARM_FP_MODEL_FPA, /* Cirrus Maverick floating point model. */ ARM_FP_MODEL_MAVERICK, /* VFP floating point model. */ ARM_FP_MODEL_VFP};extern enum arm_fp_model arm_fp_model;/* Which floating point hardware is available. Also update fp_model_for_fpu in arm.c when adding entries to this list. */enum fputype{ /* No FP hardware. */ FPUTYPE_NONE, /* Full FPA support. */ FPUTYPE_FPA, /* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM). */ FPUTYPE_FPA_EMU2, /* Emulated FPA hardware, Issue 3 emulator. */ FPUTYPE_FPA_EMU3, /* Cirrus Maverick floating point co-processor. */ FPUTYPE_MAVERICK, /* VFP. */ FPUTYPE_VFP};/* Recast the floating point class to be the floating point attribute. */#define arm_fpu_attr ((enum attr_fpu) arm_fpu_tune)/* What type of floating point to tune for */extern enum fputype arm_fpu_tune;/* What type of floating point instructions are available */extern enum fputype arm_fpu_arch;enum float_abi_type{ ARM_FLOAT_ABI_SOFT, ARM_FLOAT_ABI_SOFTFP, ARM_FLOAT_ABI_HARD};extern enum float_abi_type arm_float_abi;#ifndef TARGET_DEFAULT_FLOAT_ABI#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT#endif/* Which ABI to use. */enum arm_abi_type{ ARM_ABI_APCS, ARM_ABI_ATPCS, ARM_ABI_AAPCS, ARM_ABI_IWMMXT, ARM_ABI_AAPCS_LINUX};extern enum arm_abi_type arm_abi;#ifndef ARM_DEFAULT_ABI#define ARM_DEFAULT_ABI ARM_ABI_APCS#endif/* Which thread pointer access sequence to use. */enum arm_tp_type { TP_AUTO, TP_SOFT, TP_CP15};extern enum arm_tp_type target_thread_pointer;/* Nonzero if this chip supports the ARM Architecture 3M extensions. */extern int arm_arch3m;/* Nonzero if this chip supports the ARM Architecture 4 extensions. */extern int arm_arch4;/* Nonzero if this chip supports the ARM Architecture 4T extensions. */extern int arm_arch4t;/* Nonzero if this chip supports the ARM Architecture 5 extensions. */extern int arm_arch5;/* Nonzero if this chip supports the ARM Architecture 5E extensions. */extern int arm_arch5e;/* Nonzero if this chip supports the ARM Architecture 6 extensions. */extern int arm_arch6;/* Nonzero if this chip can benefit from load scheduling. */extern int arm_ld_sched;/* Nonzero if generating thumb code. */extern int thumb_code;/* Nonzero if this chip is a StrongARM. */extern int arm_tune_strongarm;/* Nonzero if this chip is a Cirrus variant. */extern int arm_arch_cirrus;/* Nonzero if this chip supports Intel XScale with Wireless MMX technology. */extern int arm_arch_iwmmxt;/* Nonzero if this chip is an XScale. */extern int arm_arch_xscale;/* Nonzero if tuning for XScale. */extern int arm_tune_xscale;/* Nonzero if tuning for stores via the write buffer. */extern int arm_tune_wbuf;/* Nonzero if we should define __THUMB_INTERWORK__ in the preprocessor. XXX This is a bit of a hack, it's intended to help work around
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -