📄 avr.h
字号:
1,1 /* arg pointer */ }/* 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 CALL_USED_REGISTERS { \ 1,1,/* r0 r1 */ \ 0,0,/* r2 r3 */ \ 0,0,/* r4 r5 */ \ 0,0,/* r6 r7 */ \ 0,0,/* r8 r9 */ \ 0,0,/* r10 r11 */ \ 0,0,/* r12 r13 */ \ 0,0,/* r14 r15 */ \ 0,0,/* r16 r17 */ \ 1,1,/* r18 r19 */ \ 1,1,/* r20 r21 */ \ 1,1,/* r22 r23 */ \ 1,1,/* r24 r25 */ \ 1,1,/* r26 r27 */ \ 0,0,/* r28 r29 */ \ 1,1,/* r30 r31 */ \ 1,1,/* STACK */ \ 1,1 /* arg pointer */ }/* 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 NON_SAVING_SETJMP 0/* If this macro is defined and has a nonzero value, it means that `setjmp' and related functions fail to save the registers, or that `longjmp' fails to restore them. To compensate, the compiler avoids putting variables in registers in functions that use `setjmp'. */#define REG_ALLOC_ORDER { \ 24,25, \ 18,19, \ 20,21, \ 22,23, \ 30,31, \ 26,27, \ 28,29, \ 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, \ 0,1, \ 32,33,34,35 \ }/* If defined, an initializer for a vector of integers, containing the numbers of hard registers in the order in which GNU CC should prefer to use them (from most preferred to least). If this macro is not defined, registers are used lowest numbered first (all else being equal). One use of this macro is on machines where the highest numbered registers must always be saved and the save-multiple-registers instruction supports only sequences of consetionve registers. On such machines, define `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered allocatable register first. */#define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()/* ORDER_REGS_FOR_LOCAL_ALLOC' A C statement (sans semicolon) to choose the order in which to allocate hard registers for pseudo-registers local to a basic block. Store the desired register order in the array `reg_alloc_order'. Element 0 should be the register to allocate first; element 1, the next register; and so on. The macro body should not assume anything about the contents of `reg_alloc_order' before execution of the macro. On most machines, it is not necessary to define this macro. */#define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* A C expression for the number of consecutive hard registers, starting at register number REGNO, required to hold a value of mode MODE. On a machine where all registers are exactly one word, a suitable definition of this macro is #define HARD_REGNO_NREGS(REGNO, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \ / UNITS_PER_WORD)) */#define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)/* 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). For a machine where all registers are equivalent, a suitable definition is #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 It is not necessary for this macro to check for the numbers of fixed registers, because the allocation mechanism considers them to be always occupied. On some machines, double-precision values must be kept in even/odd register pairs. The way to implement that is to define this macro to reject odd register numbers for such modes. The minimum requirement for a mode to be OK in a register is that the `movMODE' instruction pattern support moves between the register and any other hard register for which the mode is OK; and that moving a value into the register and back out not alter it. Since the same instruction used to move `SImode' will work for all narrower integer modes, it is not necessary on any machine for `HARD_REGNO_MODE_OK' to distinguish between these modes, provided you define patterns `movhi', etc., to take advantage of this. This is useful because of the interaction between `HARD_REGNO_MODE_OK' and `MODES_TIEABLE_P'; it is very desirable for all integer modes to be tieable. Many machines have special registers for floating point arithmetic. Often people assume that floating point machine modes are allowed only in floating point registers. This is not true. Any registers that can hold integers can safely *hold* a floating point machine mode, whether or not floating arithmetic can be done on it in those registers. Integer move instructions can be used to move the values. On some machines, though, the converse is true: fixed-point machine modes may not go in floating registers. This is true if the floating registers normalize any value stored in them, because storing a non-floating value there would garble it. In this case, `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in floating registers. But if the floating registers do not automatically normalize, if you can store any bit pattern in one and retrieve it unchanged without a trap, then any machine mode may go in a floating register, so you can define this macro to say so. The primary significance of special floating registers is rather that they are the registers acceptable in floating point arithmetic instructions. However, this is of no concern to `HARD_REGNO_MODE_OK'. You handle it by writing the proper constraints for those instructions. On some machines, the floating registers are especially slow to access, so that it is better to store a value in a stack frame than in such a register if floating point arithmetic is not being done. As long as the floating registers are not in class `GENERAL_REGS', they will not be used unless some pattern's constraint asks for one. */#define MODES_TIEABLE_P(MODE1, MODE2) 0/* 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. */enum reg_class { NO_REGS, R0_REG, /* r0 */ POINTER_X_REGS, /* r26 - r27 */ POINTER_Y_REGS, /* r28 - r29 */ POINTER_Z_REGS, /* r30 - r31 */ STACK_REG, /* STACK */ BASE_POINTER_REGS, /* r28 - r31 */ POINTER_REGS, /* r26 - r31 */ ADDW_REGS, /* r24 - r31 */ SIMPLE_LD_REGS, /* r16 - r23 */ LD_REGS, /* r16 - r31 */ NO_LD_REGS, /* r0 - r15 */ GENERAL_REGS, /* r0 - r31 */ ALL_REGS, LIM_REG_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. */#define N_REG_CLASSES (int)LIM_REG_CLASSES/* The number of distinct register classes, defined as follows: #define N_REG_CLASSES (int) LIM_REG_CLASSES */#define REG_CLASS_NAMES { \ "NO_REGS", \ "R0_REG", /* r0 */ \ "POINTER_X_REGS", /* r26 - r27 */ \ "POINTER_Y_REGS", /* r28 - r29 */ \ "POINTER_Z_REGS", /* r30 - r31 */ \ "STACK_REG", /* STACK */ \ "BASE_POINTER_REGS", /* r28 - r31 */ \ "POINTER_REGS", /* r26 - r31 */ \ "ADDW_REGS", /* r24 - r31 */ \ "SIMPLE_LD_REGS", /* r16 - r23 */ \ "LD_REGS", /* r16 - r31 */ \ "NO_LD_REGS", /* r0 - r15 */ \ "GENERAL_REGS", /* r0 - r31 */ \ "ALL_REGS" }/* 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_X 26#define REG_Y 28#define REG_Z 30#define REG_W 24#define REG_CLASS_CONTENTS { \ {0x00000000,0x00000000}, /* NO_REGS */ \ {0x00000001,0x00000000}, /* R0_REG */ \ {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \ {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \ {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \ {0x00000000,0x00000003}, /* STACK_REG, STACK */ \ {(3 << REG_Y) | (3 << REG_Z), \ 0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \ {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \ 0x00000000}, /* POINTER_REGS, r26 - r31 */ \ {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \ 0x00000000}, /* ADDW_REGS, r24 - r31 */ \ {0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \ {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \ 0x00000000}, /* LD_REGS, r16 - r31 */ \ {0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \ {0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \ {0xffffffff,0x00000003} /* 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 REGNO_REG_CLASS(R) avr_regno_reg_class(R)/* A C expression whose value is a register class containing hard register REGNO. In general there is more than one such class; choose a class which is "minimal", meaning that no smaller class also contains the register. */#define BASE_REG_CLASS POINTER_REGS/* A macro whose definition is the name of the class to which a valid base register must belong. A base register is one used in an address which is the register value plus a displacement. */#define INDEX_REG_CLASS NO_REGS/* A macro whose definition is the name of the class to which a valid index register must belong. An index register is one used in an address where its value is either multiplied by a scale factor or added to another register (as well as added to a displacement). */#define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C)/* A C expression which defines the machine-dependent operand constraint letters for register classes. If CHAR is such a letter, the value should be the register class corresponding to it. Otherwise, the value should be `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS', will not be passed to this macro; you do not need to handle it. */#define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER \ && ((r) == REG_X \ || (r) == REG_Y \ || (r) == REG_Z \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -