📄 m68k.h
字号:
#define PIC_OFFSET_TABLE_REGNUM 13#ifndef SUPPORT_SUN_FPA/* 1 for registers that have pervasive standard uses and are not available for the register allocator. On the 68000, only the stack pointer is such. */#define FIXED_REGISTERS \ {/* Data registers. */ \ 0, 0, 0, 0, 0, 0, 0, 0, \ \ /* Address registers. */ \ 0, 0, 0, 0, 0, 0, 0, 1, \ \ /* Floating point registers \ (if available). */ \ 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, 0, 0, 0, 0, \ 1, 1, 0, 0, 0, 0, 0, 1, \ 1, 1, 0, 0, 0, 0, 0, 0 }#else /* SUPPORT_SUN_FPA *//* 1 for registers that have pervasive standard uses and are not available for the register allocator. On the 68000, only the stack pointer is such. *//* fpa0 is also reserved so that it can be used to move data back and forth between high fpa regs and everything else. */#define FIXED_REGISTERS \ {/* Data registers. */ \ 0, 0, 0, 0, 0, 0, 0, 0, \ \ /* Address registers. */ \ 0, 0, 0, 0, 0, 0, 0, 1, \ \ /* Floating point registers \ (if available). */ \ 0, 0, 0, 0, 0, 0, 0, 0, \ \ /* Sun3 FPA registers. */ \ 1, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ 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, 0, 0, 0, 0, \ 1, 1, 0, 0, 0, 0, 0, 1, \ 1, 1, 0, 0, 0, 0, 0, 0, \ /* FPA registers. */ \ 1, 1, 1, 1, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0 }#endif /* defined SUPPORT_SUN_FPA *//* Make sure everything's fine if we *don't* have a given processor. This assumes that putting a register in fixed_regs will keep the compiler's mitts completely off it. We don't bother to zero it out of register classes. If neither TARGET_FPA or TARGET_68881 is set, the compiler won't touch since no instructions that use these registers will be valid. */#ifdef SUPPORT_SUN_FPA#define CONDITIONAL_REGISTER_USAGE \{ \ int i; \ HARD_REG_SET x; \ if (!TARGET_FPA) \ { \ COPY_HARD_REG_SET (x, reg_class_contents[(int)FPA_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 (TARGET_FPA) \ { \ 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] \ = call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;\}#else#define CONDITIONAL_REGISTER_USAGE \{ \ if (flag_pic) \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] \ = call_used_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) < 8 && (REGNO) + GET_MODE_SIZE (MODE) / 4 > 8)) \ || ((REGNO) >= 16 && (REGNO) < 24 \ && TARGET_68881 \ && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ && GET_MODE_UNIT_SIZE (MODE) <= 12))#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. *//* ??? This is confused. The check to prohibit d7/a0 overlaps should always be enabled regardless of whether TARGET_FPA is specified. It isn't clear what the other d/a register checks are for. Every check using REGNO actually needs to use a range, e.g. 24>=X<56 not <56. There is probably no one using this code anymore. */#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) \ && GET_MODE_UNIT_SIZE (MODE) <= 12) \ : ((REGNO) < 56 ? TARGET_FPA && GET_MODE_UNIT_SIZE (MODE) <= 8 : 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -