📄 frv.h
字号:
/* Target macros for the FRV port of GCC. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Red Hat Inc. 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 __FRV_H__#define __FRV_H__/* Frv general purpose macros. *//* Align an address. */#define ADDR_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))/* Return true if a value is inside a range. */#define IN_RANGE_P(VALUE, LOW, HIGH) \ ( (((HOST_WIDE_INT)(VALUE)) >= (HOST_WIDE_INT)(LOW)) \ && (((HOST_WIDE_INT)(VALUE)) <= ((HOST_WIDE_INT)(HIGH))))/* Driver configuration. *//* A C expression which determines whether the option `-CHAR' takes arguments. The value should be the number of arguments that option takes-zero, for many options. By default, this macro is defined to handle the standard options properly. You need not define it unless you wish to add additional options which take arguments. Defined in svr4.h. */#undef SWITCH_TAKES_ARG#define SWITCH_TAKES_ARG(CHAR) \ (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')/* A C expression which determines whether the option `-NAME' takes arguments. The value should be the number of arguments that option takes-zero, for many options. This macro rather than `SWITCH_TAKES_ARG' is used for multi-character option names. By default, this macro is defined as `DEFAULT_WORD_SWITCH_TAKES_ARG', which handles the standard options properly. You need not define `WORD_SWITCH_TAKES_ARG' unless you wish to add additional options which take arguments. Any redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and then check for additional options. Defined in svr4.h. */#undef WORD_SWITCH_TAKES_ARG/* -fpic and -fPIC used to imply the -mlibrary-pic multilib, but with FDPIC which multilib to use depends on whether FDPIC is in use or not. The trick we use is to introduce -multilib-library-pic as a pseudo-flag that selects the library-pic multilib, and map fpic and fPIC to it only if fdpic is not selected. Also, if fdpic is selected and no PIC/PIE options are present, we imply -fPIE. Otherwise, if -fpic or -fPIC are enabled and we're optimizing for speed, or if we have -On with n>=3, enable inlining of PLTs. As for -mgprel-ro, we want to enable it by default, but not for -fpic or -fpie. */#define DRIVER_SELF_SPECS SUBTARGET_DRIVER_SELF_SPECS \"%{mno-pack:\ %{!mhard-float:-msoft-float}\ %{!mmedia:-mno-media}}\ %{!mfdpic:%{fpic|fPIC: -multilib-library-pic}}\ %{mfdpic:%{!fpic:%{!fpie:%{!fPIC:%{!fPIE:\ %{!fno-pic:%{!fno-pie:%{!fno-PIC:%{!fno-PIE:-fPIE}}}}}}}} \ %{!mno-inline-plt:%{O*:%{!O0:%{!Os:%{fpic|fPIC:-minline-plt} \ %{!fpic:%{!fPIC:%{!O:%{!O1:%{!O2:-minline-plt}}}}}}}}} \ %{!mno-gprel-ro:%{!fpic:%{!fpie:-mgprel-ro}}}} \"#ifndef SUBTARGET_DRIVER_SELF_SPECS# define SUBTARGET_DRIVER_SELF_SPECS#endif/* A C string constant that tells the GCC driver program options to pass to the assembler. It can also specify how to translate options you give to GNU CC into options for GCC to pass to the assembler. See the file `sun3.h' for an example of this. Do not define this macro if it does not need to do anything. Defined in svr4.h. */#undef ASM_SPEC#define ASM_SPEC "\%{G*} %{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \%{mtomcat-stats} \%{!mno-eflags: \ %{mcpu=*} \ %{mgpr-*} %{mfpr-*} \ %{msoft-float} %{mhard-float} \ %{mdword} %{mno-dword} \ %{mdouble} %{mno-double} \ %{mmedia} %{mno-media} \ %{mmuladd} %{mno-muladd} \ %{mpack} %{mno-pack} \ %{mno-fdpic:-mnopic} %{mfdpic} \ %{fpic|fpie: -mpic} %{fPIC|fPIE: -mPIC} %{mlibrary-pic}}"/* Another C string constant used much like `LINK_SPEC'. The difference between the two is that `STARTFILE_SPEC' is used at the very beginning of the command given to the linker. If this macro is not defined, a default is provided that loads the standard C startup file from the usual place. See `gcc.c'. Defined in svr4.h. */#undef STARTFILE_SPEC#define STARTFILE_SPEC "crt0%O%s frvbegin%O%s"/* Another C string constant used much like `LINK_SPEC'. The difference between the two is that `ENDFILE_SPEC' is used at the very end of the command given to the linker. Do not define this macro if it does not need to do anything. Defined in svr4.h. */#undef ENDFILE_SPEC#define ENDFILE_SPEC "frvend%O%s"#define MASK_DEFAULT_FRV \ (MASK_MEDIA \ | MASK_DOUBLE \ | MASK_MULADD \ | MASK_DWORD \ | MASK_PACK)#define MASK_DEFAULT_FR500 \ (MASK_MEDIA | MASK_DWORD | MASK_PACK)#define MASK_DEFAULT_FR550 \ (MASK_MEDIA | MASK_DWORD | MASK_PACK)#define MASK_DEFAULT_FR450 \ (MASK_GPR_32 \ | MASK_FPR_32 \ | MASK_MEDIA \ | MASK_SOFT_FLOAT \ | MASK_DWORD \ | MASK_PACK)#define MASK_DEFAULT_FR400 \ (MASK_GPR_32 \ | MASK_FPR_32 \ | MASK_MEDIA \ | MASK_ACC_4 \ | MASK_SOFT_FLOAT \ | MASK_DWORD \ | MASK_PACK)#define MASK_DEFAULT_SIMPLE \ (MASK_GPR_32 | MASK_SOFT_FLOAT)/* A C string constant that tells the GCC driver program options to pass to `cc1'. It can also specify how to translate options you give to GCC into options for GCC to pass to the `cc1'. Do not define this macro if it does not need to do anything. *//* For ABI compliance, we need to put bss data into the normal data section. */#define CC1_SPEC "%{G*}"/* A C string constant that tells the GCC driver program options to pass to the linker. It can also specify how to translate options you give to GCC into options for GCC to pass to the linker. Do not define this macro if it does not need to do anything. Defined in svr4.h. *//* Override the svr4.h version with one that dispenses without the svr4 shared library options, notably -G. */#undef LINK_SPEC#define LINK_SPEC "\%{h*} %{v:-V} \%{b} \%{mfdpic:-melf32frvfd -z text} \%{static:-dn -Bstatic} \%{shared:-Bdynamic} \%{symbolic:-Bsymbolic} \%{G*} \%{YP,*} \%{Qy:} %{!Qn:-Qy}"/* Another C string constant used much like `LINK_SPEC'. The difference between the two is that `LIB_SPEC' is used at the end of the command given to the linker. If this macro is not defined, a default is provided that loads the standard C library from the usual place. See `gcc.c'. Defined in svr4.h. */#undef LIB_SPEC#define LIB_SPEC "--start-group -lc -lsim --end-group"#ifndef CPU_TYPE#define CPU_TYPE FRV_CPU_FR500#endif/* Run-time target specifications */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ int issue_rate; \ \ builtin_define ("__frv__"); \ builtin_assert ("machine=frv"); \ \ issue_rate = frv_issue_rate (); \ if (issue_rate > 1) \ builtin_define_with_int_value ("__FRV_VLIW__", issue_rate); \ builtin_define_with_int_value ("__FRV_GPR__", NUM_GPRS); \ builtin_define_with_int_value ("__FRV_FPR__", NUM_FPRS); \ builtin_define_with_int_value ("__FRV_ACC__", NUM_ACCS); \ \ switch (frv_cpu_type) \ { \ case FRV_CPU_GENERIC: \ builtin_define ("__CPU_GENERIC__"); \ break; \ case FRV_CPU_FR550: \ builtin_define ("__CPU_FR550__"); \ break; \ case FRV_CPU_FR500: \ case FRV_CPU_TOMCAT: \ builtin_define ("__CPU_FR500__"); \ break; \ case FRV_CPU_FR450: \ builtin_define ("__CPU_FR450__"); \ break; \ case FRV_CPU_FR405: \ builtin_define ("__CPU_FR405__"); \ break; \ case FRV_CPU_FR400: \ builtin_define ("__CPU_FR400__"); \ break; \ case FRV_CPU_FR300: \ case FRV_CPU_SIMPLE: \ builtin_define ("__CPU_FR300__"); \ break; \ } \ \ if (TARGET_HARD_FLOAT) \ builtin_define ("__FRV_HARD_FLOAT__"); \ if (TARGET_DWORD) \ builtin_define ("__FRV_DWORD__"); \ if (TARGET_FDPIC) \ builtin_define ("__FRV_FDPIC__"); \ if (flag_leading_underscore > 0) \ builtin_define ("__FRV_UNDERSCORE__"); \ } \ while (0)#define TARGET_HAS_FPRS (TARGET_HARD_FLOAT || TARGET_MEDIA)#define NUM_GPRS (TARGET_GPR_32? 32 : 64)#define NUM_FPRS (!TARGET_HAS_FPRS? 0 : TARGET_FPR_32? 32 : 64)#define NUM_ACCS (!TARGET_MEDIA? 0 : TARGET_ACC_4? 4 : 8)/* X is a valid accumulator number if (X & ACC_MASK) == X. */#define ACC_MASK \ (!TARGET_MEDIA ? 0 \ : TARGET_ACC_4 ? 3 \ : frv_cpu_type == FRV_CPU_FR450 ? 11 \ : 7)/* Macros to identify the blend of media instructions available. Revision 1 is the one found on the FR500. Revision 2 includes the changes made for the FR400. Treat the generic processor as a revision 1 machine for now, for compatibility with earlier releases. */#define TARGET_MEDIA_REV1 \ (TARGET_MEDIA \ && (frv_cpu_type == FRV_CPU_GENERIC \ || frv_cpu_type == FRV_CPU_FR500))#define TARGET_MEDIA_REV2 \ (TARGET_MEDIA \ && (frv_cpu_type == FRV_CPU_FR400 \ || frv_cpu_type == FRV_CPU_FR405 \ || frv_cpu_type == FRV_CPU_FR450 \ || frv_cpu_type == FRV_CPU_FR550))#define TARGET_MEDIA_FR450 \ (frv_cpu_type == FRV_CPU_FR450)#define TARGET_FR500_FR550_BUILTINS \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -