📄 stormy16.h
字号:
/* Xstormy16 cpu description. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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 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, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA. *//* Driver configuration *//* Defined in svr4.h. */#undef ASM_SPEC#define ASM_SPEC ""/* For xstormy16: - If -msim is specified, everything is built and linked as for the sim. - If -T is specified, that linker script is used, and it should provide appropriate libraries. - If neither is specified, everything is built as for the sim, but no I/O support is assumed.*/#undef LIB_SPEC#define LIB_SPEC "-( -lc %{msim:-lsim}%{!msim:%{!T*:-lnosys}} -)"/* Defined in svr4.h. */#undef STARTFILE_SPEC#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"/* Defined in svr4.h. */#undef ENDFILE_SPEC#define ENDFILE_SPEC "crtend.o%s crtn.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_std ("xstormy16"); \ builtin_assert ("machine=xstormy16"); \ builtin_assert ("cpu=xstormy16"); \} while (0)/* This declaration should be present. */extern int target_flags;#define TARGET_SWITCHES \ {{ "sim", 0, "Provide libraries for the simulator" }, \ { "", 0, "" }}#define TARGET_VERSION fprintf (stderr, " (xstormy16 cpu core)");#define CAN_DEBUG_WITHOUT_FP/* Storage Layout */#define BITS_BIG_ENDIAN 1#define BYTES_BIG_ENDIAN 0#define WORDS_BIG_ENDIAN 0#define UNITS_PER_WORD 2#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \do { \ if (GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < 2) \ (MODE) = HImode; \} while (0)#define PARM_BOUNDARY 16#define STACK_BOUNDARY 16#define FUNCTION_BOUNDARY 16#define BIGGEST_ALIGNMENT 16/* 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 16#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 0/* Defined in svr4.h. */#define SIZE_TYPE "unsigned int"/* Defined in svr4.h. */#define PTRDIFF_TYPE "int"/* Defined in svr4.h, to "long int". *//* #define WCHAR_TYPE "long int" *//* Defined in svr4.h. */#undef WCHAR_TYPE_SIZE#define WCHAR_TYPE_SIZE 32/* Define this macro if the type of Objective-C selectors should be `int'. If this macro is not defined, then selectors should have the type `struct objc_selector *'. *//* #define OBJC_INT_SELECTORS *//* Register Basics */#define FIRST_PSEUDO_REGISTER 19#define FIXED_REGISTERS \ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1 }#define CALL_USED_REGISTERS \ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 }/* Order of allocation of registers */#define REG_ALLOC_ORDER { 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 10, 11, 12, 13, 14, 15, 16 }/* How Values Fit in Registers */#define HARD_REGNO_NREGS(REGNO, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)#define HARD_REGNO_MODE_OK(REGNO, MODE) ((REGNO) != 16 || (MODE) == BImode)/* A C expression that is nonzero if it is desirable to choose register allocation so as to avoid move instructions between a value of mode MODE1 and a value of mode MODE2. If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be zero. */#define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) != BImode && (MODE2) != BImode)/* Register Classes */enum reg_class{ NO_REGS, R0_REGS, R1_REGS, TWO_REGS, R2_REGS, EIGHT_REGS, R8_REGS, ICALL_REGS, GENERAL_REGS, CARRY_REGS, ALL_REGS, LIM_REG_CLASSES};#define N_REG_CLASSES ((int) LIM_REG_CLASSES)#define REG_CLASS_NAMES \{ \ "NO_REGS", \ "R0_REGS", \ "R1_REGS", \ "TWO_REGS", \ "R2_REGS", \ "EIGHT_REGS", \ "R8_REGS", \ "ICALL_REGS", \ "GENERAL_REGS", \ "CARRY_REGS", \ "ALL_REGS" \}#define REG_CLASS_CONTENTS \{ \ { 0x00000 }, \ { 0x00001 }, \ { 0x00002 }, \ { 0x00003 }, \ { 0x00004 }, \ { 0x000FF }, \ { 0x00100 }, \ { 0x00300 }, \ { 0x6FFFF }, \ { 0x10000 }, \ { (1 << FIRST_PSEUDO_REGISTER) - 1 } \}#define REGNO_REG_CLASS(REGNO) \ ((REGNO) == 0 ? R0_REGS \ : (REGNO) == 1 ? R1_REGS \ : (REGNO) == 2 ? R2_REGS \ : (REGNO) < 8 ? EIGHT_REGS \ : (REGNO) == 8 ? R8_REGS \ : (REGNO) == 16 ? CARRY_REGS \ : (REGNO) <= 18 ? GENERAL_REGS \ : ALL_REGS)#define BASE_REG_CLASS GENERAL_REGS#define INDEX_REG_CLASS GENERAL_REGS/* The following letters are unavailable, due to being used as constraints: '0'..'9' '<', '>' 'E', 'F', 'G', 'H' 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P' 'Q', 'R', 'S', 'T', 'U' 'V', 'X' 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */#define REG_CLASS_FROM_LETTER(CHAR) \ ( (CHAR) == 'a' ? R0_REGS \ : (CHAR) == 'b' ? R1_REGS \ : (CHAR) == 'c' ? R2_REGS \ : (CHAR) == 'd' ? R8_REGS \ : (CHAR) == 'e' ? EIGHT_REGS \ : (CHAR) == 't' ? TWO_REGS \ : (CHAR) == 'y' ? CARRY_REGS \ : (CHAR) == 'z' ? ICALL_REGS \ : NO_REGS)#define REGNO_OK_FOR_BASE_P(NUM) 1#define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)/* This declaration must be present. */#define PREFERRED_RELOAD_CLASS(X, CLASS) \ xstormy16_preferred_reload_class (X, CLASS)#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \ xstormy16_preferred_reload_class (X, CLASS)/* This chip has the interesting property that only the first eight registers can be moved to/from memory. */#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \ xstormy16_secondary_reload_class (CLASS, MODE, X)/* Normally the compiler avoids choosing registers that have been explicitly mentioned in the rtl as spill registers (these registers are normally those used to pass parameters and return values). However, some machines have so few registers of certain classes that there would not be enough registers to use as spill registers if this were done. Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero value on these machines. When this macro has a nonzero value, the compiler allows registers explicitly used in the rtl to be used as spill registers but avoids extending the lifetime of these registers. It is always safe to define this macro with a nonzero value, but if you unnecessarily define it, you will reduce the amount of optimizations that can be performed in some cases. If you do not define this macro with a nonzero value when it is required, the compiler will run out of spill registers and print a fatal error message. For most machines, you should not define this macro at all. *//* #define SMALL_REGISTER_CLASSES *//* This declaration is required. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* If defined, a C expression for a class that contains registers which the compiler must always access in a mode that is the same size as the mode in which it loaded the register. For the example, loading 32-bit integer or floating-point objects into floating-point registers on the Alpha extends them to 64-bits. Therefore loading a 64-bit object and then storing it as a 32-bit object does not store the low-order 32-bits, as would be the case for a normal register. Therefore, `alpha.h' defines this macro as `FLOAT_REGS'. *//* #define CLASS_CANNOT_CHANGE_SIZE */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ( (C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 3 \ : (C) == 'J' ? exact_log2 (VALUE) != -1 \ : (C) == 'K' ? exact_log2 (~(VALUE)) != -1 \ : (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 255 \ : (C) == 'M' ? (VALUE) >= -255 && (VALUE) <= 0 \ : (C) == 'N' ? (VALUE) >= -3 && (VALUE) <= 0 \ : (C) == 'O' ? (VALUE) >= 1 && (VALUE) <= 4 \ : (C) == 'P' ? (VALUE) >= -4 && (VALUE) <= -1 \ : 0 )#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0#define EXTRA_CONSTRAINT(VALUE, C) \ xstormy16_extra_constraint_p (VALUE, C)/* Basic Stack Layout *//* We want to use post-increment instructions to push things on the stack, because we don't have any pre-increment ones. */#define STACK_PUSH_CODE POST_INC/* #define FRAME_GROWS_DOWNWARD */#define ARGS_GROW_DOWNWARD 1#define STARTING_FRAME_OFFSET 0#define FIRST_PARM_OFFSET(FUNDECL) 0#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \ ((COUNT) == 0 \ ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \ : NULL_RTX)#define INCOMING_RETURN_ADDR_RTX \ gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-4)))#define INCOMING_FRAME_SP_OFFSET (xstormy16_interrupt_function_p () ? 6 : 4)/* Register That Address the Stack Frame. */#define STACK_POINTER_REGNUM 15#define FRAME_POINTER_REGNUM 17#define HARD_FRAME_POINTER_REGNUM 13#define ARG_POINTER_REGNUM 18#define STATIC_CHAIN_REGNUM 1/* Eliminating the Frame Pointer and the Arg Pointer */#define FRAME_POINTER_REQUIRED 0#define ELIMINABLE_REGS \{ \ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \}#define CAN_ELIMINATE(FROM, TO) \ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ? ! frame_pointer_needed \ : 1)#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ (OFFSET) = xstormy16_initial_elimination_offset (FROM, TO)/* Passing Function Arguments on the Stack */#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0/* Function Arguments in Registers */#define NUM_ARGUMENT_REGISTERS 6#define FIRST_ARGUMENT_REGISTER 2#define XSTORMY16_WORD_SIZE(TYPE, MODE) \ ((((TYPE) ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \ + 1) \ / 2)#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ xstormy16_function_arg (CUM, MODE, TYPE, NAMED)/* For this platform, the value of CUMULATIVE_ARGS is the number of words of arguments that have been passed in registers so far. */#define CUMULATIVE_ARGS int#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ (CUM) = 0#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ((CUM) = xstormy16_function_arg_advance (CUM, MODE, TYPE, NAMED))#define FUNCTION_ARG_REGNO_P(REGNO) \ ((REGNO) >= FIRST_ARGUMENT_REGISTER \ && (REGNO) < FIRST_ARGUMENT_REGISTER + NUM_ARGUMENT_REGISTERS)/* How Scalar Function Values are Returned */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -