📄 d30v.h
字号:
/* Definitions of target machine for Mitsubishi D30V. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Cygnus Solutions. This file is part of GNU CC. GNU CC 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. GNU CC 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 GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#ifndef GCC_D30V_H/* D30V specific macros *//* Align an address */#define D30V_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))/* Driver configuration *//* Defined in svr4.h. *//* #define SWITCH_TAKES_ARG(CHAR) *//* Defined in svr4.h. *//* #define WORD_SWITCH_TAKES_ARG(NAME) *//* Defined in svr4.h. */#undef ASM_SPEC#define ASM_SPEC "\%{!mno-asm-optimize: %{O*: %{!O0: -O} %{O0: %{masm-optimize: -O}}}} \%{v} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"/* Defined in svr4.h. *//* #define ASM_FINAL_SPEC "" *//* Defined in svr4.h. */#undef LINK_SPEC#define LINK_SPEC "\%{h*} %{v:-V} \%{b} %{Wl,*:%*} \%{static:-dn -Bstatic} \%{shared:-G -dy -z text} \%{symbolic:-Bsymbolic -G -dy -z text} \%{G:-G} \%{YP,*} \%{Qy:} %{!Qn:-Qy} \%{mextmem: -m d30v_e} %{mextmemory: -m d30v_e} %{monchip: -m d30v_o}"/* Defined in svr4.h. */#undef LIB_SPEC#define LIB_SPEC "--start-group -lsim -lc --end-group"/* Defined in svr4.h. */#undef STARTFILE_SPEC#define STARTFILE_SPEC "crt0%O%s crtbegin%O%s"/* Defined in svr4.h. */#undef ENDFILE_SPEC#define ENDFILE_SPEC "crtend%O%s"/* Defined in svr4.h for host compilers. *//* #define MD_EXEC_PREFIX "" *//* Defined in svr4.h for host compilers. *//* #define MD_STARTFILE_PREFIX "" *//* Run-time target specifications */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ builtin_define ("__D30V__"); \ builtin_assert ("machine=d30v"); \ } \ while (0)/* This declaration should be present. */extern int target_flags;#define MASK_NO_COND_MOVE 0x00000001 /* disable conditional moves */#define MASK_DEBUG_ARG 0x10000000 /* debug argument handling */#define MASK_DEBUG_STACK 0x20000000 /* debug stack allocations */#define MASK_DEBUG_ADDR 0x40000000 /* debug GO_IF_LEGITIMATE_ADDRESS */#define TARGET_NO_COND_MOVE (target_flags & MASK_NO_COND_MOVE)#define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)#define TARGET_DEBUG_STACK (target_flags & MASK_DEBUG_STACK)#define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)#define TARGET_COND_MOVE (! TARGET_NO_COND_MOVE)/* Default switches used. */#ifndef TARGET_DEFAULT#define TARGET_DEFAULT 0#endif#define TARGET_SWITCHES \{ \ { "cond-move", -MASK_NO_COND_MOVE, \ N_("Enable use of conditional move instructions") }, \ \ { "no-cond-move", MASK_NO_COND_MOVE, \ N_("Disable use of conditional move instructions") }, \ \ { "debug-arg", MASK_DEBUG_ARG, \ N_("Debug argument support in compiler") }, \ \ { "debug-stack", MASK_DEBUG_STACK, \ N_("Debug stack support in compiler") }, \ \ { "debug-addr", MASK_DEBUG_ADDR, \ N_("Debug memory address support in compiler") }, \ \ { "asm-optimize", 0, \ N_("Make adjacent short instructions parallel if possible") }, \ \ { "no-asm-optimize", 0, \ N_("Do not make adjacent short instructions parallel") }, \ \ { "extmem", 0, \ N_("Link programs/data to be in external memory by default") }, \ \ { "extmemory", 0, \ N_("Link programs/data to be in external memory by default") }, \ \ { "onchip", 0, \ N_("Link programs/data to be in onchip memory by default") }, \ \ { "", TARGET_DEFAULT, "" }, \}#define TARGET_OPTIONS \{ \ {"branch-cost=", &d30v_branch_cost_string, \ N_("Change the branch costs within the compiler") }, \ \ {"cond-exec=", &d30v_cond_exec_string, \ N_("Change the threshold for conversion to conditional execution") }, \}#define TARGET_VERSION fprintf (stderr, " d30v")#define OVERRIDE_OPTIONS override_options ()#define CAN_DEBUG_WITHOUT_FP/* Storage Layout */#define BITS_BIG_ENDIAN 1#define BYTES_BIG_ENDIAN 1#define WORDS_BIG_ENDIAN 1#define UNITS_PER_WORD 4#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \do { \ if (GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < 4) \ (MODE) = SImode; \} while (0)#define PARM_BOUNDARY 32#define STACK_BOUNDARY 64#define FUNCTION_BOUNDARY 64#define BIGGEST_ALIGNMENT 64/* Defined in svr4.h. *//* #define MAX_OFILE_ALIGNMENT */#define DATA_ALIGNMENT(TYPE, ALIGN) \ (TREE_CODE (TYPE) == ARRAY_TYPE \ && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ (TREE_CODE (EXP) == STRING_CST \ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))#define STRICT_ALIGNMENT 1/* Defined in svr4.h. */#define PCC_BITFIELD_TYPE_MATTERS 1/* Layout of Source Language Data Types */#define INT_TYPE_SIZE 32#define SHORT_TYPE_SIZE 16#define LONG_TYPE_SIZE 32#define LONG_LONG_TYPE_SIZE 64#define FLOAT_TYPE_SIZE 32#define DOUBLE_TYPE_SIZE 64#define LONG_DOUBLE_TYPE_SIZE 64#define DEFAULT_SIGNED_CHAR 1/* Defined in svr4.h. *//* #define SIZE_TYPE *//* Defined in svr4.h. *//* #define PTRDIFF_TYPE *//* Defined in svr4.h. *//* #define WCHAR_TYPE *//* Defined in svr4.h. *//* #define WCHAR_TYPE_SIZE *//* D30V register layout. *//* Return true if a value is inside a range */#define IN_RANGE_P(VALUE, LOW, HIGH) \ (((unsigned)((VALUE) - (LOW))) <= ((unsigned)((HIGH) - (LOW))))/* General purpose registers. */#define GPR_FIRST 0 /* First gpr */#define GPR_LAST (GPR_FIRST + 63) /* Last gpr */#define GPR_R0 GPR_FIRST /* R0, constant 0 */#define GPR_ARG_FIRST (GPR_FIRST + 2) /* R2, first argument reg */#define GPR_ARG_LAST (GPR_FIRST + 17) /* R17, last argument reg */#define GPR_RET_VALUE GPR_ARG_FIRST /* R2, function return reg */#define GPR_ATMP_FIRST (GPR_FIRST + 20) /* R20, tmp to save accs */#define GPR_ATMP_LAST (GPR_FIRST + 21) /* R21, tmp to save accs */#define GPR_STACK_TMP (GPR_FIRST + 22) /* R22, tmp for saving stack */#define GPR_RES_FIRST (GPR_FIRST + 32) /* R32, first reserved reg */#define GPR_RES_LAST (GPR_FIRST + 35) /* R35, last reserved reg */#define GPR_FP (GPR_FIRST + 61) /* Frame pointer */#define GPR_LINK (GPR_FIRST + 62) /* Return address register */#define GPR_SP (GPR_FIRST + 63) /* Stack pointer *//* Argument register that is eliminated in favor of the frame and/or stack pointer. Also add register to point to where the return address is stored. */#define SPECIAL_REG_FIRST (GPR_LAST + 1)#define SPECIAL_REG_LAST (SPECIAL_REG_FIRST)#define ARG_POINTER_REGNUM (SPECIAL_REG_FIRST + 0)#define SPECIAL_REG_P(R) ((R) == SPECIAL_REG_FIRST)#define GPR_OR_SPECIAL_REG_P(R) IN_RANGE_P (R, GPR_FIRST, SPECIAL_REG_LAST)#define GPR_P(R) IN_RANGE_P (R, GPR_FIRST, GPR_LAST)#define GPR_OR_PSEUDO_P(R) (GPR_OR_SPECIAL_REG_P (R) \ || (R) >= FIRST_PSEUDO_REGISTER)/* Flag bits. */#define FLAG_FIRST (SPECIAL_REG_LAST + 1) /* First flag */#define FLAG_LAST (FLAG_FIRST + 7) /* Last flag */#define FLAG_F0 (FLAG_FIRST) /* F0, used in prediction */#define FLAG_F1 (FLAG_FIRST + 1) /* F1, used in prediction */#define FLAG_F2 (FLAG_FIRST + 2) /* F2, general flag */#define FLAG_F3 (FLAG_FIRST + 3) /* F3, general flag */#define FLAG_SAT (FLAG_FIRST + 4) /* F4, saturation flag */#define FLAG_OVERFLOW (FLAG_FIRST + 5) /* F5, overflow flag */#define FLAG_ACC_OVER (FLAG_FIRST + 6) /* F6, accumulated overflow */#define FLAG_CARRY (FLAG_FIRST + 7) /* F7, carry/borrow flag */#define FLAG_BORROW FLAG_CARRY#define FLAG_P(R) IN_RANGE_P (R, FLAG_FIRST, FLAG_LAST)#define FLAG_OR_PSEUDO_P(R) (FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)#define BR_FLAG_P(R) IN_RANGE_P (R, FLAG_F0, FLAG_F1)#define BR_FLAG_OR_PSEUDO_P(R) (BR_FLAG_P (R) || (R) >= FIRST_PSEUDO_REGISTER)/* Accumulators */#define ACCUM_FIRST (FLAG_LAST + 1) /* First accumulator */#define ACCUM_A0 ACCUM_FIRST /* Register A0 */#define ACCUM_A1 (ACCUM_FIRST + 1) /* Register A1 */#define ACCUM_LAST (ACCUM_FIRST + 1) /* Last accumulator */#define ACCUM_P(R) IN_RANGE_P (R, ACCUM_FIRST, ACCUM_LAST)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -