i386.h revision 18334
118334Speter/* Definitions of target machine for GNU compiler for Intel X86
218334Speter   (386, 486, Pentium).
318334Speter   Copyright (C) 1988, 1992, 1994, 1995 Free Software Foundation, Inc.
418334Speter
518334SpeterThis file is part of GNU CC.
618334Speter
718334SpeterGNU CC is free software; you can redistribute it and/or modify
818334Speterit under the terms of the GNU General Public License as published by
918334Speterthe Free Software Foundation; either version 2, or (at your option)
1018334Speterany later version.
1118334Speter
1218334SpeterGNU CC is distributed in the hope that it will be useful,
1318334Speterbut WITHOUT ANY WARRANTY; without even the implied warranty of
1418334SpeterMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1518334SpeterGNU General Public License for more details.
1618334Speter
1718334SpeterYou should have received a copy of the GNU General Public License
1818334Speteralong with GNU CC; see the file COPYING.  If not, write to
1918334Speterthe Free Software Foundation, 59 Temple Place - Suite 330,
2018334SpeterBoston, MA 02111-1307, USA.  */
2118334Speter
2218334Speter
2318334Speter/* The purpose of this file is to define the characteristics of the i386,
2418334Speter   independent of assembler syntax or operating system.
2518334Speter
2618334Speter   Three other files build on this one to describe a specific assembler syntax:
2718334Speter   bsd386.h, att386.h, and sun386.h.
2818334Speter
2918334Speter   The actual tm.h file for a particular system should include
3018334Speter   this file, and then the file for the appropriate assembler syntax.
3118334Speter
3218334Speter   Many macros that specify assembler syntax are omitted entirely from
3318334Speter   this file because they really belong in the files for particular
3418334Speter   assemblers.  These include AS1, AS2, AS3, RP, IP, LPREFIX, L_SIZE,
3518334Speter   PUT_OP_SIZE, USE_STAR, ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE,
3618334Speter   PRINT_B_I_S, and many that start with ASM_ or end in ASM_OP.  */
3718334Speter
3818334Speter/* Names to predefine in the preprocessor for this target machine.  */
3918334Speter
4018334Speter#define I386 1
4118334Speter
4218334Speter/* Stubs for half-pic support if not OSF/1 reference platform.  */
4318334Speter
4418334Speter#ifndef HALF_PIC_P
4518334Speter#define HALF_PIC_P() 0
4618334Speter#define HALF_PIC_NUMBER_PTRS 0
4718334Speter#define HALF_PIC_NUMBER_REFS 0
4818334Speter#define HALF_PIC_ENCODE(DECL)
4918334Speter#define HALF_PIC_DECLARE(NAME)
5018334Speter#define HALF_PIC_INIT()	error ("half-pic init called on systems that don't support it.")
5118334Speter#define HALF_PIC_ADDRESS_P(X) 0
5218334Speter#define HALF_PIC_PTR(X) X
5318334Speter#define HALF_PIC_FINISH(STREAM)
5418334Speter#endif
5518334Speter
5618334Speter/* Run-time compilation parameters selecting different hardware subsets.  */
5718334Speter
5818334Speterextern int target_flags;
5918334Speter
6018334Speter/* Macros used in the machine description to test the flags.  */
6118334Speter
6218334Speter/* configure can arrange to make this 2, to force a 486.  */
6318334Speter#ifndef TARGET_CPU_DEFAULT
6418334Speter#define TARGET_CPU_DEFAULT 0
6518334Speter#endif
6618334Speter
6718334Speter/* Masks for the -m switches */
6818334Speter#define MASK_80387		000000000001	/* Hardware floating point */
6918334Speter#define MASK_486		000000000002	/* 80486 specific */
7018334Speter#define MASK_NOTUSED1		000000000004	/* bit not currently used */
7118334Speter#define MASK_RTD		000000000010	/* Use ret that pops args */
7218334Speter#define MASK_ALIGN_DOUBLE	000000000020	/* align doubles to 2 word boundary */
7318334Speter#define MASK_SVR3_SHLIB		000000000040	/* Uninit locals into bss */
7418334Speter#define MASK_IEEE_FP		000000000100	/* IEEE fp comparisons */
7518334Speter#define MASK_FLOAT_RETURNS	000000000200	/* Return float in st(0) */
7618334Speter#define MASK_NO_FANCY_MATH_387	000000000400	/* Disable sin, cos, sqrt */
7718334Speter
7818334Speter						/* Temporary codegen switches */
7918334Speter#define MASK_DEBUG_ADDR		000001000000	/* Debug GO_IF_LEGITIMATE_ADDRESS */
8018334Speter#define MASK_NO_WIDE_MULTIPLY	000002000000	/* Disable 32x32->64 multiplies */
8118334Speter#define MASK_NO_MOVE		000004000000	/* Don't generate mem->mem */
8218334Speter#define MASK_DEBUG_ARG		000010000000	/* Debug function_arg */
8318334Speter
8418334Speter/* Use the floating point instructions */
8518334Speter#define TARGET_80387 (target_flags & MASK_80387)
8618334Speter
8718334Speter/* Compile using ret insn that pops args.
8818334Speter   This will not work unless you use prototypes at least
8918334Speter   for all functions that can take varying numbers of args.  */
9018334Speter#define TARGET_RTD (target_flags & MASK_RTD)
9118334Speter
9218334Speter/* Align doubles to a two word boundary.  This breaks compatibility with
9318334Speter   the published ABI's for structures containing doubles, but produces
9418334Speter   faster code on the pentium.  */
9518334Speter#define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE)
9618334Speter
9718334Speter/* Put uninitialized locals into bss, not data.
9818334Speter   Meaningful only on svr3.  */
9918334Speter#define TARGET_SVR3_SHLIB (target_flags & MASK_SVR3_SHLIB)
10018334Speter
10118334Speter/* Use IEEE floating point comparisons.  These handle correctly the cases
10218334Speter   where the result of a comparison is unordered.  Normally SIGFPE is
10318334Speter   generated in such cases, in which case this isn't needed.  */
10418334Speter#define TARGET_IEEE_FP (target_flags & MASK_IEEE_FP)
10518334Speter
10618334Speter/* Functions that return a floating point value may return that value
10718334Speter   in the 387 FPU or in 386 integer registers.  If set, this flag causes
10818334Speter   the 387 to be used, which is compatible with most calling conventions. */
10918334Speter#define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & MASK_FLOAT_RETURNS)
11018334Speter
11118334Speter/* Disable generation of FP sin, cos and sqrt operations for 387.
11218334Speter   This is because FreeBSD lacks these in the math-emulator-code */
11318334Speter#define TARGET_NO_FANCY_MATH_387 (target_flags & MASK_NO_FANCY_MATH_387)
11418334Speter
11518334Speter/* Temporary switches for tuning code generation */
11618334Speter
11718334Speter/* Disable 32x32->64 bit multiplies that are used for long long multiplies
11818334Speter   and division by constants, but sometimes cause reload problems.  */
11918334Speter#define TARGET_NO_WIDE_MULTIPLY (target_flags & MASK_NO_WIDE_MULTIPLY)
12018334Speter#define TARGET_WIDE_MULTIPLY (!TARGET_NO_WIDE_MULTIPLY)
12118334Speter
12218334Speter/* Debug GO_IF_LEGITIMATE_ADDRESS */
12318334Speter#define TARGET_DEBUG_ADDR (target_flags & MASK_DEBUG_ADDR)
12418334Speter
12518334Speter/* Debug FUNCTION_ARG macros */
12618334Speter#define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG)
12718334Speter
12818334Speter/* Hack macros for tuning code generation */
12918334Speter#define TARGET_MOVE	((target_flags & MASK_NO_MOVE) == 0)	/* Don't generate memory->memory */
13018334Speter
13118334Speter/* Specific hardware switches */
13218334Speter#define TARGET_486	(target_flags & MASK_486)	/* 80486DX, 80486SX, 80486DX[24] */
13318334Speter#define TARGET_386	(!TARGET_486) 			/* 80386 */
13418334Speter
13518334Speter#define TARGET_SWITCHES							\
13618334Speter{ { "80387",			 MASK_80387 },				\
13718334Speter  { "no-80387",			-MASK_80387 },				\
13818334Speter  { "hard-float",		 MASK_80387 },				\
13918334Speter  { "soft-float",		-MASK_80387 },				\
14018334Speter  { "no-soft-float",		 MASK_80387 },				\
14118334Speter  { "386",			-MASK_486 },				\
14218334Speter  { "no-386",			 MASK_486 },				\
14318334Speter  { "486",			 MASK_486 },				\
14418334Speter  { "no-486",			-MASK_486 },				\
14518334Speter  { "rtd",			 MASK_RTD },				\
14618334Speter  { "no-rtd",			-MASK_RTD },				\
14718334Speter  { "align-double",		 MASK_ALIGN_DOUBLE },			\
14818334Speter  { "no-align-double",		-MASK_ALIGN_DOUBLE },			\
14918334Speter  { "svr3-shlib",		 MASK_SVR3_SHLIB },			\
15018334Speter  { "no-svr3-shlib",		-MASK_SVR3_SHLIB },			\
15118334Speter  { "ieee-fp",			 MASK_IEEE_FP },			\
15218334Speter  { "no-ieee-fp",		-MASK_IEEE_FP },			\
15318334Speter  { "fp-ret-in-387",		 MASK_FLOAT_RETURNS },			\
15418334Speter  { "no-fp-ret-in-387",		-MASK_FLOAT_RETURNS },			\
15518334Speter  { "no-fancy-math-387",	 MASK_NO_FANCY_MATH_387 },		\
15618334Speter  { "fancy-math-387",		-MASK_NO_FANCY_MATH_387 },		\
15718334Speter  { "no-wide-multiply",		 MASK_NO_WIDE_MULTIPLY },		\
15818334Speter  { "wide-multiply",		-MASK_NO_WIDE_MULTIPLY },		\
15918334Speter  { "debug-addr",		 MASK_DEBUG_ADDR },			\
16018334Speter  { "no-debug-addr",		-MASK_DEBUG_ADDR },			\
16118334Speter  { "move",			-MASK_NO_MOVE },			\
16218334Speter  { "no-move",			 MASK_NO_MOVE },			\
16318334Speter  { "debug-arg",		 MASK_DEBUG_ARG },			\
16418334Speter  { "no-debug-arg",		-MASK_DEBUG_ARG },			\
16518334Speter  SUBTARGET_SWITCHES							\
16618334Speter  { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT}}
16718334Speter
16818334Speter/* This macro is similar to `TARGET_SWITCHES' but defines names of
16918334Speter   command options that have values.  Its definition is an
17018334Speter   initializer with a subgrouping for each command option.
17118334Speter
17218334Speter   Each subgrouping contains a string constant, that defines the
17318334Speter   fixed part of the option name, and the address of a variable.  The
17418334Speter   variable, type `char *', is set to the variable part of the given
17518334Speter   option if the fixed part matches.  The actual option name is made
17618334Speter   by appending `-m' to the specified name.  */
17718334Speter#define TARGET_OPTIONS							\
17818334Speter{ { "reg-alloc=",	&i386_reg_alloc_order },			\
17918334Speter  { "regparm=",		&i386_regparm_string },				\
18018334Speter  { "align-loops=",	&i386_align_loops_string },			\
18118334Speter  { "align-jumps=",	&i386_align_jumps_string },			\
18218334Speter  { "align-functions=",	&i386_align_funcs_string },			\
18318334Speter  SUBTARGET_OPTIONS							\
18418334Speter}
18518334Speter
18618334Speter/* Sometimes certain combinations of command options do not make
18718334Speter   sense on a particular target machine.  You can define a macro
18818334Speter   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
18918334Speter   defined, is executed once just after all the command options have
19018334Speter   been parsed.
19118334Speter
19218334Speter   Don't use this macro to turn on various extra optimizations for
19318334Speter   `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */
19418334Speter
19518334Speter#define OVERRIDE_OPTIONS override_options ()
19618334Speter
19718334Speter/* These are meant to be redefined in the host dependent files */
19818334Speter#define SUBTARGET_SWITCHES
19918334Speter#define SUBTARGET_OPTIONS
20018334Speter
20118334Speter
20218334Speter/* target machine storage layout */
20318334Speter
20418334Speter/* Define for XFmode extended real floating point support.
20518334Speter   This will automatically cause REAL_ARITHMETIC to be defined.  */
20618334Speter#define LONG_DOUBLE_TYPE_SIZE 96
20718334Speter
20818334Speter/* Define if you don't want extended real, but do want to use the
20918334Speter   software floating point emulator for REAL_ARITHMETIC and
21018334Speter   decimal <-> binary conversion. */
21118334Speter/* #define REAL_ARITHMETIC */
21218334Speter
21318334Speter/* Define this if most significant byte of a word is the lowest numbered.  */
21418334Speter/* That is true on the 80386.  */
21518334Speter
21618334Speter#define BITS_BIG_ENDIAN 0
21718334Speter
21818334Speter/* Define this if most significant byte of a word is the lowest numbered.  */
21918334Speter/* That is not true on the 80386.  */
22018334Speter#define BYTES_BIG_ENDIAN 0
22118334Speter
22218334Speter/* Define this if most significant word of a multiword number is the lowest
22318334Speter   numbered.  */
22418334Speter/* Not true for 80386 */
22518334Speter#define WORDS_BIG_ENDIAN 0
22618334Speter
22718334Speter/* number of bits in an addressable storage unit */
22818334Speter#define BITS_PER_UNIT 8
22918334Speter
23018334Speter/* Width in bits of a "word", which is the contents of a machine register.
23118334Speter   Note that this is not necessarily the width of data type `int';
23218334Speter   if using 16-bit ints on a 80386, this would still be 32.
23318334Speter   But on a machine with 16-bit registers, this would be 16.  */
23418334Speter#define BITS_PER_WORD 32
23518334Speter
23618334Speter/* Width of a word, in units (bytes).  */
23718334Speter#define UNITS_PER_WORD 4
23818334Speter
23918334Speter/* Width in bits of a pointer.
24018334Speter   See also the macro `Pmode' defined below.  */
24118334Speter#define POINTER_SIZE 32
24218334Speter
24318334Speter/* Allocation boundary (in *bits*) for storing arguments in argument list.  */
24418334Speter#define PARM_BOUNDARY 32
24518334Speter
24618334Speter/* Boundary (in *bits*) on which stack pointer should be aligned.  */
24718334Speter#define STACK_BOUNDARY 32
24818334Speter
24918334Speter/* Allocation boundary (in *bits*) for the code of a function.
25018334Speter   For i486, we get better performance by aligning to a cache
25118334Speter   line (i.e. 16 byte) boundary.  */
25218334Speter#define FUNCTION_BOUNDARY (1 << (i386_align_funcs + 3))
25318334Speter
25418334Speter/* Alignment of field after `int : 0' in a structure. */
25518334Speter
25618334Speter#define EMPTY_FIELD_BOUNDARY 32
25718334Speter
25818334Speter/* Minimum size in bits of the largest boundary to which any
25918334Speter   and all fundamental data types supported by the hardware
26018334Speter   might need to be aligned. No data type wants to be aligned
26118334Speter   rounder than this.  The i386 supports 64-bit floating point
26218334Speter   quantities, but these can be aligned on any 32-bit boundary.
26318334Speter   The published ABIs say that doubles should be aligned on word
26418334Speter   boundaries, but the Pentium gets better performance with them
26518334Speter   aligned on 64 bit boundaries. */
26618334Speter#define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
26718334Speter
26818334Speter/* Set this non-zero if move instructions will actually fail to work
26918334Speter   when given unaligned data.  */
27018334Speter#define STRICT_ALIGNMENT 0
27118334Speter
27218334Speter/* If bit field type is int, don't let it cross an int,
27318334Speter   and give entire struct the alignment of an int.  */
27418334Speter/* Required on the 386 since it doesn't have bitfield insns.  */
27518334Speter#define PCC_BITFIELD_TYPE_MATTERS 1
27618334Speter
27718334Speter/* Maximum power of 2 that code can be aligned to.  */
27818334Speter#define MAX_CODE_ALIGN	6			/* 64 byte alignment */
27918334Speter
28018334Speter/* Align loop starts for optimal branching.  */
28118334Speter#define ASM_OUTPUT_LOOP_ALIGN(FILE) ASM_OUTPUT_ALIGN (FILE, i386_align_loops)
28218334Speter
28318334Speter/* This is how to align an instruction for optimal branching.
28418334Speter   On i486 we'll get better performance by aligning on a
28518334Speter   cache line (i.e. 16 byte) boundary.  */
28618334Speter#define ASM_OUTPUT_ALIGN_CODE(FILE) ASM_OUTPUT_ALIGN ((FILE), i386_align_jumps)
28718334Speter
28818334Speter
28918334Speter/* Standard register usage.  */
29018334Speter
29118334Speter/* This processor has special stack-like registers.  See reg-stack.c
29218334Speter   for details. */
29318334Speter
29418334Speter#define STACK_REGS
29518334Speter
29618334Speter/* Number of actual hardware registers.
29718334Speter   The hardware registers are assigned numbers for the compiler
29818334Speter   from 0 to just below FIRST_PSEUDO_REGISTER.
29918334Speter   All registers that the compiler knows about must be given numbers,
30018334Speter   even those that are not normally considered general registers.
30118334Speter
30218334Speter   In the 80386 we give the 8 general purpose registers the numbers 0-7.
30318334Speter   We number the floating point registers 8-15.
30418334Speter   Note that registers 0-7 can be accessed as a  short or int,
30518334Speter   while only 0-3 may be used with byte `mov' instructions.
30618334Speter
30718334Speter   Reg 16 does not correspond to any hardware register, but instead
30818334Speter   appears in the RTL as an argument pointer prior to reload, and is
30918334Speter   eliminated during reloading in favor of either the stack or frame
31018334Speter   pointer. */
31118334Speter
31218334Speter#define FIRST_PSEUDO_REGISTER 17
31318334Speter
31418334Speter/* 1 for registers that have pervasive standard uses
31518334Speter   and are not available for the register allocator.
31618334Speter   On the 80386, the stack pointer is such, as is the arg pointer. */
31718334Speter#define FIXED_REGISTERS \
31818334Speter/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/       \
31918334Speter{  0, 0, 0, 0, 0, 0, 0, 1, 0,  0,  0,  0,  0,  0,  0,  0,  1 }
32018334Speter
32118334Speter/* 1 for registers not available across function calls.
32218334Speter   These must include the FIXED_REGISTERS and also any
32318334Speter   registers that can be used without being saved.
32418334Speter   The latter must include the registers where values are returned
32518334Speter   and the register where structure-value addresses are passed.
32618334Speter   Aside from that, you can include as many other registers as you like.  */
32718334Speter
32818334Speter#define CALL_USED_REGISTERS \
32918334Speter/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
33018334Speter{  1, 1, 1, 0, 0, 0, 0, 1, 1,  1,  1,  1,  1,  1,  1,  1,  1 }
33118334Speter
33218334Speter/* Order in which to allocate registers.  Each register must be
33318334Speter   listed once, even those in FIXED_REGISTERS.  List frame pointer
33418334Speter   late and fixed registers last.  Note that, in general, we prefer
33518334Speter   registers listed in CALL_USED_REGISTERS, keeping the others
33618334Speter   available for storage of persistent values.
33718334Speter
33818334Speter   Three different versions of REG_ALLOC_ORDER have been tried:
33918334Speter
34018334Speter   If the order is edx, ecx, eax, ... it produces a slightly faster compiler,
34118334Speter   but slower code on simple functions returning values in eax.
34218334Speter
34318334Speter   If the order is eax, ecx, edx, ... it causes reload to abort when compiling
34418334Speter   perl 4.036 due to not being able to create a DImode register (to hold a 2
34518334Speter   word union).
34618334Speter
34718334Speter   If the order is eax, edx, ecx, ... it produces better code for simple
34818334Speter   functions, and a slightly slower compiler.  Users complained about the code
34918334Speter   generated by allocating edx first, so restore the 'natural' order of things. */
35018334Speter
35118334Speter#define REG_ALLOC_ORDER \
35218334Speter/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
35318334Speter{  0, 1, 2, 3, 4, 5, 6, 7, 8,  9, 10, 11, 12, 13, 14, 15, 16 }
35418334Speter
35518334Speter/* A C statement (sans semicolon) to choose the order in which to
35618334Speter   allocate hard registers for pseudo-registers local to a basic
35718334Speter   block.
35818334Speter
35918334Speter   Store the desired register order in the array `reg_alloc_order'.
36018334Speter   Element 0 should be the register to allocate first; element 1, the
36118334Speter   next register; and so on.
36218334Speter
36318334Speter   The macro body should not assume anything about the contents of
36418334Speter   `reg_alloc_order' before execution of the macro.
36518334Speter
36618334Speter   On most machines, it is not necessary to define this macro.  */
36718334Speter
36818334Speter#define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
36918334Speter
37018334Speter/* Macro to conditionally modify fixed_regs/call_used_regs.  */
37118334Speter#define CONDITIONAL_REGISTER_USAGE			\
37218334Speter  {							\
37318334Speter    if (flag_pic)					\
37418334Speter      {							\
37518334Speter	fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;	\
37618334Speter	call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;	\
37718334Speter      }							\
37818334Speter    if (! TARGET_80387 && ! TARGET_FLOAT_RETURNS_IN_80387) \
37918334Speter      { 						\
38018334Speter	int i; 						\
38118334Speter	HARD_REG_SET x;					\
38218334Speter        COPY_HARD_REG_SET (x, reg_class_contents[(int)FLOAT_REGS]); \
38318334Speter        for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ )	\
38418334Speter         if (TEST_HARD_REG_BIT (x, i)) 			\
38518334Speter	  fixed_regs[i] = call_used_regs[i] = 1; 	\
38618334Speter      }							\
38718334Speter  }
38818334Speter
38918334Speter/* Return number of consecutive hard regs needed starting at reg REGNO
39018334Speter   to hold something of mode MODE.
39118334Speter   This is ordinarily the length in words of a value of mode MODE
39218334Speter   but can be less for certain modes in special long registers.
39318334Speter
39418334Speter   Actually there are no two word move instructions for consecutive
39518334Speter   registers.  And only registers 0-3 may have mov byte instructions
39618334Speter   applied to them.
39718334Speter   */
39818334Speter
39918334Speter#define HARD_REGNO_NREGS(REGNO, MODE)   \
40018334Speter  (FP_REGNO_P (REGNO) ? 1 \
40118334Speter   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
40218334Speter
40318334Speter/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
40418334Speter   On the 80386, the first 4 cpu registers can hold any mode
40518334Speter   while the floating point registers may hold only floating point.
40618334Speter   Make it clear that the fp regs could not hold a 16-byte float.  */
40718334Speter
40818334Speter/* The casts to int placate a compiler on a microvax,
40918334Speter   for cross-compiler testing.  */
41018334Speter
41118334Speter#define HARD_REGNO_MODE_OK(REGNO, MODE) \
41218334Speter  ((REGNO) < 2 ? 1						\
41318334Speter   : (REGNO) < 4 ? 1						\
41418334Speter   : FP_REGNO_P (REGNO)						\
41518334Speter   ? (((int) GET_MODE_CLASS (MODE) == (int) MODE_FLOAT		\
41618334Speter       || (int) GET_MODE_CLASS (MODE) == (int) MODE_COMPLEX_FLOAT)	\
41718334Speter      && GET_MODE_UNIT_SIZE (MODE) <= 12)			\
41818334Speter   : (int) (MODE) != (int) QImode)
41918334Speter
42018334Speter/* Value is 1 if it is a good idea to tie two pseudo registers
42118334Speter   when one has mode MODE1 and one has mode MODE2.
42218334Speter   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
42318334Speter   for any hard reg, then this must be 0 for correct output.  */
42418334Speter
42518334Speter#define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) == (MODE2))
42618334Speter
42718334Speter/* A C expression returning the cost of moving data from a register of class
42818334Speter   CLASS1 to one of CLASS2.
42918334Speter
43018334Speter   On the i386, copying between floating-point and fixed-point
43118334Speter   registers is expensive.  */
43218334Speter
43318334Speter#define REGISTER_MOVE_COST(CLASS1, CLASS2)			\
43418334Speter  (((FLOAT_CLASS_P (CLASS1) && ! FLOAT_CLASS_P (CLASS2))		\
43518334Speter    || (! FLOAT_CLASS_P (CLASS1) && FLOAT_CLASS_P (CLASS2))) ? 10	\
43618334Speter   : 2)
43718334Speter
43818334Speter/* Specify the registers used for certain standard purposes.
43918334Speter   The values of these macros are register numbers.  */
44018334Speter
44118334Speter/* on the 386 the pc register is %eip, and is not usable as a general
44218334Speter   register.  The ordinary mov instructions won't work */
44318334Speter/* #define PC_REGNUM  */
44418334Speter
44518334Speter/* Register to use for pushing function arguments.  */
44618334Speter#define STACK_POINTER_REGNUM 7
44718334Speter
44818334Speter/* Base register for access to local variables of the function.  */
44918334Speter#define FRAME_POINTER_REGNUM 6
45018334Speter
45118334Speter/* First floating point reg */
45218334Speter#define FIRST_FLOAT_REG 8
45318334Speter
45418334Speter/* First & last stack-like regs */
45518334Speter#define FIRST_STACK_REG FIRST_FLOAT_REG
45618334Speter#define LAST_STACK_REG (FIRST_FLOAT_REG + 7)
45718334Speter
45818334Speter/* Value should be nonzero if functions must have frame pointers.
45918334Speter   Zero means the frame pointer need not be set up (and parms
46018334Speter   may be accessed via the stack pointer) in functions that seem suitable.
46118334Speter   This is computed in `reload', in reload1.c.  */
46218334Speter#define FRAME_POINTER_REQUIRED 0
46318334Speter
46418334Speter/* Base register for access to arguments of the function.  */
46518334Speter#define ARG_POINTER_REGNUM 16
46618334Speter
46718334Speter/* Register in which static-chain is passed to a function.  */
46818334Speter#define STATIC_CHAIN_REGNUM 2
46918334Speter
47018334Speter/* Register to hold the addressing base for position independent
47118334Speter   code access to data items.  */
47218334Speter#define PIC_OFFSET_TABLE_REGNUM 3
47318334Speter
47418334Speter/* Register in which address to store a structure value
47518334Speter   arrives in the function.  On the 386, the prologue
47618334Speter   copies this from the stack to register %eax.  */
47718334Speter#define STRUCT_VALUE_INCOMING 0
47818334Speter
47918334Speter/* Place in which caller passes the structure value address.
48018334Speter   0 means push the value on the stack like an argument.  */
48118334Speter#define STRUCT_VALUE 0
48218334Speter
48318334Speter/* A C expression which can inhibit the returning of certain function
48418334Speter   values in registers, based on the type of value.  A nonzero value
48518334Speter   says to return the function value in memory, just as large
48618334Speter   structures are always returned.  Here TYPE will be a C expression
48718334Speter   of type `tree', representing the data type of the value.
48818334Speter
48918334Speter   Note that values of mode `BLKmode' must be explicitly handled by
49018334Speter   this macro.  Also, the option `-fpcc-struct-return' takes effect
49118334Speter   regardless of this macro.  On most systems, it is possible to
49218334Speter   leave the macro undefined; this causes a default definition to be
49318334Speter   used, whose value is the constant 1 for `BLKmode' values, and 0
49418334Speter   otherwise.
49518334Speter
49618334Speter   Do not use this macro to indicate that structures and unions
49718334Speter   should always be returned in memory.  You should instead use
49818334Speter   `DEFAULT_PCC_STRUCT_RETURN' to indicate this.  */
49918334Speter
50018334Speter#define RETURN_IN_MEMORY(TYPE) \
50118334Speter  ((TYPE_MODE (TYPE) == BLKmode) || int_size_in_bytes (TYPE) > 12)
50218334Speter
50318334Speter
50418334Speter/* Define the classes of registers for register constraints in the
50518334Speter   machine description.  Also define ranges of constants.
50618334Speter
50718334Speter   One of the classes must always be named ALL_REGS and include all hard regs.
50818334Speter   If there is more than one class, another class must be named NO_REGS
50918334Speter   and contain no registers.
51018334Speter
51118334Speter   The name GENERAL_REGS must be the name of a class (or an alias for
51218334Speter   another name such as ALL_REGS).  This is the class of registers
51318334Speter   that is allowed by "g" or "r" in a register constraint.
51418334Speter   Also, registers outside this class are allocated only when
51518334Speter   instructions express preferences for them.
51618334Speter
51718334Speter   The classes must be numbered in nondecreasing order; that is,
51818334Speter   a larger-numbered class must never be contained completely
51918334Speter   in a smaller-numbered class.
52018334Speter
52118334Speter   For any two classes, it is very desirable that there be another
52218334Speter   class that represents their union.
52318334Speter
52418334Speter   It might seem that class BREG is unnecessary, since no useful 386
52518334Speter   opcode needs reg %ebx.  But some systems pass args to the OS in ebx,
52618334Speter   and the "b" register constraint is useful in asms for syscalls.  */
52718334Speter
52818334Speterenum reg_class
52918334Speter{
53018334Speter  NO_REGS,
53118334Speter  AREG, DREG, CREG, BREG,
53218334Speter  AD_REGS,			/* %eax/%edx for DImode */
53318334Speter  Q_REGS,			/* %eax %ebx %ecx %edx */
53418334Speter  SIREG, DIREG,
53518334Speter  INDEX_REGS,			/* %eax %ebx %ecx %edx %esi %edi %ebp */
53618334Speter  GENERAL_REGS,			/* %eax %ebx %ecx %edx %esi %edi %ebp %esp */
53718334Speter  FP_TOP_REG, FP_SECOND_REG,	/* %st(0) %st(1) */
53818334Speter  FLOAT_REGS,
53918334Speter  ALL_REGS, LIM_REG_CLASSES
54018334Speter};
54118334Speter
54218334Speter#define N_REG_CLASSES (int) LIM_REG_CLASSES
54318334Speter
54418334Speter#define FLOAT_CLASS_P(CLASS) (reg_class_subset_p (CLASS, FLOAT_REGS))
54518334Speter
54618334Speter/* Give names of register classes as strings for dump file.   */
54718334Speter
54818334Speter#define REG_CLASS_NAMES \
54918334Speter{  "NO_REGS",				\
55018334Speter   "AREG", "DREG", "CREG", "BREG",	\
55118334Speter   "AD_REGS",				\
55218334Speter   "Q_REGS",				\
55318334Speter   "SIREG", "DIREG",			\
55418334Speter   "INDEX_REGS",			\
55518334Speter   "GENERAL_REGS",			\
55618334Speter   "FP_TOP_REG", "FP_SECOND_REG",	\
55718334Speter   "FLOAT_REGS",			\
55818334Speter   "ALL_REGS" }
55918334Speter
56018334Speter/* Define which registers fit in which classes.
56118334Speter   This is an initializer for a vector of HARD_REG_SET
56218334Speter   of length N_REG_CLASSES.  */
56318334Speter
56418334Speter#define REG_CLASS_CONTENTS \
56518334Speter{      0,							\
56618334Speter     0x1,    0x2,  0x4,	 0x8,	/* AREG, DREG, CREG, BREG */	\
56718334Speter     0x3,			/* AD_REGS */			\
56818334Speter     0xf,			/* Q_REGS */			\
56918334Speter    0x10,   0x20,		/* SIREG, DIREG */		\
57018334Speter 0x07f,				/* INDEX_REGS */		\
57118334Speter 0x100ff,			/* GENERAL_REGS */		\
57218334Speter  0x0100, 0x0200,		/* FP_TOP_REG, FP_SECOND_REG */	\
57318334Speter  0xff00,			/* FLOAT_REGS */		\
57418334Speter 0x1ffff }
57518334Speter
57618334Speter/* The same information, inverted:
57718334Speter   Return the class number of the smallest class containing
57818334Speter   reg number REGNO.  This could be a conditional expression
57918334Speter   or could index an array.  */
58018334Speter
58118334Speter#define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])
58218334Speter
58318334Speter/* When defined, the compiler allows registers explicitly used in the
58418334Speter   rtl to be used as spill registers but prevents the compiler from
58518334Speter   extending the lifetime of these registers. */
58618334Speter
58718334Speter#define SMALL_REGISTER_CLASSES
58818334Speter
58918334Speter#define QI_REG_P(X) \
59018334Speter  (REG_P (X) && REGNO (X) < 4)
59118334Speter#define NON_QI_REG_P(X) \
59218334Speter  (REG_P (X) && REGNO (X) >= 4 && REGNO (X) < FIRST_PSEUDO_REGISTER)
59318334Speter
59418334Speter#define FP_REG_P(X) (REG_P (X) && FP_REGNO_P (REGNO (X)))
59518334Speter#define FP_REGNO_P(n) ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG)
59618334Speter
59718334Speter#define STACK_REG_P(xop) (REG_P (xop) &&		       	\
59818334Speter			  REGNO (xop) >= FIRST_STACK_REG &&	\
59918334Speter			  REGNO (xop) <= LAST_STACK_REG)
60018334Speter
60118334Speter#define NON_STACK_REG_P(xop) (REG_P (xop) && ! STACK_REG_P (xop))
60218334Speter
60318334Speter#define STACK_TOP_P(xop) (REG_P (xop) && REGNO (xop) == FIRST_STACK_REG)
60418334Speter
60518334Speter/* Try to maintain the accuracy of the death notes for regs satisfying the
60618334Speter   following.  Important for stack like regs, to know when to pop. */
60718334Speter
60818334Speter/* #define PRESERVE_DEATH_INFO_REGNO_P(x) FP_REGNO_P(x) */
60918334Speter
61018334Speter/* 1 if register REGNO can magically overlap other regs.
61118334Speter   Note that nonzero values work only in very special circumstances. */
61218334Speter
61318334Speter/* #define OVERLAPPING_REGNO_P(REGNO) FP_REGNO_P (REGNO) */
61418334Speter
61518334Speter/* The class value for index registers, and the one for base regs.  */
61618334Speter
61718334Speter#define INDEX_REG_CLASS INDEX_REGS
61818334Speter#define BASE_REG_CLASS GENERAL_REGS
61918334Speter
62018334Speter/* Get reg_class from a letter such as appears in the machine description.  */
62118334Speter
62218334Speter#define REG_CLASS_FROM_LETTER(C)	\
62318334Speter  ((C) == 'r' ? GENERAL_REGS :					\
62418334Speter   (C) == 'q' ? Q_REGS :					\
62518334Speter   (C) == 'f' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387	\
62618334Speter		 ? FLOAT_REGS					\
62718334Speter		 : NO_REGS) :					\
62818334Speter   (C) == 't' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387	\
62918334Speter		 ? FP_TOP_REG					\
63018334Speter		 : NO_REGS) :					\
63118334Speter   (C) == 'u' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387	\
63218334Speter		 ? FP_SECOND_REG				\
63318334Speter		 : NO_REGS) :					\
63418334Speter   (C) == 'a' ? AREG :						\
63518334Speter   (C) == 'b' ? BREG :						\
63618334Speter   (C) == 'c' ? CREG :						\
63718334Speter   (C) == 'd' ? DREG :						\
63818334Speter   (C) == 'A' ? AD_REGS :					\
63918334Speter   (C) == 'D' ? DIREG :						\
64018334Speter   (C) == 'S' ? SIREG : NO_REGS)
64118334Speter
64218334Speter/* The letters I, J, K, L and M in a register constraint string
64318334Speter   can be used to stand for particular ranges of immediate operands.
64418334Speter   This macro defines what the ranges are.
64518334Speter   C is the letter, and VALUE is a constant value.
64618334Speter   Return 1 if VALUE is in the range specified by C.
64718334Speter
64818334Speter   I is for non-DImode shifts.
64918334Speter   J is for DImode shifts.
65018334Speter   K and L are for an `andsi' optimization.
65118334Speter   M is for shifts that can be executed by the "lea" opcode.
65218334Speter   */
65318334Speter
65418334Speter#define CONST_OK_FOR_LETTER_P(VALUE, C)  \
65518334Speter  ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 31 :	\
65618334Speter   (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 63 :	\
65718334Speter   (C) == 'K' ? (VALUE) == 0xff :		\
65818334Speter   (C) == 'L' ? (VALUE) == 0xffff :		\
65918334Speter   (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 3 :	\
66018334Speter   (C) == 'N' ? (VALUE) >= 0 && (VALUE) <= 255 :\
66118334Speter   0)
66218334Speter
66318334Speter/* Similar, but for floating constants, and defining letters G and H.
66418334Speter   Here VALUE is the CONST_DOUBLE rtx itself.  We allow constants even if
66518334Speter   TARGET_387 isn't set, because the stack register converter may need to
66618334Speter   load 0.0 into the function value register. */
66718334Speter
66818334Speter#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \
66918334Speter  ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0)
67018334Speter
67118334Speter/* Place additional restrictions on the register class to use when it
67218334Speter   is necessary to be able to hold a value of mode MODE in a reload
67318334Speter   register for which class CLASS would ordinarily be used. */
67418334Speter
67518334Speter#define LIMIT_RELOAD_CLASS(MODE, CLASS) \
67618334Speter  ((MODE) == QImode && ((CLASS) == ALL_REGS || (CLASS) == GENERAL_REGS) \
67718334Speter   ? Q_REGS : (CLASS))
67818334Speter
67918334Speter/* Given an rtx X being reloaded into a reg required to be
68018334Speter   in class CLASS, return the class of reg to actually use.
68118334Speter   In general this is just CLASS; but on some machines
68218334Speter   in some cases it is preferable to use a more restrictive class.
68318334Speter   On the 80386 series, we prevent floating constants from being
68418334Speter   reloaded into floating registers (since no move-insn can do that)
68518334Speter   and we ensure that QImodes aren't reloaded into the esi or edi reg.  */
68618334Speter
68718334Speter/* Put float CONST_DOUBLE in the constant pool instead of fp regs.
68818334Speter   QImode must go into class Q_REGS.
68918334Speter   Narrow ALL_REGS to GENERAL_REGS.  This supports allowing movsf and
69018334Speter   movdf to do mem-to-mem moves through integer regs. */
69118334Speter
69218334Speter#define PREFERRED_RELOAD_CLASS(X,CLASS)	\
69318334Speter  (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode ? NO_REGS	\
69418334Speter   : GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
69518334Speter   : ((CLASS) == ALL_REGS						\
69618334Speter      && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS	\
69718334Speter   : (CLASS))
69818334Speter
69918334Speter/* If we are copying between general and FP registers, we need a memory
70018334Speter   location.  */
70118334Speter
70218334Speter#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \
70318334Speter  ((FLOAT_CLASS_P (CLASS1) && ! FLOAT_CLASS_P (CLASS2))	\
70418334Speter   || (! FLOAT_CLASS_P (CLASS1) && FLOAT_CLASS_P (CLASS2)))
70518334Speter
70618334Speter/* Return the maximum number of consecutive registers
70718334Speter   needed to represent mode MODE in a register of class CLASS.  */
70818334Speter/* On the 80386, this is the size of MODE in words,
70918334Speter   except in the FP regs, where a single reg is always enough.  */
71018334Speter#define CLASS_MAX_NREGS(CLASS, MODE)	\
71118334Speter (FLOAT_CLASS_P (CLASS) ? 1 :		\
71218334Speter  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
71318334Speter
71418334Speter/* A C expression whose value is nonzero if pseudos that have been
71518334Speter   assigned to registers of class CLASS would likely be spilled
71618334Speter   because registers of CLASS are needed for spill registers.
71718334Speter
71818334Speter   The default value of this macro returns 1 if CLASS has exactly one
71918334Speter   register and zero otherwise.  On most machines, this default
72018334Speter   should be used.  Only define this macro to some other expression
72118334Speter   if pseudo allocated by `local-alloc.c' end up in memory because
72218334Speter   their hard registers were needed for spill registers.  If this
72318334Speter   macro returns nonzero for those classes, those pseudos will only
72418334Speter   be allocated by `global.c', which knows how to reallocate the
72518334Speter   pseudo to another register.  If there would not be another
72618334Speter   register available for reallocation, you should not change the
72718334Speter   definition of this macro since the only effect of such a
72818334Speter   definition would be to slow down register allocation.  */
72918334Speter
73018334Speter#define CLASS_LIKELY_SPILLED_P(CLASS)					\
73118334Speter  (((CLASS) == AREG)							\
73218334Speter   || ((CLASS) == DREG)							\
73318334Speter   || ((CLASS) == CREG)							\
73418334Speter   || ((CLASS) == BREG)							\
73518334Speter   || ((CLASS) == AD_REGS)						\
73618334Speter   || ((CLASS) == SIREG)						\
73718334Speter   || ((CLASS) == DIREG))
73818334Speter
73918334Speter
74018334Speter/* Stack layout; function entry, exit and calling.  */
74118334Speter
74218334Speter/* Define this if pushing a word on the stack
74318334Speter   makes the stack pointer a smaller address.  */
74418334Speter#define STACK_GROWS_DOWNWARD
74518334Speter
74618334Speter/* Define this if the nominal address of the stack frame
74718334Speter   is at the high-address end of the local variables;
74818334Speter   that is, each additional local variable allocated
74918334Speter   goes at a more negative offset in the frame.  */
75018334Speter#define FRAME_GROWS_DOWNWARD
75118334Speter
75218334Speter/* Offset within stack frame to start allocating local variables at.
75318334Speter   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
75418334Speter   first local allocated.  Otherwise, it is the offset to the BEGINNING
75518334Speter   of the first local allocated.  */
75618334Speter#define STARTING_FRAME_OFFSET 0
75718334Speter
75818334Speter/* If we generate an insn to push BYTES bytes,
75918334Speter   this says how many the stack pointer really advances by.
76018334Speter   On 386 pushw decrements by exactly 2 no matter what the position was.
76118334Speter   On the 386 there is no pushb; we use pushw instead, and this
76218334Speter   has the effect of rounding up to 2.  */
76318334Speter
76418334Speter#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & (-2))
76518334Speter
76618334Speter/* Offset of first parameter from the argument pointer register value.  */
76718334Speter#define FIRST_PARM_OFFSET(FNDECL) 0
76818334Speter
76918334Speter/* Value is the number of bytes of arguments automatically
77018334Speter   popped when returning from a subroutine call.
77118334Speter   FUNDECL is the declaration node of the function (as a tree),
77218334Speter   FUNTYPE is the data type of the function (as a tree),
77318334Speter   or for a library call it is an identifier node for the subroutine name.
77418334Speter   SIZE is the number of bytes of arguments passed on the stack.
77518334Speter
77618334Speter   On the 80386, the RTD insn may be used to pop them if the number
77718334Speter     of args is fixed, but if the number is variable then the caller
77818334Speter     must pop them all.  RTD can't be used for library calls now
77918334Speter     because the library is compiled with the Unix compiler.
78018334Speter   Use of RTD is a selectable option, since it is incompatible with
78118334Speter   standard Unix calling sequences.  If the option is not selected,
78218334Speter   the caller must always pop the args.
78318334Speter
78418334Speter   The attribute stdcall is equivalent to RTD on a per module basis.  */
78518334Speter
78618334Speter#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
78718334Speter  (i386_return_pops_args (FUNDECL, FUNTYPE, SIZE))
78818334Speter
78918334Speter/* Define how to find the value returned by a function.
79018334Speter   VALTYPE is the data type of the value (as a tree).
79118334Speter   If the precise function being called is known, FUNC is its FUNCTION_DECL;
79218334Speter   otherwise, FUNC is 0.  */
79318334Speter#define FUNCTION_VALUE(VALTYPE, FUNC)  \
79418334Speter   gen_rtx (REG, TYPE_MODE (VALTYPE), \
79518334Speter	    VALUE_REGNO (TYPE_MODE (VALTYPE)))
79618334Speter
79718334Speter/* Define how to find the value returned by a library function
79818334Speter   assuming the value has mode MODE.  */
79918334Speter
80018334Speter#define LIBCALL_VALUE(MODE) \
80118334Speter  gen_rtx (REG, MODE, VALUE_REGNO (MODE))
80218334Speter
80318334Speter/* Define the size of the result block used for communication between
80418334Speter   untyped_call and untyped_return.  The block contains a DImode value
80518334Speter   followed by the block used by fnsave and frstor.  */
80618334Speter
80718334Speter#define APPLY_RESULT_SIZE (8+108)
80818334Speter
80918334Speter/* 1 if N is a possible register number for function argument passing.  */
81018334Speter#define FUNCTION_ARG_REGNO_P(N) ((N) >= 0 && (N) < REGPARM_MAX)
81118334Speter
81218334Speter/* Define a data type for recording info about an argument list
81318334Speter   during the scan of that argument list.  This data type should
81418334Speter   hold all necessary information about the function itself
81518334Speter   and about the args processed so far, enough to enable macros
81618334Speter   such as FUNCTION_ARG to determine where the next arg should go.  */
81718334Speter
81818334Spetertypedef struct i386_args {
81918334Speter  int words;			/* # words passed so far */
82018334Speter  int nregs;			/* # registers available for passing */
82118334Speter  int regno;			/* next available register number */
82218334Speter} CUMULATIVE_ARGS;
82318334Speter
82418334Speter/* Initialize a variable CUM of type CUMULATIVE_ARGS
82518334Speter   for a call to a function whose data type is FNTYPE.
82618334Speter   For a library call, FNTYPE is 0.  */
82718334Speter
82818334Speter#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME)	\
82918334Speter  (init_cumulative_args (&CUM, FNTYPE, LIBNAME))
83018334Speter
83118334Speter/* Update the data in CUM to advance over an argument
83218334Speter   of mode MODE and data type TYPE.
83318334Speter   (TYPE is null for libcalls where that information may not be available.)  */
83418334Speter
83518334Speter#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)	\
83618334Speter  (function_arg_advance (&CUM, MODE, TYPE, NAMED))
83718334Speter
83818334Speter/* Define where to put the arguments to a function.
83918334Speter   Value is zero to push the argument on the stack,
84018334Speter   or a hard register in which to store the argument.
84118334Speter
84218334Speter   MODE is the argument's machine mode.
84318334Speter   TYPE is the data type of the argument (as a tree).
84418334Speter    This is null for libcalls where that information may
84518334Speter    not be available.
84618334Speter   CUM is a variable of type CUMULATIVE_ARGS which gives info about
84718334Speter    the preceding args and about the function being called.
84818334Speter   NAMED is nonzero if this argument is a named parameter
84918334Speter    (otherwise it is an extra parameter matching an ellipsis).  */
85018334Speter
85118334Speter#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
85218334Speter  (function_arg (&CUM, MODE, TYPE, NAMED))
85318334Speter
85418334Speter/* For an arg passed partly in registers and partly in memory,
85518334Speter   this is the number of registers used.
85618334Speter   For args passed entirely in registers or entirely in memory, zero.  */
85718334Speter
85818334Speter#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
85918334Speter  (function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED))
86018334Speter
86118334Speter/* This macro generates the assembly code for function entry.
86218334Speter   FILE is a stdio stream to output the code to.
86318334Speter   SIZE is an int: how many units of temporary storage to allocate.
86418334Speter   Refer to the array `regs_ever_live' to determine which registers
86518334Speter   to save; `regs_ever_live[I]' is nonzero if register number I
86618334Speter   is ever used in the function.  This macro is responsible for
86718334Speter   knowing which registers should not be saved even if used.  */
86818334Speter
86918334Speter#define FUNCTION_PROLOGUE(FILE, SIZE)     \
87018334Speter  function_prologue (FILE, SIZE)
87118334Speter
87218334Speter/* Output assembler code to FILE to increment profiler label # LABELNO
87318334Speter   for profiling a function entry.  */
87418334Speter
87518334Speter#define FUNCTION_PROFILER(FILE, LABELNO)  \
87618334Speter{									\
87718334Speter  if (flag_pic)								\
87818334Speter    {									\
87918334Speter      fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n",		\
88018334Speter	       LPREFIX, (LABELNO));					\
88118334Speter      fprintf (FILE, "\tcall *_mcount@GOT(%%ebx)\n");			\
88218334Speter    }									\
88318334Speter  else									\
88418334Speter    {									\
88518334Speter      fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO));	\
88618334Speter      fprintf (FILE, "\tcall _mcount\n");				\
88718334Speter    }									\
88818334Speter}
88918334Speter
89018334Speter/* A C statement or compound statement to output to FILE some
89118334Speter   assembler code to initialize basic-block profiling for the current
89218334Speter   object module.  This code should call the subroutine
89318334Speter   `__bb_init_func' once per object module, passing it as its sole
89418334Speter   argument the address of a block allocated in the object module.
89518334Speter
89618334Speter   The name of the block is a local symbol made with this statement:
89718334Speter
89818334Speter	ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
89918334Speter
90018334Speter   Of course, since you are writing the definition of
90118334Speter   `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
90218334Speter   can take a short cut in the definition of this macro and use the
90318334Speter   name that you know will result.
90418334Speter
90518334Speter   The first word of this block is a flag which will be nonzero if the
90618334Speter   object module has already been initialized.  So test this word
90718334Speter   first, and do not call `__bb_init_func' if the flag is nonzero.  */
90818334Speter
90918334Speter#undef	FUNCTION_BLOCK_PROFILER
91018334Speter#define FUNCTION_BLOCK_PROFILER(STREAM, LABELNO)			\
91118334Speterdo									\
91218334Speter  {									\
91318334Speter    static int num_func = 0;						\
91418334Speter    rtx xops[8];							\
91518334Speter    char block_table[80], false_label[80];				\
91618334Speter									\
91718334Speter    ASM_GENERATE_INTERNAL_LABEL (block_table, "LPBX", 0);		\
91818334Speter    ASM_GENERATE_INTERNAL_LABEL (false_label, "LPBZ", num_func);	\
91918334Speter									\
92018334Speter    xops[0] = const0_rtx;						\
92118334Speter    xops[1] = gen_rtx (SYMBOL_REF, VOIDmode, block_table);		\
92218334Speter    xops[2] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, false_label)); \
92318334Speter    xops[3] = gen_rtx (MEM, Pmode, gen_rtx (SYMBOL_REF, VOIDmode, "__bb_init_func")); \
92418334Speter    xops[4] = gen_rtx (MEM, Pmode, xops[1]);				\
92518334Speter    xops[5] = stack_pointer_rtx;					\
92618334Speter    xops[6] = GEN_INT (4);						\
92718334Speter    xops[7] = gen_rtx (REG, Pmode, 0);	/* eax */			\
92818334Speter									\
92918334Speter    CONSTANT_POOL_ADDRESS_P (xops[1]) = TRUE;				\
93018334Speter    CONSTANT_POOL_ADDRESS_P (xops[2]) = TRUE;				\
93118334Speter									\
93218334Speter    output_asm_insn (AS2(cmp%L4,%0,%4), xops);				\
93318334Speter    output_asm_insn (AS1(jne,%2), xops);				\
93418334Speter									\
93518334Speter    if (!flag_pic)							\
93618334Speter      output_asm_insn (AS1(push%L1,%1), xops);				\
93718334Speter    else								\
93818334Speter      {									\
93918334Speter	output_asm_insn (AS2 (lea%L7,%a1,%7), xops);			\
94018334Speter	output_asm_insn (AS1 (push%L7,%7), xops);			\
94118334Speter      }									\
94218334Speter									\
94318334Speter    output_asm_insn (AS1(call,%P3), xops);				\
94418334Speter    output_asm_insn (AS2(add%L0,%6,%5), xops);				\
94518334Speter    ASM_OUTPUT_INTERNAL_LABEL (STREAM, "LPBZ", num_func);		\
94618334Speter    num_func++;								\
94718334Speter  }									\
94818334Speterwhile (0)
94918334Speter
95018334Speter
95118334Speter/* A C statement or compound statement to increment the count
95218334Speter   associated with the basic block number BLOCKNO.  Basic blocks are
95318334Speter   numbered separately from zero within each compilation.  The count
95418334Speter   associated with block number BLOCKNO is at index BLOCKNO in a
95518334Speter   vector of words; the name of this array is a local symbol made
95618334Speter   with this statement:
95718334Speter
95818334Speter	ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2);
95918334Speter
96018334Speter   Of course, since you are writing the definition of
96118334Speter   `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
96218334Speter   can take a short cut in the definition of this macro and use the
96318334Speter   name that you know will result.  */
96418334Speter
96518334Speter#define BLOCK_PROFILER(STREAM, BLOCKNO)					\
96618334Speterdo									\
96718334Speter  {									\
96818334Speter    rtx xops[1], cnt_rtx;						\
96918334Speter    char counts[80];							\
97018334Speter									\
97118334Speter    ASM_GENERATE_INTERNAL_LABEL (counts, "LPBX", 2);			\
97218334Speter    cnt_rtx = gen_rtx (SYMBOL_REF, VOIDmode, counts);			\
97318334Speter    SYMBOL_REF_FLAG (cnt_rtx) = TRUE;					\
97418334Speter									\
97518334Speter    if (BLOCKNO)							\
97618334Speter      cnt_rtx = plus_constant (cnt_rtx, (BLOCKNO)*4);			\
97718334Speter									\
97818334Speter    if (flag_pic)							\
97918334Speter      cnt_rtx = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, cnt_rtx);	\
98018334Speter									\
98118334Speter    xops[0] = gen_rtx (MEM, SImode, cnt_rtx);				\
98218334Speter    output_asm_insn (AS1(inc%L0,%0), xops);				\
98318334Speter  }									\
98418334Speterwhile (0)
98518334Speter
98618334Speter/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
98718334Speter   the stack pointer does not matter.  The value is tested only in
98818334Speter   functions that have frame pointers.
98918334Speter   No definition is equivalent to always zero.  */
99018334Speter/* Note on the 386 it might be more efficient not to define this since
99118334Speter   we have to restore it ourselves from the frame pointer, in order to
99218334Speter   use pop */
99318334Speter
99418334Speter#define EXIT_IGNORE_STACK 1
99518334Speter
99618334Speter/* This macro generates the assembly code for function exit,
99718334Speter   on machines that need it.  If FUNCTION_EPILOGUE is not defined
99818334Speter   then individual return instructions are generated for each
99918334Speter   return statement.  Args are same as for FUNCTION_PROLOGUE.
100018334Speter
100118334Speter   The function epilogue should not depend on the current stack pointer!
100218334Speter   It should use the frame pointer only.  This is mandatory because
100318334Speter   of alloca; we also take advantage of it to omit stack adjustments
100418334Speter   before returning.
100518334Speter
100618334Speter   If the last non-note insn in the function is a BARRIER, then there
100718334Speter   is no need to emit a function prologue, because control does not fall
100818334Speter   off the end.  This happens if the function ends in an "exit" call, or
100918334Speter   if a `return' insn is emitted directly into the function. */
101018334Speter
101118334Speter#define FUNCTION_EPILOGUE(FILE, SIZE) 		\
101218334Speterdo {						\
101318334Speter  rtx last = get_last_insn ();			\
101418334Speter  if (last && GET_CODE (last) == NOTE)		\
101518334Speter    last = prev_nonnote_insn (last);		\
101618334Speter  if (! last || GET_CODE (last) != BARRIER)	\
101718334Speter    function_epilogue (FILE, SIZE);		\
101818334Speter} while (0)
101918334Speter
102018334Speter/* Output assembler code for a block containing the constant parts
102118334Speter   of a trampoline, leaving space for the variable parts.  */
102218334Speter
102318334Speter/* On the 386, the trampoline contains three instructions:
102418334Speter     mov #STATIC,ecx
102518334Speter     mov #FUNCTION,eax
102618334Speter     jmp @eax  */
102718334Speter#define TRAMPOLINE_TEMPLATE(FILE)			\
102818334Speter{							\
102918334Speter  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb9));		\
103018334Speter  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\
103118334Speter  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\
103218334Speter  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb8));		\
103318334Speter  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\
103418334Speter  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\
103518334Speter  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xff));		\
103618334Speter  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xe0));		\
103718334Speter}
103818334Speter
103918334Speter/* Length in units of the trampoline for entering a nested function.  */
104018334Speter
104118334Speter#define TRAMPOLINE_SIZE 12
104218334Speter
104318334Speter/* Emit RTL insns to initialize the variable parts of a trampoline.
104418334Speter   FNADDR is an RTX for the address of the function's pure code.
104518334Speter   CXT is an RTX for the static chain value for the function.  */
104618334Speter
104718334Speter#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)			\
104818334Speter{									\
104918334Speter  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 1)), CXT); \
105018334Speter  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 6)), FNADDR); \
105118334Speter}
105218334Speter
105318334Speter/* Definitions for register eliminations.
105418334Speter
105518334Speter   This is an array of structures.  Each structure initializes one pair
105618334Speter   of eliminable registers.  The "from" register number is given first,
105718334Speter   followed by "to".  Eliminations of the same "from" register are listed
105818334Speter   in order of preference.
105918334Speter
106018334Speter   We have two registers that can be eliminated on the i386.  First, the
106118334Speter   frame pointer register can often be eliminated in favor of the stack
106218334Speter   pointer register.  Secondly, the argument pointer register can always be
106318334Speter   eliminated; it is replaced with either the stack or frame pointer. */
106418334Speter
106518334Speter#define ELIMINABLE_REGS				\
106618334Speter{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},	\
106718334Speter { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},   \
106818334Speter { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
106918334Speter
107018334Speter/* Given FROM and TO register numbers, say whether this elimination is allowed.
107118334Speter   Frame pointer elimination is automatically handled.
107218334Speter
107318334Speter   For the i386, if frame pointer elimination is being done, we would like to
107418334Speter   convert ap into sp, not fp.
107518334Speter
107618334Speter   All other eliminations are valid.  */
107718334Speter
107818334Speter#define CAN_ELIMINATE(FROM, TO)					\
107918334Speter ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM	\
108018334Speter  ? ! frame_pointer_needed					\
108118334Speter  : 1)
108218334Speter
108318334Speter/* Define the offset between two registers, one to be eliminated, and the other
108418334Speter   its replacement, at the start of a routine.  */
108518334Speter
108618334Speter#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)			\
108718334Speter{									\
108818334Speter  if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM)	\
108918334Speter    (OFFSET) = 8;	/* Skip saved PC and previous frame pointer */	\
109018334Speter  else									\
109118334Speter    {									\
109218334Speter      int regno;							\
109318334Speter      int offset = 0;							\
109418334Speter									\
109518334Speter      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)		\
109618334Speter	if ((regs_ever_live[regno] && ! call_used_regs[regno])		\
109718334Speter	    || (current_function_uses_pic_offset_table			\
109818334Speter		&& regno == PIC_OFFSET_TABLE_REGNUM))			\
109918334Speter	  offset += 4;							\
110018334Speter									\
110118334Speter      (OFFSET) = offset + get_frame_size ();				\
110218334Speter									\
110318334Speter      if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM)	\
110418334Speter	(OFFSET) += 4;	/* Skip saved PC */				\
110518334Speter    }									\
110618334Speter}
110718334Speter
110818334Speter/* Addressing modes, and classification of registers for them.  */
110918334Speter
111018334Speter/* #define HAVE_POST_INCREMENT */
111118334Speter/* #define HAVE_POST_DECREMENT */
111218334Speter
111318334Speter/* #define HAVE_PRE_DECREMENT */
111418334Speter/* #define HAVE_PRE_INCREMENT */
111518334Speter
111618334Speter/* Macros to check register numbers against specific register classes.  */
111718334Speter
111818334Speter/* These assume that REGNO is a hard or pseudo reg number.
111918334Speter   They give nonzero only if REGNO is a hard reg of the suitable class
112018334Speter   or a pseudo reg currently allocated to a suitable hard reg.
112118334Speter   Since they use reg_renumber, they are safe only once reg_renumber
112218334Speter   has been allocated, which happens in local-alloc.c.  */
112318334Speter
112418334Speter#define REGNO_OK_FOR_INDEX_P(REGNO) \
112518334Speter  ((REGNO) < STACK_POINTER_REGNUM \
112618334Speter   || (unsigned) reg_renumber[REGNO] < STACK_POINTER_REGNUM)
112718334Speter
112818334Speter#define REGNO_OK_FOR_BASE_P(REGNO) \
112918334Speter  ((REGNO) <= STACK_POINTER_REGNUM \
113018334Speter   || (REGNO) == ARG_POINTER_REGNUM \
113118334Speter   || (unsigned) reg_renumber[REGNO] <= STACK_POINTER_REGNUM)
113218334Speter
113318334Speter#define REGNO_OK_FOR_SIREG_P(REGNO) ((REGNO) == 4 || reg_renumber[REGNO] == 4)
113418334Speter#define REGNO_OK_FOR_DIREG_P(REGNO) ((REGNO) == 5 || reg_renumber[REGNO] == 5)
113518334Speter
113618334Speter/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
113718334Speter   and check its validity for a certain class.
113818334Speter   We have two alternate definitions for each of them.
113918334Speter   The usual definition accepts all pseudo regs; the other rejects
114018334Speter   them unless they have been allocated suitable hard regs.
114118334Speter   The symbol REG_OK_STRICT causes the latter definition to be used.
114218334Speter
114318334Speter   Most source files want to accept pseudo regs in the hope that
114418334Speter   they will get allocated to the class that the insn wants them to be in.
114518334Speter   Source files for reload pass need to be strict.
114618334Speter   After reload, it makes no difference, since pseudo regs have
114718334Speter   been eliminated by then.  */
114818334Speter
114918334Speter
115018334Speter/* Non strict versions, pseudos are ok */
115118334Speter#define REG_OK_FOR_INDEX_NONSTRICT_P(X)					\
115218334Speter  (REGNO (X) < STACK_POINTER_REGNUM					\
115318334Speter   || REGNO (X) >= FIRST_PSEUDO_REGISTER)
115418334Speter
115518334Speter#define REG_OK_FOR_BASE_NONSTRICT_P(X)					\
115618334Speter  (REGNO (X) <= STACK_POINTER_REGNUM					\
115718334Speter   || REGNO (X) == ARG_POINTER_REGNUM					\
115818334Speter   || REGNO (X) >= FIRST_PSEUDO_REGISTER)
115918334Speter
116018334Speter#define REG_OK_FOR_STRREG_NONSTRICT_P(X)				\
116118334Speter  (REGNO (X) == 4 || REGNO (X) == 5 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
116218334Speter
116318334Speter/* Strict versions, hard registers only */
116418334Speter#define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
116518334Speter#define REG_OK_FOR_BASE_STRICT_P(X)  REGNO_OK_FOR_BASE_P (REGNO (X))
116618334Speter#define REG_OK_FOR_STRREG_STRICT_P(X)					\
116718334Speter  (REGNO_OK_FOR_DIREG_P (REGNO (X)) || REGNO_OK_FOR_SIREG_P (REGNO (X)))
116818334Speter
116918334Speter#ifndef REG_OK_STRICT
117018334Speter#define REG_OK_FOR_INDEX_P(X)  REG_OK_FOR_INDEX_NONSTRICT_P(X)
117118334Speter#define REG_OK_FOR_BASE_P(X)   REG_OK_FOR_BASE_NONSTRICT_P(X)
117218334Speter#define REG_OK_FOR_STRREG_P(X) REG_OK_FOR_STRREG_NONSTRICT_P(X)
117318334Speter
117418334Speter#else
117518334Speter#define REG_OK_FOR_INDEX_P(X)  REG_OK_FOR_INDEX_STRICT_P(X)
117618334Speter#define REG_OK_FOR_BASE_P(X)   REG_OK_FOR_BASE_STRICT_P(X)
117718334Speter#define REG_OK_FOR_STRREG_P(X) REG_OK_FOR_STRREG_STRICT_P(X)
117818334Speter#endif
117918334Speter
118018334Speter/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
118118334Speter   that is a valid memory address for an instruction.
118218334Speter   The MODE argument is the machine mode for the MEM expression
118318334Speter   that wants to use this address.
118418334Speter
118518334Speter   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
118618334Speter   except for CONSTANT_ADDRESS_P which is usually machine-independent.
118718334Speter
118818334Speter   See legitimize_pic_address in i386.c for details as to what
118918334Speter   constitutes a legitimate address when -fpic is used.  */
119018334Speter
119118334Speter#define MAX_REGS_PER_ADDRESS 2
119218334Speter
119318334Speter#define CONSTANT_ADDRESS_P(X)   \
119418334Speter  (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF		\
119518334Speter   || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST		\
119618334Speter   || GET_CODE (X) == HIGH)
119718334Speter
119818334Speter/* Nonzero if the constant value X is a legitimate general operand.
119918334Speter   It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
120018334Speter
120118334Speter#define LEGITIMATE_CONSTANT_P(X) 1
120218334Speter
120318334Speter#ifdef REG_OK_STRICT
120418334Speter#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\
120518334Speter{									\
120618334Speter  if (legitimate_address_p (MODE, X, 1))				\
120718334Speter    goto ADDR;								\
120818334Speter}
120918334Speter
121018334Speter#else
121118334Speter#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\
121218334Speter{									\
121318334Speter  if (legitimate_address_p (MODE, X, 0))				\
121418334Speter    goto ADDR;								\
121518334Speter}
121618334Speter
121718334Speter#endif
121818334Speter
121918334Speter/* Try machine-dependent ways of modifying an illegitimate address
122018334Speter   to be legitimate.  If we find one, return the new, valid address.
122118334Speter   This macro is used in only one place: `memory_address' in explow.c.
122218334Speter
122318334Speter   OLDX is the address as it was before break_out_memory_refs was called.
122418334Speter   In some cases it is useful to look at this to decide what needs to be done.
122518334Speter
122618334Speter   MODE and WIN are passed so that this macro can use
122718334Speter   GO_IF_LEGITIMATE_ADDRESS.
122818334Speter
122918334Speter   It is always safe for this macro to do nothing.  It exists to recognize
123018334Speter   opportunities to optimize the output.
123118334Speter
123218334Speter   For the 80386, we handle X+REG by loading X into a register R and
123318334Speter   using R+REG.  R will go in a general reg and indexing will be used.
123418334Speter   However, if REG is a broken-out memory address or multiplication,
123518334Speter   nothing needs to be done because REG can certainly go in a general reg.
123618334Speter
123718334Speter   When -fpic is used, special handling is needed for symbolic references.
123818334Speter   See comments by legitimize_pic_address in i386.c for details.  */
123918334Speter
124018334Speter#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)				\
124118334Speter{									\
124218334Speter  rtx orig_x = (X);							\
124318334Speter  (X) = legitimize_address (X, OLDX, MODE);				\
124418334Speter  if (memory_address_p (MODE, X))					\
124518334Speter    goto WIN;								\
124618334Speter}
124718334Speter
124818334Speter/* Nonzero if the constant value X is a legitimate general operand
124918334Speter   when generating PIC code.  It is given that flag_pic is on and
125018334Speter   that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
125118334Speter
125218334Speter#define LEGITIMATE_PIC_OPERAND_P(X) \
125318334Speter  (! SYMBOLIC_CONST (X)							\
125418334Speter   || (GET_CODE (X) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (X)))
125518334Speter
125618334Speter#define SYMBOLIC_CONST(X)	\
125718334Speter(GET_CODE (X) == SYMBOL_REF						\
125818334Speter || GET_CODE (X) == LABEL_REF						\
125918334Speter || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
126018334Speter
126118334Speter/* Go to LABEL if ADDR (a legitimate address expression)
126218334Speter   has an effect that depends on the machine mode it is used for.
126318334Speter   On the 80386, only postdecrement and postincrement address depend thus
126418334Speter   (the amount of decrement or increment being the length of the operand).  */
126518334Speter#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)	\
126618334Speter if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == POST_DEC) goto LABEL
126718334Speter
126818334Speter/* Define this macro if references to a symbol must be treated
126918334Speter   differently depending on something about the variable or
127018334Speter   function named by the symbol (such as what section it is in).
127118334Speter
127218334Speter   On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
127318334Speter   so that we may access it directly in the GOT.  */
127418334Speter
127518334Speter#define ENCODE_SECTION_INFO(DECL) \
127618334Speterdo									\
127718334Speter  {									\
127818334Speter    if (flag_pic)							\
127918334Speter      {									\
128018334Speter	rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'		\
128118334Speter		   ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));		\
128218334Speter	SYMBOL_REF_FLAG (XEXP (rtl, 0))					\
128318334Speter	  = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'			\
128418334Speter	     || ! TREE_PUBLIC (DECL));					\
128518334Speter      }									\
128618334Speter  }									\
128718334Speterwhile (0)
128818334Speter
128918334Speter/* Initialize data used by insn expanders.  This is called from
129018334Speter   init_emit, once for each function, before code is generated.
129118334Speter   For 386, clear stack slot assignments remembered from previous
129218334Speter   functions. */
129318334Speter
129418334Speter#define INIT_EXPANDERS clear_386_stack_locals ()
129518334Speter
129618334Speter/* The `FINALIZE_PIC' macro serves as a hook to emit these special
129718334Speter   codes once the function is being compiled into assembly code, but
129818334Speter   not before.  (It is not done before, because in the case of
129918334Speter   compiling an inline function, it would lead to multiple PIC
130018334Speter   prologues being included in functions which used inline functions
130118334Speter   and were compiled to assembly language.)  */
130218334Speter
130318334Speter#define FINALIZE_PIC							\
130418334Speterdo									\
130518334Speter  {									\
130618334Speter    extern int current_function_uses_pic_offset_table;			\
130718334Speter									\
130818334Speter    current_function_uses_pic_offset_table |= profile_flag | profile_block_flag; \
130918334Speter  }									\
131018334Speterwhile (0)
131118334Speter
131218334Speter
131318334Speter/* If defined, a C expression whose value is nonzero if IDENTIFIER
131418334Speter   with arguments ARGS is a valid machine specific attribute for DECL.
131518334Speter   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
131618334Speter
131718334Speter#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
131818334Speter  (i386_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
131918334Speter
132018334Speter/* If defined, a C expression whose value is nonzero if IDENTIFIER
132118334Speter   with arguments ARGS is a valid machine specific attribute for TYPE.
132218334Speter   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
132318334Speter
132418334Speter#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
132518334Speter  (i386_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
132618334Speter
132718334Speter/* If defined, a C expression whose value is zero if the attributes on
132818334Speter   TYPE1 and TYPE2 are incompatible, one if they are compatible, and
132918334Speter   two if they are nearly compatible (which causes a warning to be
133018334Speter   generated).  */
133118334Speter
133218334Speter#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
133318334Speter  (i386_comp_type_attributes (TYPE1, TYPE2))
133418334Speter
133518334Speter/* If defined, a C statement that assigns default attributes to newly
133618334Speter   defined TYPE.  */
133718334Speter
133818334Speter/* #define SET_DEFAULT_TYPE_ATTRIBUTES (TYPE) */
133918334Speter
134018334Speter/* Max number of args passed in registers.  If this is more than 3, we will
134118334Speter   have problems with ebx (register #4), since it is a caller save register and
134218334Speter   is also used as the pic register in ELF.  So for now, don't allow more than
134318334Speter   3 registers to be passed in registers.  */
134418334Speter
134518334Speter#define REGPARM_MAX 3
134618334Speter
134718334Speter
134818334Speter/* Specify the machine mode that this machine uses
134918334Speter   for the index in the tablejump instruction.  */
135018334Speter#define CASE_VECTOR_MODE Pmode
135118334Speter
135218334Speter/* Define this if the tablejump instruction expects the table
135318334Speter   to contain offsets from the address of the table.
135418334Speter   Do not define this if the table should contain absolute addresses.  */
135518334Speter/* #define CASE_VECTOR_PC_RELATIVE */
135618334Speter
135718334Speter/* Specify the tree operation to be used to convert reals to integers.
135818334Speter   This should be changed to take advantage of fist --wfs ??
135918334Speter */
136018334Speter#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
136118334Speter
136218334Speter/* This is the kind of divide that is easiest to do in the general case.  */
136318334Speter#define EASY_DIV_EXPR TRUNC_DIV_EXPR
136418334Speter
136518334Speter/* Define this as 1 if `char' should by default be signed; else as 0.  */
136618334Speter#define DEFAULT_SIGNED_CHAR 1
136718334Speter
136818334Speter/* Max number of bytes we can move from memory to memory
136918334Speter   in one reasonably fast instruction.  */
137018334Speter#define MOVE_MAX 4
137118334Speter
137218334Speter/* MOVE_RATIO is the number of move instructions that is better than a
137318334Speter   block move.  Make this large on i386, since the block move is very
137418334Speter   inefficient with small blocks, and the hard register needs of the
137518334Speter   block move require much reload work. */
137618334Speter#define MOVE_RATIO 5
137718334Speter
137818334Speter/* Define this if zero-extension is slow (more than one real instruction).  */
137918334Speter/* #define SLOW_ZERO_EXTEND */
138018334Speter
138118334Speter/* Nonzero if access to memory by bytes is slow and undesirable.  */
138218334Speter#define SLOW_BYTE_ACCESS 0
138318334Speter
138418334Speter/* Define if shifts truncate the shift count
138518334Speter   which implies one can omit a sign-extension or zero-extension
138618334Speter   of a shift count.  */
138718334Speter/* One i386, shifts do truncate the count.  But bit opcodes don't. */
138818334Speter
138918334Speter/* #define SHIFT_COUNT_TRUNCATED */
139018334Speter
139118334Speter/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
139218334Speter   is done just by pretending it is already truncated.  */
139318334Speter#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
139418334Speter
139518334Speter/* We assume that the store-condition-codes instructions store 0 for false
139618334Speter   and some other value for true.  This is the value stored for true.  */
139718334Speter
139818334Speter#define STORE_FLAG_VALUE 1
139918334Speter
140018334Speter/* When a prototype says `char' or `short', really pass an `int'.
140118334Speter   (The 386 can't easily push less than an int.)  */
140218334Speter
140318334Speter#define PROMOTE_PROTOTYPES
140418334Speter
140518334Speter/* Specify the machine mode that pointers have.
140618334Speter   After generation of rtl, the compiler makes no further distinction
140718334Speter   between pointers and any other objects of this machine mode.  */
140818334Speter#define Pmode SImode
140918334Speter
141018334Speter/* A function address in a call instruction
141118334Speter   is a byte address (for indexing purposes)
141218334Speter   so give the MEM rtx a byte's mode.  */
141318334Speter#define FUNCTION_MODE QImode
141418334Speter
141518334Speter/* Define this if addresses of constant functions
141618334Speter   shouldn't be put through pseudo regs where they can be cse'd.
141718334Speter   Desirable on the 386 because a CALL with a constant address is
141818334Speter   not much slower than one with a register address.  On a 486,
141918334Speter   it is faster to call with a constant address than indirect.  */
142018334Speter#define NO_FUNCTION_CSE
142118334Speter
142218334Speter/* Provide the costs of a rtl expression.  This is in the body of a
142318334Speter   switch on CODE. */
142418334Speter
142518334Speter#define RTX_COSTS(X,CODE,OUTER_CODE)				\
142618334Speter  case MULT:							\
142718334Speter    return COSTS_N_INSNS (20);					\
142818334Speter  case DIV:							\
142918334Speter  case UDIV:							\
143018334Speter  case MOD:							\
143118334Speter  case UMOD:							\
143218334Speter    return COSTS_N_INSNS (20);					\
143318334Speter  case ASHIFTRT:						\
143418334Speter  case LSHIFTRT:						\
143518334Speter  case ASHIFT:							\
143618334Speter    return (4 + rtx_cost (XEXP (X, 0), OUTER_CODE)		\
143718334Speter	    + rtx_cost (XEXP (X, 1), OUTER_CODE));		\
143818334Speter  case PLUS:							\
143918334Speter    if (GET_CODE (XEXP (X, 0)) == MULT				\
144018334Speter	&& GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT	\
144118334Speter	&& (INTVAL (XEXP (XEXP (X, 0), 1)) == 2			\
144218334Speter	    || INTVAL (XEXP (XEXP (X, 0), 1)) == 4		\
144318334Speter	    || INTVAL (XEXP (XEXP (X, 0), 1)) == 8))		\
144418334Speter      return (2 + rtx_cost (XEXP (XEXP (X, 0), 0), OUTER_CODE)	\
144518334Speter	      + rtx_cost (XEXP (X, 1), OUTER_CODE));		\
144618334Speter    break;
144718334Speter
144818334Speter
144918334Speter/* Compute the cost of computing a constant rtl expression RTX
145018334Speter   whose rtx-code is CODE.  The body of this macro is a portion
145118334Speter   of a switch statement.  If the code is computed here,
145218334Speter   return it with a return statement.  Otherwise, break from the switch.  */
145318334Speter
145418334Speter#define CONST_COSTS(RTX,CODE,OUTER_CODE) \
145518334Speter  case CONST_INT:						\
145618334Speter  case CONST:							\
145718334Speter  case LABEL_REF:						\
145818334Speter  case SYMBOL_REF:						\
145918334Speter    return flag_pic && SYMBOLIC_CONST (RTX) ? 2 : 0;		\
146018334Speter  case CONST_DOUBLE:						\
146118334Speter    {								\
146218334Speter      int code;							\
146318334Speter      if (GET_MODE (RTX) == VOIDmode)				\
146418334Speter	return 2;						\
146518334Speter      code = standard_80387_constant_p (RTX);			\
146618334Speter      return code == 1 ? 0 :					\
146718334Speter	     code == 2 ? 1 :					\
146818334Speter			 2;					\
146918334Speter    }
147018334Speter
147118334Speter/* Compute the cost of an address.  This is meant to approximate the size
147218334Speter   and/or execution delay of an insn using that address.  If the cost is
147318334Speter   approximated by the RTL complexity, including CONST_COSTS above, as
147418334Speter   is usually the case for CISC machines, this macro should not be defined.
147518334Speter   For aggressively RISCy machines, only one insn format is allowed, so
147618334Speter   this macro should be a constant.  The value of this macro only matters
147718334Speter   for valid addresses.
147818334Speter
147918334Speter   For i386, it is better to use a complex address than let gcc copy
148018334Speter   the address into a reg and make a new pseudo.  But not if the address
148118334Speter   requires to two regs - that would mean more pseudos with longer
148218334Speter   lifetimes.  */
148318334Speter
148418334Speter#define ADDRESS_COST(RTX) \
148518334Speter  ((CONSTANT_P (RTX)						\
148618334Speter    || (GET_CODE (RTX) == PLUS && CONSTANT_P (XEXP (RTX, 1))	\
148718334Speter	&& REG_P (XEXP (RTX, 0)))) ? 0				\
148818334Speter   : REG_P (RTX) ? 1						\
148918334Speter   : 2)
149018334Speter
149118334Speter/* Add any extra modes needed to represent the condition code.
149218334Speter
149318334Speter   For the i386, we need separate modes when floating-point equality
149418334Speter   comparisons are being done.  */
149518334Speter
149618334Speter#define EXTRA_CC_MODES CCFPEQmode
149718334Speter
149818334Speter/* Define the names for the modes specified above.  */
149918334Speter#define EXTRA_CC_NAMES "CCFPEQ"
150018334Speter
150118334Speter/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
150218334Speter   return the mode to be used for the comparison.
150318334Speter
150418334Speter   For floating-point equality comparisons, CCFPEQmode should be used.
150518334Speter   VOIDmode should be used in all other cases.  */
150618334Speter
150718334Speter#define SELECT_CC_MODE(OP,X,Y) \
150818334Speter  (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT			\
150918334Speter   && ((OP) == EQ || (OP) == NE) ? CCFPEQmode : VOIDmode)
151018334Speter
151118334Speter/* Define the information needed to generate branch and scc insns.  This is
151218334Speter   stored from the compare operation.  Note that we can't use "rtx" here
151318334Speter   since it hasn't been defined!  */
151418334Speter
151518334Speterextern struct rtx_def *(*i386_compare_gen)(), *(*i386_compare_gen_eq)();
151618334Speter
151718334Speter/* Tell final.c how to eliminate redundant test instructions.  */
151818334Speter
151918334Speter/* Here we define machine-dependent flags and fields in cc_status
152018334Speter   (see `conditions.h').  */
152118334Speter
152218334Speter/* Set if the cc value is actually in the 80387, so a floating point
152318334Speter   conditional branch must be output.  */
152418334Speter#define CC_IN_80387 04000
152518334Speter
152618334Speter/* Set if the CC value was stored in a nonstandard way, so that
152718334Speter   the state of equality is indicated by zero in the carry bit.  */
152818334Speter#define CC_Z_IN_NOT_C 010000
152918334Speter
153018334Speter/* Store in cc_status the expressions
153118334Speter   that the condition codes will describe
153218334Speter   after execution of an instruction whose pattern is EXP.
153318334Speter   Do not alter them if the instruction would not alter the cc's.  */
153418334Speter
153518334Speter#define NOTICE_UPDATE_CC(EXP, INSN) \
153618334Speter  notice_update_cc((EXP))
153718334Speter
153818334Speter/* Output a signed jump insn.  Use template NORMAL ordinarily, or
153918334Speter   FLOAT following a floating point comparison.
154018334Speter   Use NO_OV following an arithmetic insn that set the cc's
154118334Speter   before a test insn that was deleted.
154218334Speter   NO_OV may be zero, meaning final should reinsert the test insn
154318334Speter   because the jump cannot be handled properly without it.  */
154418334Speter
154518334Speter#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV)			\
154618334Speter{								\
154718334Speter  if (cc_prev_status.flags & CC_IN_80387)			\
154818334Speter    return FLOAT;						\
154918334Speter  if (cc_prev_status.flags & CC_NO_OVERFLOW)			\
155018334Speter    return NO_OV;						\
155118334Speter  return NORMAL;						\
155218334Speter}
155318334Speter
155418334Speter/* Control the assembler format that we output, to the extent
155518334Speter   this does not vary between assemblers.  */
155618334Speter
155718334Speter/* How to refer to registers in assembler output.
155818334Speter   This sequence is indexed by compiler's hard-register-number (see above). */
155918334Speter
156018334Speter/* In order to refer to the first 8 regs as 32 bit regs prefix an "e"
156118334Speter   For non floating point regs, the following are the HImode names.
156218334Speter
156318334Speter   For float regs, the stack top is sometimes referred to as "%st(0)"
156418334Speter   instead of just "%st".  PRINT_REG handles this with the "y" code.  */
156518334Speter
156618334Speter#define HI_REGISTER_NAMES \
156718334Speter{"ax","dx","cx","bx","si","di","bp","sp",          \
156818334Speter "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)","" }
156918334Speter
157018334Speter#define REGISTER_NAMES HI_REGISTER_NAMES
157118334Speter
157218334Speter/* Table of additional register names to use in user input.  */
157318334Speter
157418334Speter#define ADDITIONAL_REGISTER_NAMES \
157518334Speter{ "eax", 0, "edx", 1, "ecx", 2, "ebx", 3,	\
157618334Speter  "esi", 4, "edi", 5, "ebp", 6, "esp", 7,	\
157718334Speter  "al", 0, "dl", 1, "cl", 2, "bl", 3,		\
157818334Speter  "ah", 0, "dh", 1, "ch", 2, "bh", 3 }
157918334Speter
158018334Speter/* Note we are omitting these since currently I don't know how
158118334Speterto get gcc to use these, since they want the same but different
158218334Speternumber as al, and ax.
158318334Speter*/
158418334Speter
158518334Speter/* note the last four are not really qi_registers, but
158618334Speter   the md will have to never output movb into one of them
158718334Speter   only a movw .  There is no movb into the last four regs */
158818334Speter
158918334Speter#define QI_REGISTER_NAMES \
159018334Speter{"al", "dl", "cl", "bl", "si", "di", "bp", "sp",}
159118334Speter
159218334Speter/* These parallel the array above, and can be used to access bits 8:15
159318334Speter   of regs 0 through 3. */
159418334Speter
159518334Speter#define QI_HIGH_REGISTER_NAMES \
159618334Speter{"ah", "dh", "ch", "bh", }
159718334Speter
159818334Speter/* How to renumber registers for dbx and gdb.  */
159918334Speter
160018334Speter/* {0,2,1,3,6,7,4,5,12,13,14,15,16,17}  */
160118334Speter#define DBX_REGISTER_NUMBER(n) \
160218334Speter((n) == 0 ? 0 : \
160318334Speter (n) == 1 ? 2 : \
160418334Speter (n) == 2 ? 1 : \
160518334Speter (n) == 3 ? 3 : \
160618334Speter (n) == 4 ? 6 : \
160718334Speter (n) == 5 ? 7 : \
160818334Speter (n) == 6 ? 4 : \
160918334Speter (n) == 7 ? 5 : \
161018334Speter (n) + 4)
161118334Speter
161218334Speter/* This is how to output the definition of a user-level label named NAME,
161318334Speter   such as the label on a static function or variable NAME.  */
161418334Speter
161518334Speter#define ASM_OUTPUT_LABEL(FILE,NAME)	\
161618334Speter  (assemble_name (FILE, NAME), fputs (":\n", FILE))
161718334Speter
161818334Speter/* This is how to output an assembler line defining a `double' constant.  */
161918334Speter
162018334Speter#define ASM_OUTPUT_DOUBLE(FILE,VALUE)					\
162118334Speterdo { long l[2];								\
162218334Speter     REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l);				\
162318334Speter     if (sizeof (int) == sizeof (long))					\
162418334Speter       fprintf (FILE, "%s 0x%x,0x%x\n", ASM_LONG, l[0], l[1]);		\
162518334Speter     else								\
162618334Speter       fprintf (FILE, "%s 0x%lx,0x%lx\n", ASM_LONG, l[0], l[1]);	\
162718334Speter   } while (0)
162818334Speter
162918334Speter/* This is how to output a `long double' extended real constant. */
163018334Speter
163118334Speter#undef ASM_OUTPUT_LONG_DOUBLE
163218334Speter#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE)  		\
163318334Speterdo { long l[3];						\
163418334Speter     REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l);	\
163518334Speter     if (sizeof (int) == sizeof (long))			\
163618334Speter       fprintf (FILE, "%s 0x%x,0x%x,0x%x\n", ASM_LONG, l[0], l[1], l[2]); \
163718334Speter     else						\
163818334Speter       fprintf (FILE, "%s 0x%lx,0x%lx,0x%lx\n", ASM_LONG, l[0], l[1], l[2]); \
163918334Speter   } while (0)
164018334Speter
164118334Speter/* This is how to output an assembler line defining a `float' constant.  */
164218334Speter
164318334Speter#define ASM_OUTPUT_FLOAT(FILE,VALUE)			\
164418334Speterdo { long l;						\
164518334Speter     REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);		\
164618334Speter     if (sizeof (int) == sizeof (long))			\
164718334Speter       fprintf ((FILE), "%s 0x%x\n", ASM_LONG, l);	\
164818334Speter     else						\
164918334Speter       fprintf ((FILE), "%s 0x%lx\n", ASM_LONG, l);	\
165018334Speter   } while (0)
165118334Speter
165218334Speter/* Store in OUTPUT a string (made with alloca) containing
165318334Speter   an assembler-name for a local static variable named NAME.
165418334Speter   LABELNO is an integer which is different for each call.  */
165518334Speter
165618334Speter#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)	\
165718334Speter( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),	\
165818334Speter  sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
165918334Speter
166018334Speter
166118334Speter
166218334Speter/* This is how to output an assembler line defining an `int' constant.  */
166318334Speter
166418334Speter#define ASM_OUTPUT_INT(FILE,VALUE)  \
166518334Speter( fprintf (FILE, "%s ", ASM_LONG),		\
166618334Speter  output_addr_const (FILE,(VALUE)),		\
166718334Speter  putc('\n',FILE))
166818334Speter
166918334Speter/* Likewise for `char' and `short' constants.  */
167018334Speter/* is this supposed to do align too?? */
167118334Speter
167218334Speter#define ASM_OUTPUT_SHORT(FILE,VALUE)  \
167318334Speter( fprintf (FILE, "%s ", ASM_SHORT),		\
167418334Speter  output_addr_const (FILE,(VALUE)),		\
167518334Speter  putc('\n',FILE))
167618334Speter
167718334Speter/*
167818334Speter#define ASM_OUTPUT_SHORT(FILE,VALUE)  \
167918334Speter( fprintf (FILE, "%s ", ASM_BYTE_OP),		\
168018334Speter  output_addr_const (FILE,(VALUE)),		\
168118334Speter  fputs (",", FILE),		      		\
168218334Speter  output_addr_const (FILE,(VALUE)),		\
168318334Speter  fputs (" >> 8\n",FILE))
168418334Speter*/
168518334Speter
168618334Speter
168718334Speter#define ASM_OUTPUT_CHAR(FILE,VALUE)  \
168818334Speter( fprintf (FILE, "%s ", ASM_BYTE_OP),		\
168918334Speter  output_addr_const (FILE, (VALUE)),		\
169018334Speter  putc ('\n', FILE))
169118334Speter
169218334Speter/* This is how to output an assembler line for a numeric constant byte.  */
169318334Speter
169418334Speter#define ASM_OUTPUT_BYTE(FILE,VALUE)  \
169518334Speter  fprintf ((FILE), "%s 0x%x\n", ASM_BYTE_OP, (VALUE))
169618334Speter
169718334Speter/* This is how to output an insn to push a register on the stack.
169818334Speter   It need not be very fast code.  */
169918334Speter
170018334Speter#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
170118334Speter  fprintf (FILE, "\tpushl e%s\n", reg_names[REGNO])
170218334Speter
170318334Speter/* This is how to output an insn to pop a register from the stack.
170418334Speter   It need not be very fast code.  */
170518334Speter
170618334Speter#define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
170718334Speter  fprintf (FILE, "\tpopl e%s\n", reg_names[REGNO])
170818334Speter
170918334Speter/* This is how to output an element of a case-vector that is absolute.
171018334Speter     */
171118334Speter
171218334Speter#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
171318334Speter  fprintf (FILE, "%s %s%d\n", ASM_LONG, LPREFIX, VALUE)
171418334Speter
171518334Speter/* This is how to output an element of a case-vector that is relative.
171618334Speter   We don't use these on the 386 yet, because the ATT assembler can't do
171718334Speter   forward reference the differences.
171818334Speter */
171918334Speter
172018334Speter#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
172118334Speter  fprintf (FILE, "\t.word %s%d-%s%d\n",LPREFIX, VALUE,LPREFIX, REL)
172218334Speter
172318334Speter/* Define the parentheses used to group arithmetic operations
172418334Speter   in assembler code.  */
172518334Speter
172618334Speter#define ASM_OPEN_PAREN ""
172718334Speter#define ASM_CLOSE_PAREN ""
172818334Speter
172918334Speter/* Define results of standard character escape sequences.  */
173018334Speter#define TARGET_BELL 007
173118334Speter#define TARGET_BS 010
173218334Speter#define TARGET_TAB 011
173318334Speter#define TARGET_NEWLINE 012
173418334Speter#define TARGET_VT 013
173518334Speter#define TARGET_FF 014
173618334Speter#define TARGET_CR 015
173718334Speter
173818334Speter/* Print operand X (an rtx) in assembler syntax to file FILE.
173918334Speter   CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
174018334Speter   The CODE z takes the size of operand from the following digit, and
174118334Speter   outputs b,w,or l respectively.
174218334Speter
174318334Speter   On the 80386, we use several such letters:
174418334Speter   f -- float insn (print a CONST_DOUBLE as a float rather than in hex).
174518334Speter   L,W,B,Q,S,T -- print the opcode suffix for specified size of operand.
174618334Speter   R -- print the prefix for register names.
174718334Speter   z -- print the opcode suffix for the size of the current operand.
174818334Speter   * -- print a star (in certain assembler syntax)
174918334Speter   w -- print the operand as if it's a "word" (HImode) even if it isn't.
175018334Speter   b -- print the operand as if it's a byte (QImode) even if it isn't.
175118334Speter   c -- don't print special prefixes before constant operands.  */
175218334Speter
175318334Speter#define PRINT_OPERAND_PUNCT_VALID_P(CODE)				\
175418334Speter  ((CODE) == '*')
175518334Speter
175618334Speter/* Print the name of a register based on its machine mode and number.
175718334Speter   If CODE is 'w', pretend the mode is HImode.
175818334Speter   If CODE is 'b', pretend the mode is QImode.
175918334Speter   If CODE is 'k', pretend the mode is SImode.
176018334Speter   If CODE is 'h', pretend the reg is the `high' byte register.
176118334Speter   If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */
176218334Speter
176318334Speterextern char *hi_reg_name[];
176418334Speterextern char *qi_reg_name[];
176518334Speterextern char *qi_high_reg_name[];
176618334Speter
176718334Speter#define PRINT_REG(X, CODE, FILE) \
176818334Speter  do { if (REGNO (X) == ARG_POINTER_REGNUM)		\
176918334Speter	 abort ();					\
177018334Speter       fprintf (FILE, "%s", RP);			\
177118334Speter       switch ((CODE == 'w' ? 2 			\
177218334Speter		: CODE == 'b' ? 1			\
177318334Speter		: CODE == 'k' ? 4			\
177418334Speter		: CODE == 'y' ? 3			\
177518334Speter		: CODE == 'h' ? 0			\
177618334Speter		: GET_MODE_SIZE (GET_MODE (X))))	\
177718334Speter	 {						\
177818334Speter	 case 3:					\
177918334Speter	   if (STACK_TOP_P (X))				\
178018334Speter	     {						\
178118334Speter	       fputs ("st(0)", FILE);			\
178218334Speter	       break;					\
178318334Speter	     }						\
178418334Speter	 case 4:					\
178518334Speter	 case 8:					\
178618334Speter	 case 12:					\
178718334Speter	   if (! FP_REG_P (X)) fputs ("e", FILE);	\
178818334Speter	 case 2:					\
178918334Speter	   fputs (hi_reg_name[REGNO (X)], FILE);	\
179018334Speter	   break;					\
179118334Speter	 case 1:					\
179218334Speter	   fputs (qi_reg_name[REGNO (X)], FILE);	\
179318334Speter	   break;					\
179418334Speter	 case 0:					\
179518334Speter	   fputs (qi_high_reg_name[REGNO (X)], FILE);	\
179618334Speter	   break;					\
179718334Speter	 }						\
179818334Speter     } while (0)
179918334Speter
180018334Speter#define PRINT_OPERAND(FILE, X, CODE)  \
180118334Speter  print_operand (FILE, X, CODE)
180218334Speter
180318334Speter#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
180418334Speter  print_operand_address (FILE, ADDR)
180518334Speter
180618334Speter/* Print the name of a register for based on its machine mode and number.
180718334Speter   This macro is used to print debugging output.
180818334Speter   This macro is different from PRINT_REG in that it may be used in
180918334Speter   programs that are not linked with aux-output.o.  */
181018334Speter
181118334Speter#define DEBUG_PRINT_REG(X, CODE, FILE) \
181218334Speter  do { static char *hi_name[] = HI_REGISTER_NAMES;	\
181318334Speter       static char *qi_name[] = QI_REGISTER_NAMES;	\
181418334Speter       fprintf (FILE, "%d %s", REGNO (X), RP);	\
181518334Speter       if (REGNO (X) == ARG_POINTER_REGNUM)		\
181618334Speter	 { fputs ("argp", FILE); break; }		\
181718334Speter       if (STACK_TOP_P (X))				\
181818334Speter	 { fputs ("st(0)", FILE); break; }		\
181918334Speter       if (FP_REG_P (X))				\
182018334Speter	 { fputs (hi_name[REGNO(X)], FILE); break; }	\
182118334Speter       switch (GET_MODE_SIZE (GET_MODE (X)))		\
182218334Speter	 {						\
182318334Speter	 default:					\
182418334Speter	   fputs ("e", FILE);				\
182518334Speter	 case 2:					\
182618334Speter	   fputs (hi_name[REGNO (X)], FILE);		\
182718334Speter	   break;					\
182818334Speter	 case 1:					\
182918334Speter	   fputs (qi_name[REGNO (X)], FILE);		\
183018334Speter	   break;					\
183118334Speter	 }						\
183218334Speter     } while (0)
183318334Speter
183418334Speter/* Output the prefix for an immediate operand, or for an offset operand.  */
183518334Speter#define PRINT_IMMED_PREFIX(FILE)  fputs (IP, (FILE))
183618334Speter#define PRINT_OFFSET_PREFIX(FILE)  fputs (IP, (FILE))
183718334Speter
183818334Speter/* Routines in libgcc that return floats must return them in an fp reg,
183918334Speter   just as other functions do which return such values.
184018334Speter   These macros make that happen.  */
184118334Speter
184218334Speter#define FLOAT_VALUE_TYPE float
184318334Speter#define INTIFY(FLOATVAL) FLOATVAL
184418334Speter
184518334Speter/* Nonzero if INSN magically clobbers register REGNO.  */
184618334Speter
184718334Speter/* #define INSN_CLOBBERS_REGNO_P(INSN, REGNO)	\
184818334Speter    (FP_REGNO_P (REGNO)				\
184918334Speter     && (GET_CODE (INSN) == JUMP_INSN || GET_CODE (INSN) == BARRIER))
185018334Speter*/
185118334Speter
185218334Speter/* a letter which is not needed by the normal asm syntax, which
185318334Speter   we can use for operand syntax in the extended asm */
185418334Speter
185518334Speter#define ASM_OPERAND_LETTER '#'
185618334Speter
185718334Speter#define RET return ""
185818334Speter#define AT_SP(mode) (gen_rtx (MEM, (mode), stack_pointer_rtx))
185918334Speter
186018334Speter/* Functions in i386.c */
186118334Speterextern void override_options ();
186218334Speterextern void order_regs_for_local_alloc ();
186318334Speterextern int i386_valid_decl_attribute_p ();
186418334Speterextern int i386_valid_type_attribute_p ();
186518334Speterextern int i386_return_pops_args ();
186618334Speterextern int i386_comp_type_attributes ();
186718334Speterextern void init_cumulative_args ();
186818334Speterextern void function_arg_advance ();
186918334Speterextern struct rtx_def *function_arg ();
187018334Speterextern int function_arg_partial_nregs ();
187118334Speterextern void output_op_from_reg ();
187218334Speterextern void output_to_reg ();
187318334Speterextern char *singlemove_string ();
187418334Speterextern char *output_move_double ();
187518334Speterextern char *output_move_memory ();
187618334Speterextern char *output_move_pushmem ();
187718334Speterextern int standard_80387_constant_p ();
187818334Speterextern char *output_move_const_single ();
187918334Speterextern int symbolic_operand ();
188018334Speterextern int call_insn_operand ();
188118334Speterextern int expander_call_insn_operand ();
188218334Speterextern int symbolic_reference_mentioned_p ();
188318334Speterextern void emit_pic_move ();
188418334Speterextern void function_prologue ();
188518334Speterextern int simple_386_epilogue ();
188618334Speterextern void function_epilogue ();
188718334Speterextern int legitimate_address_p ();
188818334Speterextern struct rtx_def *legitimize_pic_address ();
188918334Speterextern struct rtx_def *legitimize_address ();
189018334Speterextern void print_operand ();
189118334Speterextern void print_operand_address ();
189218334Speterextern void notice_update_cc ();
189318334Speterextern void split_di ();
189418334Speterextern int binary_387_op ();
189518334Speterextern int shift_op ();
189618334Speterextern int VOIDmode_compare_op ();
189718334Speterextern char *output_387_binary_op ();
189818334Speterextern char *output_fix_trunc ();
189918334Speterextern char *output_float_compare ();
190018334Speterextern char *output_fp_cc0_set ();
190118334Speterextern void save_386_machine_status ();
190218334Speterextern void restore_386_machine_status ();
190318334Speterextern void clear_386_stack_locals ();
190418334Speterextern struct rtx_def *assign_386_stack_local ();
190518334Speter
190618334Speter/* Variables in i386.c */
190718334Speterextern char *i386_reg_alloc_order;		/* register allocation order */
190818334Speterextern char *i386_regparm_string;		/* # registers to use to pass args */
190918334Speterextern char *i386_align_loops_string;		/* power of two alignment for loops */
191018334Speterextern char *i386_align_jumps_string;		/* power of two alignment for non-loop jumps */
191118334Speterextern char *i386_align_funcs_string;		/* power of two alignment for functions */
191218334Speterextern int i386_regparm;			/* i386_regparm_string as a number */
191318334Speterextern int i386_align_loops;			/* power of two alignment for loops */
191418334Speterextern int i386_align_jumps;			/* power of two alignment for non-loop jumps */
191518334Speterextern int i386_align_funcs;			/* power of two alignment for functions */
191618334Speterextern char *hi_reg_name[];			/* names for 16 bit regs */
191718334Speterextern char *qi_reg_name[];			/* names for 8 bit regs (low) */
191818334Speterextern char *qi_high_reg_name[];		/* names for 8 bit regs (high) */
191918334Speterextern enum reg_class regclass_map[];		/* smalled class containing REGNO */
192018334Speterextern struct rtx_def *i386_compare_op0;	/* operand 0 for comparisons */
192118334Speterextern struct rtx_def *i386_compare_op1;	/* operand 1 for comparisons */
192218334Speter
192318334Speter/* External variables used */
192418334Speterextern int optimize;			/* optimization level */
192518334Speterextern int obey_regdecls;		/* TRUE if stupid register allocation */
192618334Speter
192718334Speter/* External functions used */
192818334Speterextern struct rtx_def *force_operand ();
192918334Speter
193018334Speter/*
193118334SpeterLocal variables:
193218334Speterversion-control: t
193318334SpeterEnd:
193418334Speter*/
1935