📄 c4x.h
字号:
/* Definitions of target machine for GNU compiler. TMS320C[34]x Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) and Herman Ten Brugge (Haj.Ten.Brugge@net.HCC.nl). 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. *//* RUN-TIME TARGET SPECIFICATION. */#define C4x 1#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ extern int flag_inline_trees; \ if (!TARGET_SMALL) \ builtin_define ("_BIGMODEL"); \ if (!TARGET_MEMPARM) \ builtin_define ("_REGPARM"); \ if (flag_inline_functions) \ builtin_define ("_INLINE"); \ if (TARGET_C3X) \ { \ builtin_define ("_TMS320C3x"); \ builtin_define ("_C3x"); \ if (TARGET_C30) \ { \ builtin_define ("_TMS320C30"); \ builtin_define ("_C30"); \ } \ else if (TARGET_C31) \ { \ builtin_define ("_TMS320C31"); \ builtin_define ("_C31"); \ } \ else if (TARGET_C32) \ { \ builtin_define ("_TMS320C32"); \ builtin_define ("_C32"); \ } \ else if (TARGET_C33) \ { \ builtin_define ("_TMS320C33"); \ builtin_define ("_C33"); \ } \ } \ else \ { \ builtin_define ("_TMS320C4x"); \ builtin_define ("_C4x"); \ if (TARGET_C40) \ { \ builtin_define ("_TMS320C40"); \ builtin_define ("_C40"); \ } \ else if (TARGET_C44) \ { \ builtin_define ("_TMS320C44"); \ builtin_define ("_C44"); \ } \ } \ } \ while (0)/* Define assembler options. */#define ASM_SPEC "\%{!mcpu=30:%{!mcpu=31:%{!mcpu=32:%{!mcpu=33:%{!mcpu=40:%{!mcpu=44:\%{!m30:%{!m31:%{!m32:%{!m33:%{!m40:%{!m44:-m40}}}}}}}}}}}} \%{mcpu=30} \%{mcpu=31} \%{mcpu=32} \%{mcpu=33} \%{mcpu=40} \%{mcpu=44} \%{m30} \%{m31} \%{m32} \%{m33} \%{m40} \%{m44} \%{mmemparm} %{mregparm} %{!mmemparm:%{!mregparm:-mregparm}} \%{mbig} %{msmall} %{!msmall:%{!mbig:-mbig}}"/* Define linker options. */#define LINK_SPEC "\%{m30:--architecture c3x} \%{m31:--architecture c3x} \%{m32:--architecture c3x} \%{m33:--architecture c3x} \%{mcpu=30:--architecture c3x} \%{mcpu=31:--architecture c3x} \%{mcpu=32:--architecture c3x} \%{mcpu=33:--architecture c3x}"/* Specify the end file to link with. */#define ENDFILE_SPEC ""/* Caveats: Max iteration count for RPTB/RPTS is 2^31 + 1. Max iteration count for DB is 2^31 + 1 for C40, but 2^23 + 1 for C30. RPTS blocks interrupts. */extern int c4x_cpu_version; /* Cpu version C30/31/32/33/40/44. */#define TARGET_INLINE (! optimize_size) /* Inline MPYI. */#define TARGET_SMALL_REG_CLASS 0#define TARGET_C3X (c4x_cpu_version >= 30 \ && c4x_cpu_version <= 39)#define TARGET_C30 (c4x_cpu_version == 30)#define TARGET_C31 (c4x_cpu_version == 31)#define TARGET_C32 (c4x_cpu_version == 32)#define TARGET_C33 (c4x_cpu_version == 33)#define TARGET_C40 (c4x_cpu_version == 40)#define TARGET_C44 (c4x_cpu_version == 44)/* Nonzero to use load_immed_addr pattern rather than forcing memory addresses into memory. */#define TARGET_LOAD_ADDRESS (1 || (! TARGET_C3X && ! TARGET_SMALL))/* Nonzero to convert direct memory references into HIGH/LO_SUM pairs during RTL generation. */#define TARGET_EXPOSE_LDP 0/* Nonzero to force loading of direct memory references into a register. */#define TARGET_LOAD_DIRECT_MEMS 0/* -mrpts allows the use of the RPTS instruction irregardless. -mrpts=max-cycles will use RPTS if the number of cycles is constant and less than max-cycles. */#define TARGET_RPTS_CYCLES(CYCLES) (TARGET_RPTS || (CYCLES) < c4x_rpts_cycles)/* 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. */#define OVERRIDE_OPTIONS c4x_override_options ()/* Define this to change the optimizations performed by default. */#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) c4x_optimization_options(LEVEL, SIZE)/* Run Time Target Specification. */#define TARGET_VERSION fprintf (stderr, " (TMS320C[34]x, TI syntax)");/* Storage Layout. */#define BITS_BIG_ENDIAN 0#define BYTES_BIG_ENDIAN 0#define WORDS_BIG_ENDIAN 0/* Technically, we are little endian, but we put the floats out as whole longs and this makes GCC put them out in the right order. */#define FLOAT_WORDS_BIG_ENDIAN 1/* Note the ANSI C standard requires sizeof(char) = 1. On the C[34]x all integral and floating point data types are stored in memory as 32-bits (floating point types can be stored as 40-bits in the extended precision registers), so sizeof(char) = sizeof(short) = sizeof(int) = sizeof(long) = sizeof(float) = sizeof(double) = 1. */#define BITS_PER_UNIT 32#define UNITS_PER_WORD 1#define PARM_BOUNDARY 32#define STACK_BOUNDARY 32#define FUNCTION_BOUNDARY 32#define BIGGEST_ALIGNMENT 32#define EMPTY_FIELD_BOUNDARY 32#define STRICT_ALIGNMENT 0#define TARGET_FLOAT_FORMAT C4X_FLOAT_FORMAT#define MAX_FIXED_MODE_SIZE 64 /* HImode. *//* If a structure has a floating point field then force structure to have BLKMODE, unless it is the only field. */#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \ (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE && (MODE) == VOIDmode)/* Number of bits in the high and low parts of a two stage load of an immediate constant. */#define BITS_PER_HIGH 16#define BITS_PER_LO_SUM 16/* Define register numbers. *//* Extended-precision registers. */#define R0_REGNO 0#define R1_REGNO 1#define R2_REGNO 2#define R3_REGNO 3#define R4_REGNO 4#define R5_REGNO 5#define R6_REGNO 6#define R7_REGNO 7/* Auxiliary (address) registers. */#define AR0_REGNO 8#define AR1_REGNO 9#define AR2_REGNO 10#define AR3_REGNO 11#define AR4_REGNO 12#define AR5_REGNO 13#define AR6_REGNO 14#define AR7_REGNO 15/* Data page register. */#define DP_REGNO 16/* Index registers. */#define IR0_REGNO 17#define IR1_REGNO 18/* Block size register. */#define BK_REGNO 19/* Stack pointer. */#define SP_REGNO 20/* Status register. */#define ST_REGNO 21/* Misc. interrupt registers. */#define DIE_REGNO 22 /* C4x only. */#define IE_REGNO 22 /* C3x only. */#define IIE_REGNO 23 /* C4x only. */#define IF_REGNO 23 /* C3x only. */#define IIF_REGNO 24 /* C4x only. */#define IOF_REGNO 24 /* C3x only. *//* Repeat block registers. */#define RS_REGNO 25#define RE_REGNO 26#define RC_REGNO 27/* Additional extended-precision registers. */#define R8_REGNO 28 /* C4x only. */#define R9_REGNO 29 /* C4x only. */#define R10_REGNO 30 /* C4x only. */#define R11_REGNO 31 /* C4x only. */#define FIRST_PSEUDO_REGISTER 32/* Extended precision registers (low set). */#define IS_R0R1_REGNO(r) \ ((unsigned int)((r) - R0_REGNO) <= (R1_REGNO - R0_REGNO))#define IS_R2R3_REGNO(r) \ ((unsigned int)((r) - R2_REGNO) <= (R3_REGNO - R2_REGNO)) #define IS_EXT_LOW_REGNO(r) \ ((unsigned int)((r) - R0_REGNO) <= (R7_REGNO - R0_REGNO)) /* Extended precision registers (high set). */#define IS_EXT_HIGH_REGNO(r) \(! TARGET_C3X \ && ((unsigned int) ((r) - R8_REGNO) <= (R11_REGNO - R8_REGNO)))/* Address registers. */#define IS_AUX_REGNO(r) \ ((unsigned int)((r) - AR0_REGNO) <= (AR7_REGNO - AR0_REGNO)) #define IS_ADDR_REGNO(r) IS_AUX_REGNO(r)#define IS_DP_REGNO(r) ((r) == DP_REGNO)#define IS_INDEX_REGNO(r) (((r) == IR0_REGNO) || ((r) == IR1_REGNO))#define IS_SP_REGNO(r) ((r) == SP_REGNO)#define IS_BK_REGNO(r) (TARGET_BK && (r) == BK_REGNO)/* Misc registers. */#define IS_ST_REGNO(r) ((r) == ST_REGNO)#define IS_RC_REGNO(r) ((r) == RC_REGNO)#define IS_REPEAT_REGNO(r) (((r) >= RS_REGNO) && ((r) <= RC_REGNO))/* Composite register sets. */#define IS_ADDR_OR_INDEX_REGNO(r) (IS_ADDR_REGNO(r) || IS_INDEX_REGNO(r))#define IS_EXT_REGNO(r) (IS_EXT_LOW_REGNO(r) || IS_EXT_HIGH_REGNO(r))#define IS_STD_REGNO(r) (IS_ADDR_OR_INDEX_REGNO(r) \ || IS_REPEAT_REGNO(r) \ || IS_SP_REGNO(r) \ || IS_BK_REGNO(r))#define IS_INT_REGNO(r) (IS_EXT_REGNO(r) || IS_STD_REGNO(r))#define IS_GROUP1_REGNO(r) (IS_ADDR_OR_INDEX_REGNO(r) || IS_BK_REGNO(r))#define IS_INT_CALL_SAVED_REGNO(r) (((r) == R4_REGNO) || ((r) == R5_REGNO) \ || ((r) == R8_REGNO))#define IS_FLOAT_CALL_SAVED_REGNO(r) (((r) == R6_REGNO) || ((r) == R7_REGNO))#define IS_PSEUDO_REGNO(r) ((r) >= FIRST_PSEUDO_REGISTER)#define IS_R0R1_OR_PSEUDO_REGNO(r) (IS_R0R1_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_R2R3_OR_PSEUDO_REGNO(r) (IS_R2R3_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_EXT_OR_PSEUDO_REGNO(r) (IS_EXT_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_STD_OR_PSEUDO_REGNO(r) (IS_STD_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_INT_OR_PSEUDO_REGNO(r) (IS_INT_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_ADDR_OR_PSEUDO_REGNO(r) (IS_ADDR_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_INDEX_OR_PSEUDO_REGNO(r) (IS_INDEX_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_EXT_LOW_OR_PSEUDO_REGNO(r) (IS_EXT_LOW_REGNO(r) \ || IS_PSEUDO_REGNO(r))#define IS_DP_OR_PSEUDO_REGNO(r) (IS_DP_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_SP_OR_PSEUDO_REGNO(r) (IS_SP_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_ST_OR_PSEUDO_REGNO(r) (IS_ST_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_RC_OR_PSEUDO_REGNO(r) (IS_RC_REGNO(r) || IS_PSEUDO_REGNO(r))#define IS_PSEUDO_REG(op) (IS_PSEUDO_REGNO(REGNO(op)))#define IS_ADDR_REG(op) (IS_ADDR_REGNO(REGNO(op)))#define IS_INDEX_REG(op) (IS_INDEX_REGNO(REGNO(op)))#define IS_GROUP1_REG(r) (IS_GROUP1_REGNO(REGNO(op)))#define IS_SP_REG(op) (IS_SP_REGNO(REGNO(op)))#define IS_STD_REG(op) (IS_STD_REGNO(REGNO(op)))#define IS_EXT_REG(op) (IS_EXT_REGNO(REGNO(op)))#define IS_R0R1_OR_PSEUDO_REG(op) (IS_R0R1_OR_PSEUDO_REGNO(REGNO(op)))#define IS_R2R3_OR_PSEUDO_REG(op) (IS_R2R3_OR_PSEUDO_REGNO(REGNO(op)))#define IS_EXT_OR_PSEUDO_REG(op) (IS_EXT_OR_PSEUDO_REGNO(REGNO(op)))#define IS_STD_OR_PSEUDO_REG(op) (IS_STD_OR_PSEUDO_REGNO(REGNO(op)))#define IS_EXT_LOW_OR_PSEUDO_REG(op) (IS_EXT_LOW_OR_PSEUDO_REGNO(REGNO(op)))#define IS_INT_OR_PSEUDO_REG(op) (IS_INT_OR_PSEUDO_REGNO(REGNO(op)))#define IS_ADDR_OR_PSEUDO_REG(op) (IS_ADDR_OR_PSEUDO_REGNO(REGNO(op)))#define IS_INDEX_OR_PSEUDO_REG(op) (IS_INDEX_OR_PSEUDO_REGNO(REGNO(op)))#define IS_DP_OR_PSEUDO_REG(op) (IS_DP_OR_PSEUDO_REGNO(REGNO(op)))#define IS_SP_OR_PSEUDO_REG(op) (IS_SP_OR_PSEUDO_REGNO(REGNO(op)))#define IS_ST_OR_PSEUDO_REG(op) (IS_ST_OR_PSEUDO_REGNO(REGNO(op)))#define IS_RC_OR_PSEUDO_REG(op) (IS_RC_OR_PSEUDO_REGNO(REGNO(op)))/* 1 for registers that have pervasive standard uses and are not available for the register allocator. */#define FIXED_REGISTERS \{ \/* R0 R1 R2 R3 R4 R5 R6 R7 AR0 AR1 AR2 AR3 AR4 AR5 AR6 AR7. */ \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \/* DP IR0 IR1 BK SP ST DIE IIE IIF RS RE RC R8 R9 R10 R11. */ \ 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 \}/* 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. Note that the extended precision registers are only saved in some modes. The macro HARD_REGNO_CALL_CLOBBERED specifies which modes get clobbered for a given regno. */#define CALL_USED_REGISTERS \{ \/* R0 R1 R2 R3 R4 R5 R6 R7 AR0 AR1 AR2 AR3 AR4 AR5 AR6 AR7. */ \ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, \/* DP IR0 IR1 BK SP ST DIE IIE IIF RS RE RC R8 R9 R10 R11. */ \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1 \}/* Macro to conditionally modify fixed_regs/call_used_regs. */#define CONDITIONAL_REGISTER_USAGE \ { \ if (! TARGET_BK) \ { \ fixed_regs[BK_REGNO] = 1; \ call_used_regs[BK_REGNO] = 1; \ c4x_regclass_map[BK_REGNO] = NO_REGS; \ } \ if (TARGET_C3X) \ { \ int i; \ \ reg_names[DIE_REGNO] = "ie"; /* Clobber die. */ \ reg_names[IF_REGNO] = "if"; /* Clobber iie. */ \ reg_names[IOF_REGNO] = "iof"; /* Clobber iif. */ \ \ for (i = R8_REGNO; i <= R11_REGNO; i++) \ { \ fixed_regs[i] = call_used_regs[i] = 1; \ c4x_regclass_map[i] = NO_REGS; \ } \ } \ if (TARGET_PRESERVE_FLOAT) \ { \ c4x_caller_save_map[R6_REGNO] = HFmode; \ c4x_caller_save_map[R7_REGNO] = HFmode; \ } \ }/* Order of Allocation of Registers. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -