mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 06:14:18 +00:00
42 lines
1.6 KiB
Plaintext
42 lines
1.6 KiB
Plaintext
|
|
This file contains the relevant part of config/i386/i386.h from the
|
|
GNU C source code which describes how each register is used.
|
|
|
|
/* 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 }
|
|
|
|
/* 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; \
|
|
} \
|
|
}
|
|
|