📄 fr30.h
字号:
/*{{{ Comment. */ /* Definitions of FR30 target. Copyright (C) 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 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.GNU CC 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 GNU CC; 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 SWITCH_TAKES_ARG/* Defined in svr4.h. */#undef WORD_SWITCH_TAKES_ARG/*}}}*/ /*{{{ Run-time target specifications. */ #undef ASM_SPEC#define ASM_SPEC "%{v}"/* Define this to be a string constant containing `-D' options to define the predefined macros that identify this machine and system. These macros will be predefined unless the `-ansi' option is specified. */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ builtin_define_std ("fr30"); \ builtin_assert ("machine=fr30"); \ } \ while (0)/* Use LDI:20 instead of LDI:32 to load addresses. */#define TARGET_SMALL_MODEL_MASK (1 << 0)#define TARGET_SMALL_MODEL (target_flags & TARGET_SMALL_MODEL_MASK)#define TARGET_DEFAULT 0/* This declaration should be present. */extern int target_flags;#define TARGET_SWITCHES \{ \ { "small-model", TARGET_SMALL_MODEL_MASK, \ N_("Assume small address space") }, \ { "no-small-model", - TARGET_SMALL_MODEL_MASK, "" }, \ { "no-lsim", 0, "" }, \ { "", TARGET_DEFAULT, "" } \}#define TARGET_VERSION fprintf (stderr, " (fr30)");#define CAN_DEBUG_WITHOUT_FP#undef STARTFILE_SPEC#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"/* Include the OS stub library, so that the code can be simulated. This is not the right way to do this. Ideally this kind of thing should be done in the linker script - but I have not worked out how to specify the location of a linker script in a gcc command line yet... */#undef ENDFILE_SPEC#define ENDFILE_SPEC "%{!mno-lsim:-lsim} crtend.o%s crtn.o%s"/*}}}*/ /*{{{ 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 32#define FUNCTION_BOUNDARY 32#define BIGGEST_ALIGNMENT 32#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 SHORT_TYPE_SIZE 16#define INT_TYPE_SIZE 32#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/*}}}*/ /*{{{ REGISTER BASICS. */ /* Number of hardware registers known to the compiler. They receive numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number really is assigned the number `FIRST_PSEUDO_REGISTER'. */#define FIRST_PSEUDO_REGISTER 21/* Fixed register assignments: *//* Here we do a BAD THING - reserve a register for use by the machine description file. There are too many places in compiler where it assumes that it can issue a branch or jump instruction without providing a scratch register for it, and reload just cannot cope, so we keep a register back for these situations. */#define COMPILER_SCRATCH_REGISTER 0/* The register that contains the result of a function call. */#define RETURN_VALUE_REGNUM 4/* The first register that can contain the arguments to a function. */#define FIRST_ARG_REGNUM 4/* A call-used register that can be used during the function prologue. */#define PROLOGUE_TMP_REGNUM COMPILER_SCRATCH_REGISTER /* Register numbers used for passing a function's static chain pointer. If register windows are used, the register number as seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as seen by the calling function is `STATIC_CHAIN_REGNUM'. If these registers are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined. The static chain register need not be a fixed register. If the static chain is passed in memory, these macros should not be defined; instead, the next two macros should be defined. */#define STATIC_CHAIN_REGNUM 12/* #define STATIC_CHAIN_INCOMING_REGNUM *//* An FR30 specific hardware register. */#define ACCUMULATOR_REGNUM 13/* The register number of the frame pointer register, which is used to access automatic variables in the stack frame. On some machines, the hardware determines which register this is. On other machines, you can choose any register you wish for this purpose. */#define FRAME_POINTER_REGNUM 14 /* The register number of the stack pointer register, which must also be a fixed register according to `FIXED_REGISTERS'. On most machines, the hardware determines which register this is. */#define STACK_POINTER_REGNUM 15/* The following a fake hard registers that describe some of the dedicated registers on the FR30. */#define CONDITION_CODE_REGNUM 16#define RETURN_POINTER_REGNUM 17#define MD_HIGH_REGNUM 18#define MD_LOW_REGNUM 19/* An initializer that says which registers are used for fixed purposes all throughout the compiled code and are therefore not available for general allocation. These would include the stack pointer, the frame pointer (except on machines where that can be used as a general register when no frame pointer is needed), the program counter on machines where that is considered one of the addressable registers, and any other numbered register with a standard use. This information is expressed as a sequence of numbers, separated by commas and surrounded by braces. The Nth number is 1 if register N is fixed, 0 otherwise. The table initialized from this macro, and the table initialized by the following one, may be overridden at run time either automatically, by the actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */#define FIXED_REGISTERS \ { 1, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */ \ 0, 0, 0, 0, 0, 0, 0, 1, /* 8 - 15 */ \ 1, 1, 1, 1, 1 } /* 16 - 20 *//* XXX - MDL and MDH set as fixed for now - this is until I can get the mul patterns working. *//* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in general) by function calls as well as for fixed registers. This macro therefore identifies the registers that are not available for general allocation of values that must live across function calls. If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically saves it on function entry and restores it on function exit, if the register is used within the function. */#define CALL_USED_REGISTERS \ { 1, 1, 1, 1, 1, 1, 1, 1, /* 0 - 7 */ \ 0, 0, 0, 0, 1, 1, 0, 1, /* 8 - 15 */ \ 1, 1, 1, 1, 1 } /* 16 - 20 *//* A C initializer containing the assembler's names for the machine registers, each one as a C string constant. This is what translates register numbers in the compiler into assembler language. */#define REGISTER_NAMES \{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "r10", "r11", "r12", "ac", "fp", "sp", \ "cc", "rp", "mdh", "mdl", "ap" \}/* If defined, a C initializer for an array of structures containing a name and a register number. This macro defines additional names for hard registers, thus allowing the `asm' option in declarations to refer to registers using alternate names. */#define ADDITIONAL_REGISTER_NAMES \{ \ {"r13", 13}, {"r14", 14}, {"r15", 15}, {"usp", 15}, {"ps", 16}\}/*}}}*/ /*{{{ How Values Fit in Registers. */ /* A C expression for the number of consecutive hard registers, starting at register number REGNO, required to hold a value of mode MODE. */#define HARD_REGNO_NREGS(REGNO, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* A C expression that is nonzero if it is permissible to store a value of mode MODE in hard register number REGNO (or in several registers starting with that one). */#define HARD_REGNO_MODE_OK(REGNO, MODE) 1/* 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) 1/*}}}*/ /*{{{ Register Classes. */ /* An enumeral type that must be defined with all the register class names as enumeral values. `NO_REGS' must be first. `ALL_REGS' must be the last register class, followed by one more enumeral value, `LIM_REG_CLASSES', which is not a register class but rather tells how many classes there are. Each register class has a number, which is the value of casting the class name to type `int'. The number serves as an index in many of the tables described below. */enum reg_class{ NO_REGS, MULTIPLY_32_REG, /* the MDL register as used by the MULH, MULUH insns */ MULTIPLY_64_REG, /* the MDH,MDL register pair as used by MUL and MULU */ LOW_REGS, /* registers 0 through 7 */ HIGH_REGS, /* registers 8 through 15 */ REAL_REGS, /* ie all the general hardware registers on the FR30 */ ALL_REGS, LIM_REG_CLASSES};#define GENERAL_REGS REAL_REGS#define N_REG_CLASSES ((int) LIM_REG_CLASSES)/* An initializer containing the names of the register classes as C string constants. These names are used in writing some of the debugging dumps. */#define REG_CLASS_NAMES \{ \ "NO_REGS", \ "MULTIPLY_32_REG", \ "MULTIPLY_64_REG", \ "LOW_REGS", \ "HIGH_REGS", \ "REAL_REGS", \ "ALL_REGS" \ }/* An initializer containing the contents of the register classes, as integers which are bit masks. The Nth integer specifies the contents of class N. The way the integer MASK is interpreted is that register R is in the class if `MASK & (1 << R)' is 1. When the machine has more than 32 registers, an integer does not suffice. Then the integers are replaced by sub-initializers, braced groupings containing several integers. Each sub-initializer must be suitable as an initializer for the type `HARD_REG_SET' which is defined in `hard-reg-set.h'. */#define REG_CLASS_CONTENTS \{ \ { 0 }, \ { 1 << MD_LOW_REGNUM }, \ { (1 << MD_LOW_REGNUM) | (1 << MD_HIGH_REGNUM) }, \ { (1 << 8) - 1 }, \ { ((1 << 8) - 1) << 8 }, \ { (1 << CONDITION_CODE_REGNUM) - 1 }, \ { (1 << FIRST_PSEUDO_REGISTER) - 1 } \}/* A C expression whose value is a register class containing hard register
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -