📄 i386.h
字号:
Each subgrouping contains a string constant, that defines the specification name, and a string constant that used by the GNU CC driver program. Do not define this macro if it does not need to do anything. */#ifndef SUBTARGET_EXTRA_SPECS#define SUBTARGET_EXTRA_SPECS#endif#define EXTRA_SPECS \ { "cpp_cpu", CPP_CPU_SPEC }, \ { "cc1_cpu", CC1_CPU_SPEC }, \ SUBTARGET_EXTRA_SPECS/* target machine storage layout *//* Define for XFmode extended real floating point support. This will automatically cause REAL_ARITHMETIC to be defined. */#define LONG_DOUBLE_TYPE_SIZE 96/* Define if you don't want extended real, but do want to use the software floating point emulator for REAL_ARITHMETIC and decimal <-> binary conversion. *//* #define REAL_ARITHMETIC *//* Define this if most significant byte of a word is the lowest numbered. *//* That is true on the 80386. */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. *//* That is not true on the 80386. */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is the lowest numbered. *//* Not true for 80386 */#define WORDS_BIG_ENDIAN 0/* number of bits in an addressable storage unit */#define BITS_PER_UNIT 8/* Width in bits of a "word", which is the contents of a machine register. Note that this is not necessarily the width of data type `int'; if using 16-bit ints on a 80386, this would still be 32. But on a machine with 16-bit registers, this would be 16. */#define BITS_PER_WORD 32/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 4/* Width in bits of a pointer. See also the macro `Pmode' defined below. */#define POINTER_SIZE 32/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY 32/* Boundary (in *bits*) on which stack pointer should be aligned. */#define STACK_BOUNDARY 32/* Allocation boundary (in *bits*) for the code of a function. For i486, we get better performance by aligning to a cache line (i.e. 16 byte) boundary. */#define FUNCTION_BOUNDARY (1 << (i386_align_funcs + 3))/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 32/* Minimum size in bits of the largest boundary to which any and all fundamental data types supported by the hardware might need to be aligned. No data type wants to be aligned rounder than this. The i386 supports 64-bit floating point quantities, but these can be aligned on any 32-bit boundary. The published ABIs say that doubles should be aligned on word boundaries, but the Pentium gets better performance with them aligned on 64 bit boundaries. */#define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)/* align DFmode constants and nonaggregates */#define ALIGN_DFmode (!TARGET_386)/* Set this non-zero if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 0/* If bit field type is int, don't let it cross an int, and give entire struct the alignment of an int. *//* Required on the 386 since it doesn't have bitfield insns. */#define PCC_BITFIELD_TYPE_MATTERS 1/* An integer expression for the size in bits of the largest integer machine mode that should actually be used. All integer machine modes of this size or smaller can be used for structures and unions with the appropriate sizes. */#define MAX_FIXED_MODE_SIZE 32/* Maximum power of 2 that code can be aligned to. */#define MAX_CODE_ALIGN 6 /* 64 byte alignment *//* Align loop starts for optimal branching. */#define ASM_OUTPUT_LOOP_ALIGN(FILE) ASM_OUTPUT_ALIGN (FILE, i386_align_loops)/* This is how to align an instruction for optimal branching. On i486 we'll get better performance by aligning on a cache line (i.e. 16 byte) boundary. */#define ASM_OUTPUT_ALIGN_CODE(FILE) ASM_OUTPUT_ALIGN ((FILE), i386_align_jumps)/* Standard register usage. *//* This processor has special stack-like registers. See reg-stack.c for details. */#define STACK_REGS#define IS_STACK_MODE(mode) (mode==DFmode || mode==SFmode || mode==XFmode)/* 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. In the 80386 we give the 8 general purpose registers the numbers 0-7. We number the floating point registers 8-15. Note that registers 0-7 can be accessed as a short or int, while only 0-3 may be used with byte `mov' instructions. Reg 16 does not correspond to any hardware register, but instead appears in the RTL as an argument pointer prior to reload, and is eliminated during reloading in favor of either the stack or frame pointer. */#define FIRST_PSEUDO_REGISTER 17/* 1 for registers that have pervasive standard uses and are not available for the register allocator. On the 80386, the stack pointer is such, as is the arg pointer. */#define FIXED_REGISTERS \/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \{ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 }/* 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 \/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \{ 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }/* Order in which to allocate registers. Each register must be listed once, even those in FIXED_REGISTERS. List frame pointer late and fixed registers last. Note that, in general, we prefer registers listed in CALL_USED_REGISTERS, keeping the others available for storage of persistent values. Three different versions of REG_ALLOC_ORDER have been tried: If the order is edx, ecx, eax, ... it produces a slightly faster compiler, but slower code on simple functions returning values in eax. If the order is eax, ecx, edx, ... it causes reload to abort when compiling perl 4.036 due to not being able to create a DImode register (to hold a 2 word union). If the order is eax, edx, ecx, ... it produces better code for simple functions, and a slightly slower compiler. Users complained about the code generated by allocating edx first, so restore the 'natural' order of things. */#define REG_ALLOC_ORDER \/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }/* 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 ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()/* Macro to conditionally modify fixed_regs/call_used_regs. */#define CONDITIONAL_REGISTER_USAGE \ { \ if (flag_pic) \ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } \ if (! TARGET_80387 && ! TARGET_FLOAT_RETURNS_IN_80387) \ { \ int i; \ HARD_REG_SET x; \ COPY_HARD_REG_SET (x, reg_class_contents[(int)FLOAT_REGS]); \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \ if (TEST_HARD_REG_BIT (x, 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. Actually there are no two word move instructions for consecutive registers. And only registers 0-3 may have mov byte instructions applied to them. */#define HARD_REGNO_NREGS(REGNO, MODE) \ (FP_REGNO_P (REGNO) ? 1 \ : ((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. On the 80386, the first 4 cpu registers can hold any mode while the floating point registers may hold only floating point. Make it clear that the fp regs could not hold a 16-byte float. *//* The casts to int placate a compiler on a microvax, for cross-compiler testing. */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ ((REGNO) < 2 ? 1 \ : (REGNO) < 4 ? 1 \ : FP_REGNO_P (REGNO) \ ? (((int) GET_MODE_CLASS (MODE) == (int) MODE_FLOAT \ || (int) GET_MODE_CLASS (MODE) == (int) MODE_COMPLEX_FLOAT) \ && GET_MODE_UNIT_SIZE (MODE) <= (LONG_DOUBLE_TYPE_SIZE == 96 ? 12 : 8))\ : (int) (MODE) != (int) QImode ? 1 \ : (reload_in_progress | reload_completed) == 1)/* 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) ((MODE1) == (MODE2))/* Specify the registers used for certain standard purposes. The values of these macros are register numbers. *//* on the 386 the pc register is %eip, and is not usable as a general register. The ordinary mov instructions won't work *//* #define PC_REGNUM *//* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM 7/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM 6/* First floating point reg */#define FIRST_FLOAT_REG 8/* First & last stack-like regs */#define FIRST_STACK_REG FIRST_FLOAT_REG#define LAST_STACK_REG (FIRST_FLOAT_REG + 7)/* 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 (TARGET_OMIT_LEAF_FRAME_POINTER && !leaf_function_p ()) /* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM 16/* Register in which static-chain is passed to a function. */#define STATIC_CHAIN_REGNUM 2/* Register to hold the addressing base for position independent code access to data items. */#define PIC_OFFSET_TABLE_REGNUM 3/* Register in which address to store a structure value arrives in the function. On the 386, the prologue copies this from the stack to register %eax. */#define STRUCT_VALUE_INCOMING 0/* Place in which caller passes the structure value address. 0 means push the value on the stack like an argument. */#define STRUCT_VALUE 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 RETURN_IN_MEMORY(TYPE) \ ((TYPE_MODE (TYPE) == BLKmode) || int_size_in_bytes (TYPE) > 12)/* 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. It might seem that class BREG is unnecessary, since no useful 386 opcode needs reg %ebx. But some systems pass args to the OS in ebx, and the "b" register constraint is useful in asms for syscalls. */enum reg_class{ NO_REGS, AREG, DREG, CREG, BREG,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -