⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m68k.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 5 页
字号:
    { 						\      COPY_HARD_REG_SET (x, reg_class_contents[(int)FP_REGS]); \      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \       if (TEST_HARD_REG_BIT (x, i)) 		\	fixed_regs[i] = call_used_regs[i] = 1; 	\    } 						\  if (flag_pic)                                 \    fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \}#endif /* defined SUPPORT_SUN_FPA *//* 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.   On the 68000, ordinary registers hold 32 bits worth;   for the 68881 registers, a single register is always enough for   anything that can be stored in them at all.  */#define HARD_REGNO_NREGS(REGNO, MODE)   \  ((REGNO) >= 16 ? GET_MODE_NUNITS (MODE)	\   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))#ifndef SUPPORT_SUN_FPA/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.   On the 68000, the cpu registers can hold any mode but the 68881 registers   can hold only SFmode or DFmode.  The 68881 registers can't hold anything   if 68881 use is disabled.  */#define HARD_REGNO_MODE_OK(REGNO, MODE) \  (((REGNO) < 16)                                       \   || ((REGNO) < 24				        \       && TARGET_68881                                  \       && (GET_MODE_CLASS (MODE) == MODE_FLOAT		\	   || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)))#else /* defined SUPPORT_SUN_FPA *//* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.   On the 68000, the cpu registers can hold any mode but the 68881 registers   can hold only SFmode or DFmode.  And the 68881 registers can't hold anything   if 68881 use is disabled.  However, the Sun FPA register can   (apparently) hold whatever you feel like putting in them.   If using the fpa, don't put a double in d7/a0.  */#define HARD_REGNO_MODE_OK(REGNO, MODE) \(((REGNO) < 16								\  && !(TARGET_FPA							\       && GET_MODE_CLASS ((MODE)) != MODE_INT				\       && GET_MODE_UNIT_SIZE ((MODE)) > 4				\       && (REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8	\       && (REGNO) % (GET_MODE_UNIT_SIZE ((MODE)) / 4) != 0))		\ || ((REGNO) < 24							\     ? TARGET_68881 && (GET_MODE_CLASS (MODE) == MODE_FLOAT		\			|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)	\     : ((REGNO) < 56 ? TARGET_FPA : 0)))#endif /* defined SUPPORT_SUN_FPA *//* 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_68881					\   || ((GET_MODE_CLASS (MODE1) == MODE_FLOAT		\	|| GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT)	\       == (GET_MODE_CLASS (MODE2) == MODE_FLOAT		\	   || GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT)))/* Specify the registers used for certain standard purposes.   The values of these macros are register numbers.  *//* m68000 pc isn't overloaded on a register.  *//* #define PC_REGNUM  *//* Register to use for pushing function arguments.  */#define STACK_POINTER_REGNUM 15/* Base register for access to local variables of the function.  */#define FRAME_POINTER_REGNUM 14/* Value should be nonzero if functions must have frame pointers.   Zero means the frame pointer need not be set up (and parms   may be accessed via the stack pointer) in functions that seem suitable.   This is computed in `reload', in reload1.c.  */#define FRAME_POINTER_REQUIRED 0/* Base register for access to arguments of the function.  */#define ARG_POINTER_REGNUM 14/* Register in which static-chain is passed to a function.  */#define STATIC_CHAIN_REGNUM 8/* Register in which address to store a structure value   is passed to a function.  */#define STRUCT_VALUE_REGNUM 9/* 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.  *//* The 68000 has three kinds of registers, so eight classes would be   a complete set.  One of them is not needed.  */#ifndef SUPPORT_SUN_FPAenum reg_class {  NO_REGS, DATA_REGS,  ADDR_REGS, FP_REGS,  GENERAL_REGS, DATA_OR_FP_REGS,  ADDR_OR_FP_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",              \   "ADDR_REGS", "FP_REGS",              \   "GENERAL_REGS", "DATA_OR_FP_REGS",   \   "ADDR_OR_FP_REGS", "ALL_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 \{					\ 0x00000000,   	/* NO_REGS */		\ 0x000000ff,	/* DATA_REGS */		\ 0x0000ff00,	/* ADDR_REGS */		\ 0x00ff0000,	/* FP_REGS */		\ 0x0000ffff,	/* GENERAL_REGS */	\ 0x00ff00ff,	/* DATA_OR_FP_REGS */	\ 0x00ffff00,    /* ADDR_OR_FP_REGS */   \ 0x00ffffff,	/* 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)>>3)+1)#else /* defined SUPPORT_SUN_FPA *//* * Notes on final choices: * *   1) Didn't feel any need to union-ize LOW_FPA_REGS with anything * else. *   2) Removed all unions that involve address registers with * floating point registers (left in unions of address and data with * floating point). *   3) Defined GENERAL_REGS as ADDR_OR_DATA_REGS. *   4) Defined ALL_REGS as FPA_OR_FP_OR_GENERAL_REGS. *   4) Left in everything else. */enum reg_class { NO_REGS, LO_FPA_REGS, FPA_REGS, FP_REGS,  FP_OR_FPA_REGS, DATA_REGS, DATA_OR_FPA_REGS, DATA_OR_FP_REGS,  DATA_OR_FP_OR_FPA_REGS, ADDR_REGS, GENERAL_REGS,  GENERAL_OR_FPA_REGS, GENERAL_OR_FP_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", "LO_FPA_REGS", "FPA_REGS", "FP_REGS",  \   "FP_OR_FPA_REGS", "DATA_REGS", "DATA_OR_FPA_REGS", "DATA_OR_FP_REGS",  \   "DATA_OR_FP_OR_FPA_REGS", "ADDR_REGS", "GENERAL_REGS",  \   "GENERAL_OR_FPA_REGS", "GENERAL_OR_FP_REGS", "ALL_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, 0},			/* NO_REGS */		\ {0xff000000, 0x000000ff},	/* LO_FPA_REGS */	\ {0xff000000, 0x00ffffff},	/* FPA_REGS */		\ {0x00ff0000, 0x00000000},	/* FP_REGS */		\ {0xffff0000, 0x00ffffff},	/* FP_OR_FPA_REGS */	\ {0x000000ff, 0x00000000},	/* DATA_REGS */		\ {0xff0000ff, 0x00ffffff},	/* DATA_OR_FPA_REGS */	\ {0x00ff00ff, 0x00000000},	/* DATA_OR_FP_REGS */	\ {0xffff00ff, 0x00ffffff},	/* DATA_OR_FP_OR_FPA_REGS */\ {0x0000ff00, 0x00000000},	/* ADDR_REGS */		\ {0x0000ffff, 0x00000000},	/* GENERAL_REGS */	\ {0xff00ffff, 0x00ffffff},	/* GENERAL_OR_FPA_REGS */\ {0x00ffffff, 0x00000000},	/* GENERAL_OR_FP_REGS */\ {0xffffffff, 0x00ffffff},	/* 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.  */extern enum reg_class regno_reg_class[];#define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)>>3])#endif /* SUPPORT_SUN_FPA *//* The class value for index registers, and the one for base regs.  */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS ADDR_REGS/* Get reg_class from a letter such as appears in the machine description.   We do a trick here to modify the effective constraints on the   machine description; we zorch the constraint letters that aren't   appropriate for a specific target.  This allows us to guarantee   that a specific kind of register will not be used for a given target   without fiddling with the register classes above. */#ifndef SUPPORT_SUN_FPA#define REG_CLASS_FROM_LETTER(C) \  ((C) == 'a' ? ADDR_REGS :			\   ((C) == 'd' ? DATA_REGS :			\    ((C) == 'f' ? (TARGET_68881 ? FP_REGS :	\		   NO_REGS) :			\     NO_REGS)))#else /* defined SUPPORT_SUN_FPA */#define REG_CLASS_FROM_LETTER(C) \  ((C) == 'a' ? ADDR_REGS :			\   ((C) == 'd' ? DATA_REGS :			\    ((C) == 'f' ? (TARGET_68881 ? FP_REGS :	\		   NO_REGS) :			\     ((C) == 'x' ? (TARGET_FPA ? FPA_REGS :	\		    NO_REGS) :			\      ((C) == 'y' ? (TARGET_FPA ? LO_FPA_REGS :	\		     NO_REGS) :			\       NO_REGS)))))#endif /* defined SUPPORT_SUN_FPA *//* The letters I, J, K, L and M in a register constraint string   can be used to stand for particular ranges of immediate operands.   This macro defines what the ranges are.   C is the letter, and VALUE is a constant value.   Return 1 if VALUE is in the range specified by C.   For the 68000, `I' is used for the range 1 to 8   allowed as immediate shift counts and in addq.   `J' is used for the range of signed numbers that fit in 16 bits.   `K' is for numbers that moveq can't handle.   `L' is for range -8 to -1, range of values that can be added with subq.  */#define CONST_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 8 :    \   (C) == 'J' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF :	\   (C) == 'K' ? (VALUE) < -0x80 || (VALUE) >= 0x80 :	\   (C) == 'L' ? (VALUE) < 0 && (VALUE) >= -8 : 0)/* * A small bit of explanation: * "G" defines all of the floating constants that are *NOT* 68881 * constants.  this is so 68881 constants get reloaded and the * fpmovecr is used.  "H" defines *only* the class of constants that * the fpa can use, because these can be gotten at in any fpa * instruction and there is no need to force reloads. */#ifndef SUPPORT_SUN_FPA#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : 0 )#else /* defined SUPPORT_SUN_FPA */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : \   (C) == 'H' ? (TARGET_FPA && standard_sun_fpa_constant_p (VALUE)) : 0)#endif /* defined SUPPORT_SUN_FPA *//* Given an rtx X being reloaded into a reg required to be   in class CLASS, return the class of reg to actually use.   In general this is just CLASS; but on some machines   in some cases it is preferable to use a more restrictive class.   On the 68000 series, use a data reg if possible when the   value is a constant in the range where moveq could be used   and we ensure that QImodes are reloaded into data regs.   Also, if a floating constant needs reloading, put it in memory   if possible.  */#define PREFERRED_RELOAD_CLASS(X,CLASS)  \  ((GET_CODE (X) == CONST_INT			\    && (unsigned) (INTVAL (X) + 0x80) < 0x100	\    && (CLASS) != ADDR_REGS)			\   ? DATA_REGS					\   : (GET_MODE (X) == QImode && (CLASS) != ADDR_REGS) \   ? DATA_REGS					\   : (GET_CODE (X) == CONST_DOUBLE		\      && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \   ? NO_REGS					\   : (CLASS))/* Return the maximum number of consecutive registers   needed to represent mode MODE in a register of class CLASS.  *//* On the 68000, this is the size of MODE in words,   except in the FP regs, where a single reg is always enough.  */#ifndef SUPPORT_SUN_FPA#define CLASS_MAX_NREGS(CLASS, MODE)	\ ((CLASS) == FP_REGS ? 1 \  : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* Moves between fp regs and other regs are two insns.  */#define REGISTER_MOVE_COST(CLASS1, CLASS2)		\  (((CLASS1) == FP_REGS && (CLASS2) != FP_REGS)	        \    || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS)	\    ? 4 : 2)#else /* defined SUPPORT_SUN_FPA */#define CLASS_MAX_NREGS(CLASS, MODE)	\ ((CLASS) == FP_REGS || (CLASS) == FPA_REGS || (CLASS) == LO_FPA_REGS ? 1 \  : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* Moves between fp regs and other regs are two insns.  *//* Likewise for high fpa regs and other regs.  */#define REGISTER_MOVE_COST(CLASS1, CLASS2)		\  ((((CLASS1) == FP_REGS && (CLASS2) != FP_REGS)	\    || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS)	\    || ((CLASS1) == FPA_REGS && (CLASS2) != FPA_REGS)	\

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -