📄 avr.h
字号:
/* A C expression to create an RTX representing the place where a function returns a value of data type VALTYPE. VALTYPE is a tree node representing a data type. Write `TYPE_MODE (VALTYPE)' to get the machine mode used to represent that type. On many machines, only the mode is relevant. (Actually, on most machines, scalar values are returned in the same place regardless of mode). The value of the expression is usually a `reg' RTX for the hard register where the return value is stored. The value can also be a `parallel' RTX, if the return value is in multiple places. See `FUNCTION_ARG' for an explanation of the `parallel' form. If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type. If the precise function being called is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it possible to use a different value-returning convention for specific functions when all their calls are known. `FUNCTION_VALUE' is not used for return vales with aggregate data types, because these are returned in another way. See `STRUCT_VALUE_REGNUM' and related macros, below. */#define LIBCALL_VALUE(MODE) avr_libcall_value (MODE)/* A C expression to create an RTX representing the place where a library function returns a value of mode MODE. If the precise function being called is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it possible to use a different value-returning convention for specific functions when all their calls are known. Note that "library function" in this context means a compiler support routine, used to perform arithmetic, whose name is known specially by the compiler and was not mentioned in the C code being compiled. The definition of `LIBRARY_VALUE' need not be concerned aggregate data types, because none of the library functions returns such types. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER)/* A C expression that is nonzero if REGNO is the number of a hard register in which the values of called function may come back. A register whose use for returning values is limited to serving as the second of a pair (for a value of type `double', say) need not be recognized by this macro. So for most machines, this definition suffices: #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) If the machine has register windows, so that the caller and the called function use different registers for the return value, this macro should recognize only the caller's register numbers. */#define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \ ? int_size_in_bytes (TYPE) > 8 \ : 0)/* A C expression which can inhibit the returning of certain function values in registers, based on the type of value. A nonzero value says to return the function value in memory, just as large structures are always returned. Here TYPE will be a C expression of type `tree', representing the data type of the value. Note that values of mode `BLKmode' must be explicitly handled by this macro. Also, the option `-fpcc-struct-return' takes effect regardless of this macro. On most systems, it is possible to leave the macro undefined; this causes a default definition to be used, whose value is the constant 1 for `BLKmode' values, and 0 otherwise. Do not use this macro to indicate that structures and unions should always be returned in memory. You should instead use `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */#define DEFAULT_PCC_STRUCT_RETURN 0/* Define this macro to be 1 if all structure and union return values must be in memory. Since this results in slower code, this should be defined only if needed for compatibility with other compilers or with an ABI. If you define this macro to be 0, then the conventions used for structure and union return values are decided by the `RETURN_IN_MEMORY' macro. If not defined, this defaults to the value 1. */#define STRUCT_VALUE 0/* If the structure value address is not passed in a register, define `STRUCT_VALUE' as an expression returning an RTX for the place where the address is passed. If it returns 0, the address is passed as an "invisible" first argument. */#define STRUCT_VALUE_INCOMING 0/* If the incoming location is not a register, then you should define `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the called function should find the value. If it should find the value on the stack, define this to create a `mem' which refers to the frame pointer. A definition of 0 means that the address is passed as an "invisible" first argument. */#define EPILOGUE_USES(REGNO) 0/* Define this macro as a C expression that is nonzero for registers are used by the epilogue or the `return' pattern. The stack and frame pointer registers are already be assumed to be used as needed. */#define STRICT_ARGUMENT_NAMING 1/* Define this macro if the location where a function argument is passed depends on whether or not it is a named argument. This macro controls how the NAMED argument to `FUNCTION_ARG' is set for varargs and stdarg functions. With this macro defined, the NAMED argument is always true for named arguments, and false for unnamed arguments. If this is not defined, but `SETUP_INCOMING_VARARGS' is defined, then all arguments are treated as named. Otherwise, all named arguments except the last are treated as named. */#define HAVE_POST_INCREMENT 1/* Define this macro if the machine supports post-increment addressing. */#define HAVE_PRE_DECREMENT 1/* #define HAVE_PRE_INCREMENT #define HAVE_POST_DECREMENT *//* Similar for other kinds of addressing. */#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)/* A C expression that is 1 if the RTX X is a constant which is a valid address. On most machines, this can be defined as `CONSTANT_P (X)', but a few machines are more restrictive in which constant addresses are supported. `CONSTANT_P' accepts integer-values expressions whose values are not explicitly known, such as `symbol_ref', `label_ref', and `high' expressions and `const' arithmetic expressions, in addition to `const_int' and `const_double' expressions. */#define MAX_REGS_PER_ADDRESS 1/* A number, the maximum number of registers that can appear in a valid memory address. Note that it is up to you to specify a value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept. */#ifdef REG_OK_STRICT# define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \{ \ if (legitimate_address_p (mode, operand, 1)) \ goto ADDR; \}# else# define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \{ \ if (legitimate_address_p (mode, operand, 0)) \ goto ADDR; \}#endif/* A C compound statement with a conditional `goto LABEL;' executed if X (an RTX) is a legitimate memory address on the target machine for a memory operand of mode MODE. It usually pays to define several simpler macros to serve as subroutines for this one. Otherwise it may be too complicated to understand. This macro must exist in two variants: a strict variant and a non-strict one. The strict variant is used in the reload pass. It must be defined so that any pseudo-register that has not been allocated a hard register is considered a memory reference. In contexts where some kind of register is required, a pseudo-register with no hard register must be rejected. The non-strict variant is used in other passes. It must be defined to accept all pseudo-registers in every context where some kind of register is required. Compiler source files that want to use the strict variant of this macro define the macro `REG_OK_STRICT'. You should use an `#ifdef REG_OK_STRICT' conditional to define the strict variant in that case and the non-strict variant otherwise. Subroutines to check for acceptable registers for various purposes (one for base registers, one for index registers, and so on) are typically among the subroutines used to define `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros need have two variants; the higher levels of macros may be the same whether strict or not. Normally, constant addresses which are the sum of a `symbol_ref' and an integer are stored inside a `const' RTX to mark them as constant. Therefore, there is no need to recognize such sums specifically as legitimate addresses. Normally you would simply recognize any `const' as legitimate. Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant sums that are not marked with `const'. It assumes that a naked `plus' indicates indexing. If so, then you *must* reject such naked constant sums as illegitimate addresses, so that none of them will be given to `PRINT_OPERAND_ADDRESS'. On some machines, whether a symbolic address is legitimate depends on the section that the address refers to. On these machines, define the macro `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and then check for it here. When you see a `const', you will have to look inside it to find the `symbol_ref' in order to determine the section. *Note Assembler Format::. The best way to modify the name string is by adding text to the beginning, with suitable punctuation to prevent any ambiguity. Allocate the new name in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to remove and decode the added text and output the name accordingly, and define `STRIP_NAME_ENCODING' to access the original name string. You can check the information stored here into the `symbol_ref' in the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and `PRINT_OPERAND_ADDRESS'. *//* `REG_OK_FOR_BASE_P (X)' A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for use as a base register. For hard registers, it should always accept those which the hardware permits and reject the others. Whether the macro accepts or rejects pseudo registers must be controlled by `REG_OK_STRICT' as described above. This usually requires two variant definitions, of which `REG_OK_STRICT' controls the one actually used. */#define REG_OK_FOR_BASE_NOSTRICT_P(X) \ (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))#define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))#ifdef REG_OK_STRICT# define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)#else# define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)#endif/* A C expression that is just like `REG_OK_FOR_BASE_P', except that that expression may examine the mode of the memory reference in MODE. You should define this macro if the mode of the memory reference affects whether a register may be used as a base register. If you define this macro, the compiler will use it instead of `REG_OK_FOR_BASE_P'. */#define REG_OK_FOR_INDEX_P(X) 0/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for use as an index register. The difference between an index register and a base register is that the index register may be scaled. If an address involves the sum of two registers, neither one of them scaled, then either one may be labeled the "base" and the other the "index"; but whichever labeling is used must fit the machine's constraints of which registers may serve in each capacity. The compiler will try both labelings, looking for one that is valid, and will reload one or both registers only if neither labeling works. */#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \{ \ (X) = legitimize_address (X, OLDX, MODE); \ if (memory_address_p (MODE, X)) \ goto WIN; \}/* A C compound statement that attempts to replace X with a valid memory address for an operand of mode MODE. WIN will be a C statement label elsewhere in the code; the macro definition may use GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); to avoid further processing if the address has become legitimate. X will always be the result of a call to `break_out_memory_refs', and OLDX will be the operand that was given to that function to produce X. The code generated by this macro should not alter the substructure of X. If it transforms X into a more legitimate form, it should assign X (which will always be a C variable) a new value. It is not necessary for this macro to come up with a legitimate address. The compiler has standard ways of doing so in all cases. In fact, it is safe for this macro to do nothing. But often a machine-dependent strategy can generate better code. */#define XEXP_(X,Y) (X)#define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \do { \ if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)) \ { \ push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0), \ POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0, \ OPNUM, RELOAD_OTHER)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -