📄 mn10300.h
字号:
/* Definitions of target machine for GNU compiler. Matsushita MN10300 series Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com).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. */#undef ASM_SPEC#undef ASM_FINAL_SPEC#undef LIB_SPEC#undef ENDFILE_SPEC#undef LINK_SPEC#define LINK_SPEC "%{mrelax:--relax}"#undef STARTFILE_SPEC#define STARTFILE_SPEC "%{!mno-crt0:%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}"/* Names to predefine in the preprocessor for this target machine. */#define CPP_PREDEFINES "-D__mn10300__ -D__MN10300__"#define CPP_SPEC "%{mam33:-D__AM33__}"/* Run-time compilation parameters selecting different hardware subsets. */extern int target_flags;/* Macros used in the machine description to test the flags. *//* Macro to define tables used to set the flags. This is a list in braces of pairs in braces, each pair being { "NAME", VALUE } where VALUE is the bits to set or minus the bits to clear. An empty string NAME is used to identify the default VALUE. *//* Generate code to work around mul/mulq bugs on the mn10300. */#define TARGET_MULT_BUG (target_flags & 0x1)/* Generate code for the AM33 processor. */#define TARGET_AM33 (target_flags & 0x2)#define TARGET_SWITCHES \ {{ "mult-bug", 0x1, N_("Work around hardware multiply bug")}, \ { "no-mult-bug", -0x1, N_("Do not work around hardware multiply bug")},\ { "am33", 0x2, N_("Target the AM33 processor")}, \ { "am33", -(0x1), ""},\ { "no-am33", -0x2, ""}, \ { "no-crt0", 0, N_("No default crt0.o") }, \ { "relax", 0, N_("Enable linker relaxations") }, \ { "", TARGET_DEFAULT, NULL}}#ifndef TARGET_DEFAULT#define TARGET_DEFAULT 0x1#endif/* Print subsidiary information on the compiler version in use. */#define TARGET_VERSION fprintf (stderr, " (MN10300)");/* Target machine storage layout *//* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. This is not true on the Matsushita MN1003. */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. *//* This is not true on the Matsushita MN10300. */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is lowest numbered. This is not true on the Matsushita MN10300. */#define WORDS_BIG_ENDIAN 0/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 4/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY 32/* The stack goes in 32 bit lumps. */#define STACK_BOUNDARY 32/* Allocation boundary (in *bits*) for the code of a function. 8 is the minimum boundary; it's unclear if bigger alignments would improve performance. */#define FUNCTION_BOUNDARY 8/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 32/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 32/* Define this if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 1/* Define this as 1 if `char' should by default be signed; else as 0. */#define DEFAULT_SIGNED_CHAR 0/* Standard register usage. *//* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler from 0 to just below FIRST_PSEUDO_REGISTER. All registers that the compiler knows about must be given numbers, even those that are not normally considered general registers. */#define FIRST_PSEUDO_REGISTER 18/* Specify machine-specific register numbers. */#define FIRST_DATA_REGNUM 0#define LAST_DATA_REGNUM 3#define FIRST_ADDRESS_REGNUM 4#define LAST_ADDRESS_REGNUM 8#define FIRST_EXTENDED_REGNUM 10#define LAST_EXTENDED_REGNUM 17/* Specify the registers used for certain standard purposes. The values of these macros are register numbers. *//* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM (LAST_ADDRESS_REGNUM+1)/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM (LAST_ADDRESS_REGNUM-1)/* Base register for access to arguments of the function. This is a fake register and will be eliminated into either the frame pointer or stack pointer. */#define ARG_POINTER_REGNUM LAST_ADDRESS_REGNUM/* Register in which static-chain is passed to a function. */#define STATIC_CHAIN_REGNUM (FIRST_ADDRESS_REGNUM+1)/* 1 for registers that have pervasive standard uses and are not available for the register allocator. */#define FIXED_REGISTERS \ { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 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. */#define CALL_USED_REGISTERS \ { 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}#define REG_ALLOC_ORDER \ { 0, 1, 4, 5, 2, 3, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 8, 9}#define CONDITIONAL_REGISTER_USAGE \{ \ unsigned int i; \ \ if (!TARGET_AM33) \ { \ for (i = FIRST_EXTENDED_REGNUM; \ i <= LAST_EXTENDED_REGNUM; i++) \ fixed_regs[i] = call_used_regs[i] = 1; \ } \}/* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. This is ordinarily the length in words of a value of mode MODE but can be less for certain modes in special long registers. */#define HARD_REGNO_NREGS(REGNO, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ ((REGNO_REG_CLASS (REGNO) == DATA_REGS \ || (TARGET_AM33 && REGNO_REG_CLASS (REGNO) == ADDRESS_REGS) \ || REGNO_REG_CLASS (REGNO) == EXTENDED_REGS) \ ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4 \ : ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) == 4)/* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */#define MODES_TIEABLE_P(MODE1, MODE2) \ (TARGET_AM33 \ || MODE1 == MODE2 \ || (GET_MODE_SIZE (MODE1) <= 4 && GET_MODE_SIZE (MODE2) <= 4))/* 4 data, and effectively 3 address registers is small as far as I'm concerned. */#define SMALL_REGISTER_CLASSES 1/* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. One of the classes must always be named ALL_REGS and include all hard regs. If there is more than one class, another class must be named NO_REGS and contain no registers. The name GENERAL_REGS must be the name of a class (or an alias for another name such as ALL_REGS). This is the class of registers that is allowed by "g" or "r" in a register constraint. Also, registers outside this class are allocated only when instructions express preferences for them. The classes must be numbered in nondecreasing order; that is, a larger-numbered class must never be contained completely in a smaller-numbered class. For any two classes, it is very desirable that there be another class that represents their union. */ enum reg_class { NO_REGS, DATA_REGS, ADDRESS_REGS, SP_REGS, DATA_OR_ADDRESS_REGS, SP_OR_ADDRESS_REGS, EXTENDED_REGS, DATA_OR_EXTENDED_REGS, ADDRESS_OR_EXTENDED_REGS, SP_OR_EXTENDED_REGS, SP_OR_ADDRESS_OR_EXTENDED_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES};#define N_REG_CLASSES (int) LIM_REG_CLASSES/* Give names of register classes as strings for dump file. */#define REG_CLASS_NAMES \{ "NO_REGS", "DATA_REGS", "ADDRESS_REGS", \ "SP_REGS", "DATA_OR_ADDRESS_REGS", "SP_OR_ADDRESS_REGS", \ "EXTENDED_REGS", \ "DATA_OR_EXTENDED_REGS", "ADDRESS_OR_EXTENDED_REGS", \ "SP_OR_EXTENDED_REGS", "SP_OR_ADDRESS_OR_EXTENDED_REGS", \ "GENERAL_REGS", "ALL_REGS", "LIM_REGS" }/* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. */#define REG_CLASS_CONTENTS \{ {0}, /* No regs */ \ {0x0000f}, /* DATA_REGS */ \ {0x001f0}, /* ADDRESS_REGS */ \ {0x00200}, /* SP_REGS */ \ {0x001ff}, /* DATA_OR_ADDRESS_REGS */\ {0x003f0}, /* SP_OR_ADDRESS_REGS */\ {0x3fc00}, /* EXTENDED_REGS */ \ {0x3fc0f}, /* DATA_OR_EXTENDED_REGS */ \ {0x3fdf0}, /* ADDRESS_OR_EXTENDED_REGS */ \ {0x3fe00}, /* SP_OR_EXTENDED_REGS */ \ {0x3fff0}, /* SP_OR_ADDRESS_OR_EXTENDED_REGS */ \ {0x3fdff}, /* GENERAL_REGS */ \ {0x3ffff}, /* ALL_REGS */ \}/* The same information, inverted: Return the class number of the smallest class containing reg number REGNO. This could be a conditional expression or could index an array. */#define REGNO_REG_CLASS(REGNO) \ ((REGNO) <= LAST_DATA_REGNUM ? DATA_REGS : \ (REGNO) <= LAST_ADDRESS_REGNUM ? ADDRESS_REGS : \ (REGNO) == STACK_POINTER_REGNUM ? SP_REGS : \ (REGNO) <= LAST_EXTENDED_REGNUM ? EXTENDED_REGS : \ NO_REGS)/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS DATA_OR_EXTENDED_REGS#define BASE_REG_CLASS SP_OR_ADDRESS_REGS/* Get reg_class from a letter such as appears in the machine description. */#define REG_CLASS_FROM_LETTER(C) \ ((C) == 'd' ? DATA_REGS : \ (C) == 'a' ? ADDRESS_REGS : \ (C) == 'y' ? SP_REGS : \ ! TARGET_AM33 ? NO_REGS : \ (C) == 'x' ? EXTENDED_REGS : \ NO_REGS)/* Macros to check register numbers against specific register classes. *//* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. We have two alternate definitions for each of them. The usual definition accepts all pseudo regs; the other rejects them unless they have been allocated suitable hard regs. The symbol REG_OK_STRICT causes the latter definition to be used. Most source files want to accept pseudo regs in the hope that they will get allocated to the class that the insn wants them to be in. Source files for reload pass need to be strict. After reload, it makes no difference, since pseudo regs have been eliminated by then. *//* These assume that REGNO is a hard or pseudo reg number. They give nonzero only if REGNO is a hard reg of the suitable class or a pseudo reg currently allocated to a suitable hard reg. Since they use reg_renumber, they are safe only once reg_renumber has been allocated, which happens in local-alloc.c. */#ifndef REG_OK_STRICT# define REGNO_IN_RANGE_P(regno,min,max) \ (IN_RANGE ((regno), (min), (max)) || (regno) >= FIRST_PSEUDO_REGISTER)#else# define REGNO_IN_RANGE_P(regno,min,max) \ (IN_RANGE ((regno), (min), (max)) \ || (reg_renumber \ && reg_renumber[(regno)] >= (min) && reg_renumber[(regno)] <= (max)))#endif#define REGNO_DATA_P(regno) \ REGNO_IN_RANGE_P ((regno), FIRST_DATA_REGNUM, LAST_DATA_REGNUM)#define REGNO_ADDRESS_P(regno) \ REGNO_IN_RANGE_P ((regno), FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM)#define REGNO_SP_P(regno) \ REGNO_IN_RANGE_P ((regno), STACK_POINTER_REGNUM, STACK_POINTER_REGNUM)#define REGNO_EXTENDED_P(regno) \ REGNO_IN_RANGE_P ((regno), FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM)#define REGNO_AM33_P(regno) \ (REGNO_DATA_P ((regno)) || REGNO_ADDRESS_P ((regno)) \ || REGNO_EXTENDED_P ((regno)))#define REGNO_OK_FOR_BASE_P(regno) \ (REGNO_SP_P ((regno)) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -