/* This file contains changes made by Data General, December 1989.  */

/* Definitions of target machine for GNU compiler, for the Motorola 88000 chip.
   Copyright (C) 1988 Free Software Foundation, Inc.
   Contributed by Michael Tiemann (tiemann@mcc.com)
   Other changes by:
	Michael Meissner	
	Tom Wood		(wood@dg-rtp.dg.com)
	john hassey		(hassey@dg-rtp.dg.com)

This file is part of GNU CC.

GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.

GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */


/* Note that some other tm- files include this one and then override
   some of the various spec files.  At present, tm-m88kdgux.h is the
   only one.  */


/* External types used.  */

/* Define the format for the comment output_load_const_int produces.  */
enum m88k_comment_mode {
  m88k_comment_int,			/* print int in comment */
  m88k_comment_double,			/* print floating point */
  m88k_comment_none,			/* no comment */
  m88k_comment_last			/* end of enum marker */
};

/* How to build an integer constant from the raw instructions.  */
enum m88k_int_classify {
  m88k_int_zero,			/* 0, use r0 */
  m88k_int_positive_16_bits,		/* int fits in 16 bits, use or */
  m88k_int_negative_16_bits,		/* -int fits in 16 bits, use subu */
  m88k_int_lo16,			/* truncate constant to 16 bits */
  m88k_int_hi16,			/* bottom 16 bits are 0, use or.u */
  m88k_int_set,				/* mask of 1's, use a set instruction*/
  m88k_int_32_bits,			/* can't use one instruction, use two*/
  m88k_int_last				/* end of enum marker */
};

/* Max dimensions to store for debug information (limited by COFF).  */
#define MAX_DEBUG_DIMS	6


/* External variables/functions defined in output-m88k.c.  */

extern char *m88k_function_name;		/* Current function name */
extern char *m88k_tab_align;			/* Tab to align operands */
extern char *m88k_comment;			/* Assembler comment char */
extern char *m88k_ls_name;			/* cached lit synth name */

extern int m88k_prologue_done;			/* Ln are now allowed */
extern int m88k_ocs_label;			/* Last ocs debug label # */
extern int m88k_frame_used;			/* r30 is the frame pointer */
extern int m88k_need_frame;			/* frame pointer needed */
extern int m88k_fp_offset;			/* offset of FP if used */
extern int m88k_stack_size;			/* size of stack (inc frame) */
extern int m88k_ap_offset;			/* offset of arg ptr+offset */
extern int m88k_ls_offset;			/* cached lit synth offset */
extern int m88k_ls_label;			/* cached lit synth label # */
extern int m88k_stack_extra;			/* additional stack allocated*/
extern int m88k_variable_stack;			/* variable size stack? */
extern int m88k_number_dims;			/* # of dimensions for SDB */
extern int m88k_debug_size;			/* size of debug object */

extern int m88k_debug_dims[MAX_DEBUG_DIMS];	/* dimensions for debugging */

extern void m88k_options ();			/* detect option clashes */
extern void m88k_print_float ();		/* print floating pt in ASCII*/
extern void m88k_output_reg_adjust ();		/* adjust a reg by an amount */
extern void m88k_function_prologue ();		/* emit function prologue */
extern void m88k_function_epilogue ();		/* emit function epilogue */
extern void m88k_preserve_registers ();		/* save/restore regs r14-r25 */
extern void m88k_output_tdesc ();		/* OCS debug info (TDESC) */
extern void m88k_arg_advance ();		/* advance to next arg pos. */

extern void gen_movstrsi_no_loop ();		/* blockmove code w/o loops */
extern void gen_movstrsi_loop ();		/* blockmove code w/ loops */

extern struct rtx_def *m88k_func_call_arg ();	/* caller passes arg in reg? */
extern struct rtx_def *m88k_func_param_arg ();	/* callee's arg is in reg? */

extern int any_operand ();			/* always return true */
extern int reg_or_0_operand ();			/* != 0 if register or 0 */
extern int arith_operand ();			/* != 0 if reg./16 bit uns. */
extern int arith32_operand ();			/* != 0 if reg. or constant */
extern int arith64_operand ();			/* != 0 if 64 bit reg./const*/
extern int int5_operand ();			/* != 0 if [0..31] */
extern int int16_operand ();			/* != 0 if [0..65535] */
extern int int32_operand ();			/* != 0 if int constant */
extern int mak_mask_operand ();			/* != 0 if bitmask for mak */
extern int bbx_mask_operand ();			/* != 0 if bitmask for bb? */
extern int signed16_operand ();			/* != 0 if [-32768..32767] */
extern int real_or_0_operand ();		/* != 0 if register or 0.0 */
extern int real_power_of_2_operand (); 		/* != 0 if 2**n (dbl/flt) */
extern int double_0_operand ();			/* != 0 if double 0.0 */
extern int float_0_operand ();			/* != 0 if float 0.0 */
extern int simple_address_operand ();		/* != 0 if legitimate addr.*/
extern int relop ();				/* != 0 if relational op */
extern int relop_no_unsigned ();		/* != 0 if signed relop */
extern int plus_minus_operator ();		/* != 0 if op is + or - */
extern int delay_operand ();			/* != 0 if delay src #1 */
extern int delay_register_operand ();		/* != 0 if delay reg dest */
extern int delay_reg_or_0_operand ();		/* != 0 if delay mem src */
extern int delay_memory_operand ();		/* != 0 if delay mem dest */
extern int delay_use_next_insn_p ();	 	/* != 0 if delay br. safe #3*/

extern int  m88k_dbr_slots_after ();		/* # delay slots in br/call */
extern int  m88k_dbr_insn_slots ();		/* # delay slots in insn */
extern int  m88k_dbr_insn_eligible_p ();	/* != 0 if insn can fill slot*/
extern void m88k_dbr_output_seqend ();		/* output any final dbr stuff*/

extern void output_ascii ();			/* emit an appropriate string*/
extern void output_ls_address ();		/* emit literal synthesis lda*/
extern void output_arg_ptr ();			/* emit arg pointer setup */
extern void output_label ();			/* emit a label */

extern char *output_load_const_int ();		/* int const -> register */
extern char *output_load_const_float ();	/* float const -> register */
extern char *output_load_const_double ();	/* double const -> register */
extern char *output_load_const_address ();	/* load address -> register */
extern char *output_divide_by_power_of_2 ();	/* divide by 2**n (flt/dbl) */
extern char *output_and ();			/* and instructions */
extern char *output_ior ();			/* inclusive or instructions */
extern char *output_xor ();			/* exclusive or instructions */
extern char *output_move_double ();		/* double word/register move */
extern char *output_br_or_call ();		/* emit a branch or call */
extern char *output_delay_insn ();		/* fill a branch delay slot */

						/* -fomit-frame-ptr support */
extern struct rtx_def *m88k_fix_frame_pointer_address ();
extern void m88k_revoke_fp_decision ();		/* actions to revoke */
						/* find out how to optimally */
						/* construct an int constant */
extern enum m88k_int_classify classify_int_const ();


/* external variables defined elsewhere in the compiler */

extern int target_flags;			/* -m compiler switches */
extern int may_call_alloca;			/* alloca called */
extern int current_function_pretend_args_size;	/* args size without ... */
extern int flag_delayed_branch;			/* -fdelayed-branch */


/* print subsidiary information on the compiler version in use.  */
#define	TM_SCCS_ID	"@(#)tm-m88k.h	1.37.3.1 3/16/90 15:43:12"

#if defined(__DATE__)
#define TARGET_VERSION	fprintf(stderr, "%s (88k, %s)", ".3", __DATE__);
#else
#define TARGET_VERSION	fprintf(stderr, "%s (88k)", ".3");
#endif


/* Run-time compilation parameters selecting different hardware subsets.  */

/* Macro to define tables used to set the flags.
   This is a list in braces of pairs in braces,
   each pair being { "NAME", VALUE }
   where VALUE is the bits to set or minus the bits to clear.
   An empty string NAME is used to identify the default VALUE.  */

#define	MASK_LITERAL_SYNTHESIS	0x00000001	/* do or.u/<memop> pairs  */
#define MASK_TRACE_FUNCTION	0x00000002	/* trace function entry/exits*/
#define MASK_DOUBLE_MEMORY_REFS	0x00000004	/* do do ld.d/st.d/xmem.d */
/*				0x00000008 */
#define	MASK_REORDER		0x00000010	/* run reorder asm. optimizer*/
#define	MASK_CONST_USES_DATA	0x00000020	/* R/O data in data not text */
/*				0x00000040 */
#define MASK_OCS_DEBUG_INFO	0x00000080	/* emit .tdesc info */
#define MASK_STATIC_LIT_SYNTH	0x00000100	/* Use r25 as ptr to data */
#define MASK_STUPID_DEBUGGER	0x00000200	/* put func. name in label */
#define MASK_IDENTIFY_REVISION	0x00000400	/* emit ident, with GCC rev */
#define MASK_WARN_PASS_STRUCT	0x00000800	/* warn about passed structs */
#define MASK_NO_UNDERSCORES	0x00001000	/* don't emit a leading `_' */
#define MASK_TRAP_LARGE_SHIFT	0x00002000	/* Trap if shift not <= 31 */
#define MASK_HANDLE_LARGE_SHIFT	0x00004000	/* Handle shift count >= 32 */
#define MASK_TWO_UNDERSCORES    0x00008000	/* put out two leading `_'s */
#define MASK_CHECK_ZERO_DIV	0x00010000	/* check for int div. by 0 */
#define MASK_USE_DIV		0x00020000	/* no signed div. checks */
#define MASK_OCS_FRAME_POSITION	0x00040000	/* debug frame = CFA, not r30*/
#define MASK_BLOCK_MOVE		0x00080000	/* enable block move builtins */

#define MASK_EITHER_LIT_SYNTH	(MASK_LITERAL_SYNTHESIS | \
				 MASK_STATIC_LIT_SYNTH)

#define MASK_EITHER_LARGE_SHIFT	(MASK_TRAP_LARGE_SHIFT | \
				 MASK_HANDLE_LARGE_SHIFT)

#define	TARGET_LITERAL_SYNTHESIS  (target_flags & MASK_LITERAL_SYNTHESIS)
#define TARGET_TRACE_FUNCTION	  (target_flags & MASK_TRACE_FUNCTION)
#define TARGET_DOUBLE_MEMORY_REFS (target_flags & MASK_DOUBLE_MEMORY_REFS)
#define	TARGET_REORDER		  (target_flags & MASK_REORDER)
#define	TARGET_CONST_USES_DATA	  (target_flags & MASK_CONST_USES_DATA)
#define TARGET_OCS_DEBUG_INFO	  (target_flags & MASK_OCS_DEBUG_INFO)
#define TARGET_STATIC_LIT_SYNTH   (target_flags & MASK_STATIC_LIT_SYNTH)
#define	TARGET_STUPID_DEBUGGER	  (target_flags & MASK_STUPID_DEBUGGER)
#define TARGET_IDENTIFY_REVISION  (target_flags & MASK_IDENTIFY_REVISION)
#define TARGET_WARN_PASS_STRUCT   (target_flags & MASK_WARN_PASS_STRUCT)
#define TARGET_NO_UNDERSCORES	  (target_flags & MASK_NO_UNDERSCORES)
#define TARGET_TRAP_LARGE_SHIFT   (target_flags & MASK_TRAP_LARGE_SHIFT)
#define TARGET_HANDLE_LARGE_SHIFT (target_flags & MASK_HANDLE_LARGE_SHIFT)
#define TARGET_TWO_UNDERSCORES	  (target_flags & MASK_TWO_UNDERSCORES)
#define TARGET_CHECK_ZERO_DIV	  (target_flags & MASK_CHECK_ZERO_DIV)
#define	TARGET_USE_DIV		  (target_flags & MASK_USE_DIV)
#define TARGET_OCS_FRAME_POSITION (target_flags & MASK_OCS_FRAME_POSITION)
#define TARGET_BLOCK_MOVE	  (target_flags & MASK_BLOCK_MOVE)

#define TARGET_EITHER_LIT_SYNTH   (target_flags & MASK_EITHER_LIT_SYNTH)
#define TARGET_EITHER_LARGE_SHIFT (target_flags & MASK_EITHER_LARGE_SHIFT)

#ifndef	TARGET_DEFAULT		/* also set in tm-m88kdgux.h */
#define TARGET_DEFAULT	(MASK_LITERAL_SYNTHESIS  | \
			 MASK_DOUBLE_MEMORY_REFS | \
			 MASK_CHECK_ZERO_DIV	 | \
			 MASK_BLOCK_MOVE)
#endif

#define TARGET_SWITCHES \
  { \
    { "literal-synthesis",		 MASK_LITERAL_SYNTHESIS }, \
    { "no-literal-synthesis",		-MASK_LITERAL_SYNTHESIS }, \
    { "trace-function",			 MASK_TRACE_FUNCTION }, \
    { "no-trace-function",		-MASK_TRACE_FUNCTION }, \
    { "double-memory-refs",		 MASK_DOUBLE_MEMORY_REFS }, \
    { "no-double-memory-refs",		-MASK_DOUBLE_MEMORY_REFS }, \
    { "reorder",			 MASK_REORDER }, \
    { "no-reorder",			-MASK_REORDER }, \
    { "const-uses-data",		 MASK_CONST_USES_DATA }, \
    { "const-uses-text",		-MASK_CONST_USES_DATA }, \
    { "no-const-uses-data",		-MASK_CONST_USES_DATA }, \
    { "delay-slot",			 0 }, \
    { "no-delay-slot",			 0 }, \
    { "static-literal-synthesis",	 MASK_STATIC_LIT_SYNTH }, \
    { "no-static-literal-synthesis",	-MASK_STATIC_LIT_SYNTH }, \
    { "ocs-debug-info",			 MASK_OCS_DEBUG_INFO }, \
    { "no-ocs-debug-info",		-MASK_OCS_DEBUG_INFO }, \
    { "stupid-debugger",		 MASK_STUPID_DEBUGGER }, \
    { "identify-revision",		 MASK_IDENTIFY_REVISION }, \
    { "warn-passed-structs",		 MASK_WARN_PASS_STRUCT }, \
    { "no-underscores",			 MASK_NO_UNDERSCORES }, \
    { "trap-large-shift",		 MASK_TRAP_LARGE_SHIFT }, \
    { "no-trap-large-shift",		-MASK_TRAP_LARGE_SHIFT }, \
    { "handle-large-shift",		 MASK_HANDLE_LARGE_SHIFT }, \
    { "no-handle-large-shift",		-MASK_HANDLE_LARGE_SHIFT }, \
    { "two-underscores",		 MASK_TWO_UNDERSCORES }, \
    { "check-zero-division",		 MASK_CHECK_ZERO_DIV }, \
    { "no-check-zero-division",		-MASK_CHECK_ZERO_DIV }, \
    { "use-div-instruction",		 MASK_USE_DIV }, \
    { "no-use-div-instruction",		-MASK_USE_DIV }, \
    { "ocs-frame-position",		 MASK_OCS_FRAME_POSITION }, \
    { "no-ocs-frame-position",		-MASK_OCS_FRAME_POSITION }, \
    { "block-move",			 MASK_BLOCK_MOVE }, \
    { "no-block-move",			-MASK_BLOCK_MOVE }, \
\
    /* the following are used only in the *_SPEC's */ \
    { "silicon-filter",			 0 }, \
    { "no-silicon-filter",		 0 }, \
    { "count-cycles",			 0 }, \
\
    /* Default switches */ \
    { "",				 TARGET_DEFAULT }, \
  }

/* Do any checking or such that is needed after processing the -m switches.
   Because reorder is not too bright, we have to tell the rest of the
   compiler to only put one space after the opcode.  */

#define OVERRIDE_OPTIONS m88k_options ()


/* Names to predefine in the preprocessor for this target machine.  */
/* tm-m88kdgux.h also defines this.  */

#ifndef	CPP_PREDEFINES
#define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -D__CLASSIFY_TYPE__"
#endif


/* Nonstandard specs on how to call the compiler, linker, etc. */

#ifndef CPP_SPEC
#define	CPP_SPEC "\
	%{ansi:-D__CLASSIFY_TYPE__} \
	%{!mno-block-move:%{O:%{!Umemcpy:-Dmemcpy=__builtin_memcpy}}} \
	%{!mno-block-move:%{O:%{!Ustrcpy:-Dstrcpy=__builtin_strcpy}}} \
	%{O:%{!Umemcmp:-Dmemcmp=__builtin_memcmp}} \
	%{O:%{!Ustrcmp:-Dstrcmp=__builtin_strcmp}}"
#endif

#ifndef CC1_SPEC
#ifdef KEEP_FRAME_POINTER
#define CC1_SPEC "\
\
%{mdelay-slot:%{!fdelayed-branch:%{!O:-fdelayed-branch}}} \
%{O:%{!fdelayed-branch:%{!fno-delayed-branch:%{!mno-delay-slot:-fdelayed-branch}}}}"

#else
#define CC1_SPEC "\
\
%{mdelay-slot:%{!fdelayed-branch:%{!O:-fdelayed-branch}}} \
%{O:%{!fdelayed-branch:%{!fno-delayed-branch:%{!mno-delay-slot:-fdelayed-branch}}}} \
%{O:%{!fomit-frame-pointer:%{!fno-omit-frame-pointer:%{!p:%{!pg: \
	%{!g:-fomit-frame-pointer}}} \
	%{g:%{mocs-frame-position:-fomit-frame-pointer}}}}}"
#endif
#endif

/* Run the silicon filter if desired.  */
#ifndef CC2_SPEC
#define CC2_SPEC "\
\
%{msilicon-filter: %{!pipe: -o %g.sf} |\n\
sifilter -gr \
	%{pipe:%{S: - %{*o*}%{!o*:%b.s}}} \
	%{!pipe:%g.sf %{S:%{*o*}%{!o*:%b.s}}%{!S:%g.s}} \
	%~ }"
#endif


/* Define abort to not drop core, and issue fatal ("internal compiler
   error") by defining it to be fancy_abort.  */

#undef abort
extern void fancy_abort ();
#define	abort() fancy_abort()


/* Define this to be nonzero if the character `$' should be allowed
   by default in identifier names.  */

#define	DOLLARS_IN_IDENTIFIERS	1


/* Macros to deal with OCS debug information */

#define OCS_START_PREFIX	"Ltb"
#define OCS_END_PREFIX		"Lte"

#define PUT_OCS_FUNCTION_START(FILE) \
  { ASM_OUTPUT_INTERNAL_LABEL (FILE, OCS_START_PREFIX, m88k_ocs_label); }

#define PUT_OCS_FUNCTION_END(FILE) \
  { ASM_OUTPUT_INTERNAL_LABEL (FILE, OCS_END_PREFIX, m88k_ocs_label); }


/* Macros to output ctor/dtor section stuff */

#define CTORS_SECTION_ASM_OP	"\tsection\t.ctors,\"xmP\""
#define DTORS_SECTION_ASM_OP	"\tsection\t.dtors,\"xmP\""


/* Macros to deal with SDB debug information */

#ifndef DBX_DEBUGGING_INFO
#define SDB_DEBUGGING_INFO

/* Output structure tag names even when it causes a forward reference. */
#define SDB_ALLOW_FORWARD_REFERENCES

	/* Print out extra debug information in the assembler file */


	/* Print out extra debug information in the assembler file */

#define PUT_SDB_SCL(a)						\
  do {								\
    register int s = (a);					\
    register char *scl;						\
    switch (s)							\
      {								\
      case C_EFCN:	scl = "end of function";	break;	\
      case C_NULL:	scl = "NULL storage class";	break;	\
      case C_AUTO:	scl = "automatic";		break;	\
      case C_EXT:	scl = "external";		break;	\
      case C_STAT:	scl = "static";			break;	\
      case C_REG:	scl = "register";		break;	\
      case C_EXTDEF:	scl = "external definition";	break;	\
      case C_LABEL:	scl = "label";			break;	\
      case C_ULABEL:	scl = "undefined label";	break;	\
      case C_MOS:	scl = "structure member";	break;	\
      case C_ARG:	scl = "argument";		break;	\
      case C_STRTAG:	scl = "structure tag";		break;	\
      case C_MOU:	scl = "union member";		break;	\
      case C_UNTAG:	scl = "union tag";		break;	\
      case C_TPDEF:	scl = "typedef";		break;	\
      case C_USTATIC:	scl = "uninitialized static";	break;	\
      case C_ENTAG:	scl = "enumeration tag";	break;	\
      case C_MOE:	scl = "member of enumeration";	break;	\
      case C_REGPARM:	scl = "register parameter";	break;	\
      case C_FIELD:	scl = "bit field";		break;	\
      case C_BLOCK:	scl = "block start/end";	break;	\
      case C_FCN:	scl = "function start/end";	break;	\
      case C_EOS:	scl = "end of structure";	break;	\
      case C_FILE:	scl = "filename";		break;	\
      case C_LINE:	scl = "line";			break;	\
      case C_ALIAS:	scl = "duplicated tag";		break;	\
      case C_HIDDEN:	scl = "hidden";			break;	\
      default:		scl = "unknown";		break;	\
      }								\
								\
    fprintf(asm_out_file, "\tscl%s %d\t\t\t\t; %s\n",		\
	    m88k_tab_align, s, scl);				\
  } while (0)

#define PUT_SDB_TYPE(a)						\
  do {								\
    register int t = (a);					\
    static char buffer[100];					\
    register char *p = buffer, *q;				\
    register int typ = t;					\
    register int i,d;						\
								\
    for (i = 5; i >= 0; i--)					\
      {								\
	switch ((typ >> ((i*N_TSHIFT) + N_BTSHFT)) & 03)	\
	  {							\
	  case DT_PTR:						\
	    strcpy (p, "ptr to ");				\
	    p += sizeof("ptr to");				\
	    break;						\
								\
	  case DT_ARY:						\
	    strcpy (p, "array of ");				\
	    p += sizeof("array of");				\
	    break;						\
								\
	  case DT_FCN:						\
	    strcpy (p, "func ret ");				\
	    p += sizeof("func ret");				\
	    break;						\
	  }							\
      }								\
								\
  switch (typ & N_BTMASK)					\
    {								\
    case T_NULL:	q = "<no type>";	break;		\
    case T_CHAR:	q = "char";		break;		\
    case T_SHORT:	q = "short";		break;		\
    case T_INT:		q = "int";		break;		\
    case T_LONG:	q = "long";		break;		\
    case T_FLOAT:	q = "float";		break;		\
    case T_DOUBLE:	q = "double";		break;		\
    case T_STRUCT:	q = "struct";		break;		\
    case T_UNION:	q = "union";		break;		\
    case T_ENUM:	q = "enum";		break;		\
    case T_MOE:		q = "enum member";	break;		\
    case T_UCHAR:	q = "unsigned char";	break;		\
    case T_USHORT:	q = "unsigned short";	break;		\
    case T_UINT:	q = "unsigned int";	break;		\
    case T_ULONG:	q = "unsigned long";	break;		\
    default:		q = "void";		break;		\
    }								\
								\
    strcpy (p, q);						\
    fprintf(asm_out_file, "\ttype%s %d\t\t\t\t; %s\n",		\
	    m88k_tab_align, t, buffer);				\
  } while (0)

#define PUT_SDB_INT_VAL(a) \
  fprintf (asm_out_file, "\tval%s %d\n", m88k_tab_align, (a))

#define PUT_SDB_VAL(a)					\
( fprintf (asm_out_file, "\tval%s ", m88k_tab_align),	\
  output_addr_const (asm_out_file, (a)),		\
  fputc ('\n', asm_out_file))

#define PUT_SDB_DEF(a)						\
  do { fprintf (asm_out_file, "\tsdef%s ", m88k_tab_align);	\
    ASM_OUTPUT_LABELREF (asm_out_file, a); 			\
    fputc ('\n', asm_out_file);					\
    m88k_number_dims = m88k_debug_size = 0;			\
  } while (0)

#define PUT_SDB_PLAIN_DEF(a)					\
  do { fprintf(asm_out_file,"\tsdef%s .%s\n", m88k_tab_align, a); \
    m88k_number_dims = m88k_debug_size = 0;			\
  } while (0)

/* Put out any accumulated sizes and dimensions.  */
#define PUT_SDB_ENDEF						\
  { if (m88k_number_dims > 0)					\
      {								\
	int i;							\
	fprintf (asm_out_file, "\tdim%s %d", m88k_tab_align,	\
		 m88k_debug_dims[m88k_number_dims-1]);		\
								\
	for (i = m88k_number_dims - 2; i >= 0; i--)		\
	  fprintf (asm_out_file, ",%d", m88k_debug_dims[i]);	\
								\
	putc ('\n', asm_out_file);				\
      }								\
								\
    if (m88k_debug_size)					\
      fprintf (asm_out_file, "\tsize%s %d\n", m88k_tab_align,	\
	       m88k_debug_size);				\
								\
    m88k_number_dims = m88k_debug_size = 0;			\
    fputs("\tendef\n\n", asm_out_file);				\
  }

/* Save size for later -- multidimensioned arrays will wind up
   emitting more than one size, so punt until we've processed
   the whole declaration.  */
#define PUT_SDB_SIZE(a) (m88k_debug_size = a)

/* Save dimensions to put out all at once at the endef.  */
#define PUT_SDB_DIM(a)						\
  { if (m88k_number_dims < MAX_DEBUG_DIMS)			\
      m88k_debug_dims[m88k_number_dims++] = a;			\
  }

#define PUT_SDB_TAG(a)						\
  do {								\
    fprintf (asm_out_file, "\ttag%s ", m88k_tab_align);		\
    ASM_OUTPUT_LABELREF (asm_out_file, a);			\
    fputc ('\n', asm_out_file);					\
  } while( 0 )

#define PUT_SDB_BLOCK_OR_FUNCTION(NAME, SCL, LINE)		\
  do {								\
    fprintf (asm_out_file, "\n\tsdef%s %s\n\tval\t .\n",	\
	     m88k_tab_align,  NAME);				\
    PUT_SDB_SCL( SCL );						\
    fprintf (asm_out_file, "\tline%s %d\n\tendef\n\n",		\
	     m88k_tab_align, (LINE));				\
  } while (0)

#define PUT_SDB_BLOCK_START(LINE) \
  PUT_SDB_BLOCK_OR_FUNCTION (".bb", C_BLOCK, (LINE))

#define PUT_SDB_BLOCK_END(LINE) \
  PUT_SDB_BLOCK_OR_FUNCTION (".eb", C_BLOCK, (LINE))

#define PUT_SDB_FUNCTION_START(LINE)				\
  do {								\
    fprintf (asm_out_file, "\tln%s 1\n", m88k_tab_align);	\
    PUT_SDB_BLOCK_OR_FUNCTION (".bf", C_FCN, (LINE));		\
    if (TARGET_OCS_DEBUG_INFO)					\
      PUT_OCS_FUNCTION_START (asm_out_file);			\
  } while (0)

#define PUT_SDB_FUNCTION_END(LINE)				\
  do {								\
    if (TARGET_OCS_DEBUG_INFO)					\
      PUT_OCS_FUNCTION_END (asm_out_file);			\
    PUT_SDB_BLOCK_OR_FUNCTION (".ef", C_FCN, (LINE));		\
  } while (0)

#define PUT_SDB_EPILOGUE_END(NAME)				\
  do {								\
    text_section ();						\
    fprintf (asm_out_file, "\n\tsdef%s ", m88k_tab_align);	\
    ASM_OUTPUT_LABELREF(asm_out_file, (NAME));			\
    fputc('\n', asm_out_file);					\
    PUT_SDB_SCL( C_EFCN );					\
    fprintf (asm_out_file, "\tendef\n\n");			\
    if (TARGET_REORDER)						\
      data_section ();						\
  } while (0)

#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
  sprintf ((BUFFER), ".%dfake", (NUMBER));

#define SDB_AUTO_NORMALIZE_OFFSET(offset)			\
  {								\
    if (TARGET_OCS_FRAME_POSITION)				\
      offset += m88k_fp_offset - m88k_stack_size;		\
    else if (!m88k_frame_used)					\
      {								\
	offset += m88k_fp_offset;				\
	if (m88k_variable_stack)				\
	  error ("Variable stack allocated with debugging and no frame"); \
      }								\
  }

#define SDB_ARG_NORMALIZE_OFFSET(offset)			\
  {								\
    if (!TARGET_OCS_FRAME_POSITION) {				\
      offset += m88k_stack_size;				\
      if (m88k_frame_used)					\
	offset -= m88k_fp_offset;				\
      else if (m88k_variable_stack)				\
	error ("Variable stack allocated with debugging and no frame"); \
    }								\
  }
#endif


/* target machine storage layout */

/* Sizes in bits of the various types.  */
#define CHAR_TYPE_SIZE		 8
#define SHORT_TYPE_SIZE		16
#define INT_TYPE_SIZE		32
#define LONG_TYPE_SIZE		32
#define LONG_LONG_TYPE_SIZE	64

#define FLOAT_TYPE_SIZE		32
#define	DOUBLE_TYPE_SIZE	64
#define LONG_DOUBLE_TYPE_SIZE	64


/* Define this if most significant bit is lowest numbered
   in instructions that operate on numbered bit-fields.

   Neither choice seems appropriate for the 88k, if we don't define
   BITS_BIG_ENDIAN, single bit fields come out right, but multibit
   sequences don't (they address the top bit rather than the bottom).
   If we define BITS_BIG_ENDIAN, we have to flip the thing ourself.
   If we define BITS_BIG_ENDIAN differently than BYTES_BIG_ENDIAN,
   it causes problems with expmed.c, and possibly other places (no
   other machine defines BYTES_BIG_ENDIAN without also defining
   BITS_BIG_ENDIAN also).

   Sigh, here a hack, there a hack, everywhere a hack, hack!  */
#define BITS_BIG_ENDIAN

/* Define this if most significant byte of a word is the lowest numbered.  */
/* That is true on the m88000.  */
#define BYTES_BIG_ENDIAN

/* Define this if most significant word of a multiword number is numbered.  */
/* For the m88000 we can decide arbitrarily
   since there are no machine instructions for them.  */
#define WORDS_BIG_ENDIAN

/* number of bits in an addressible storage unit */
#define BITS_PER_UNIT 8

/* Width in bits of a "word", which is the contents of a machine register.
   Note that this is not necessarily the width of data type `int';
   if using 16-bit ints on a 68000, this would still be 32.
   But on a machine with 16-bit registers, this would be 16.  */
#define BITS_PER_WORD 32

/* Width of a word, in units (bytes).  */
#define UNITS_PER_WORD 4

/* Width in bits of a pointer.
   See also the macro `Pmode' defined below.  */
#define POINTER_SIZE 32

/* Allocation boundary (in *bits*) for storing pointers in memory.  */
#define POINTER_BOUNDARY 32

/* Allocation boundary (in *bits*) for storing arguments in argument list.  */
#define PARM_BOUNDARY 32

/* Largest alignment for stack parameters (if greater than PARM_BOUNDARY).  */
#define MAX_PARM_BOUNDARY 64

/* Boundary (in *bits*) on which stack pointer should be aligned.  */
#define STACK_BOUNDARY 64

/* Allocation boundary (in *bits*) for the code of a function.  */
#define FUNCTION_BOUNDARY 32

/* Alignment of field after `int : 0' in a structure.
   Ignored with PCC_BITFIELD_TYPE_MATTERS.  */
#define EMPTY_FIELD_BOUNDARY 32

/* Every structure's size must be a multiple of this.  */
#define STRUCTURE_SIZE_BOUNDARY 8

/* A bitfield declared as `int' forces `int' alignment for the struct.  */
#define PCC_BITFIELD_TYPE_MATTERS

/* Maximum size (in bits) to use for the largest integral type that
   replaces a BLKmode type. */
/* #define MAX_FIXED_MODE_SIZE 0 */

/* Minimum size for BLKmode replacement.  expand_call would otherwise
   treat these BLKmode items as integers.  */
#define MIN_FIXED_MODE_SIZE GET_MODE_BITSIZE (SImode)

/* Don't add STACK_POINTER_OFFSET when doing argument pushes.  */
/* JAH  #define STACK_PUSH_NO_ADD_OFFSET  */

/* No data type wants to be aligned rounder than this.  */
#define BIGGEST_ALIGNMENT 64

/* Specify alignment for string literals (which might be higher than the
   base type's minimnal alignment requirement -- this allows strings to be
   aligned on word boundaries, and optimizes calls to the str* and mem*
   library functions.  */
#define	CONSTANT_ALIGNMENT( type, def_align ) \
  (((type) == STRING_CST) ? 32 : def_align)

/* Define this if move instructions will actually fail to work
   when given unaligned data.  */
#define STRICT_ALIGNMENT

/* Report errors on floating point, if we are given NaN's, or such.  Leave
   the number as is, though, since we output the number in hex, and the
   assemble won't choak on it.  */

#define CHECK_FLOAT_VALUE(MODE,VALUE)					\
  do {									\
     union {								\
       REAL_VALUE_TYPE d;						\
       struct {								\
         unsigned sign	    :  1;					\
         unsigned exponent  : 11;					\
         unsigned mantissa1 : 20;					\
         unsigned mantissa2;						\
       } s;								\
     } u;								\
									\
    if (MODE == DFmode)							\
      {									\
	u.d = VALUE;							\
	if (u.s.mantissa1 != 0 || u.s.mantissa2 != 0)			\
	  {								\
	    if (u.s.exponent == 0x7ff)	/* Not a Number */		\
	      warning ("floating point number is not valid for IEEE double precision"); \
									\
	    else if (u.s.exponent == 0)					\
	      warning ("denormalized double precision floating point number"); \
	  }								\
      }									\
    else if (MODE == SFmode)						\
      {									\
	u.d = REAL_VALUE_TRUNCATE (VALUE);				\
	if (u.s.mantissa1 != 0 || u.s.mantissa2 != 0)			\
	  {								\
	    if (u.s.exponent == 0x7ff)	/* Not a Number */		\
	      warning ("floating point number is not valid for IEEE double precision"); \
									\
	    else if (u.s.exponent == 0)					\
	      warning ("denormalized single precision floating point number"); \
	  }								\
	else if (u.s.exponent == 0x7ff)	/* Infinity */			\
	  warning ("floating point number exceeds range of `float'");	\
      }									\
    else								\
      error ("CHECK_FLOAT_VALUE mode is not DFmode or SFmode");		\
  } while (0)


/* Standard register usage.  */

/* Number of actual hardware registers.
   The hardware registers are assigned numbers for the compiler
   from 0 to just below FIRST_PSEUDO_REGISTER.
   All registers that the compiler knows about must be given numbers,
   even those that are not normally considered general registers.

   the m88000 has 32 fullword registers.

   Note that GNU does not refer to r0 as a general register anywhere,
   so we will use it as a psuedo argument pointer register.  This
   register will never be allocated, and when printed out with
   PRINT_OPERAND it will actually emit references to r30/r31.
   The arg pointer is needed because the machine does not support
   negative constants in addressing (ie, have a frame with the
   arguments on one side, and the local variables on the other).
   Using register 0 is useful, in that it keeps the number of
   registers down to 32, and GNU can use a long as a bitmask
   for the registers.  */

#define FIRST_PSEUDO_REGISTER 32

/* 1 for registers that have pervasive standard uses
   and are not available for the register allocator.
   Registers 14-25 are expected to be preserved across
   function calls.

   On the 88000, these are:
   Reg 0	= Pseudo argument pointer (hardware fixed to 0).
   Reg 1	= Subroutine return pointer (hardware).
   Reg 2-9	= Parameter registers (OCS convention).
   Reg 10	= Condition code register (GNU) [OCS reserved temporary].
   Reg 11	= Static link if needed [OCS reserved temporary].
   Reg 12	= Address of structure return (OCS).
   Reg 13	= Literal synthesis tempory [OCS reserved temporary].
   Reg 14-24	= Preserved register set.
   Reg 25	= Arg pointer (Gnu).
   Reg 26-29	= Reserved by OCS for use in fixing global references.
   Reg 30	= Frame pointer (Common use).
   Reg 31	= Stack pointer (OCS).
   Reg 32	= Psuedo argument pointer.  */

#define FIXED_REGISTERS  \
 {1, 1, 0, 0, 0, 0, 0, 0,	/* r0  .. r7  */ \
  0, 0, 1, 0, 0, 0, 0, 0,	/* r8  .. r15 */ \
  0, 0, 0, 0, 0, 0, 0, 0,	/* r16 .. r23 */ \
  0, 0, 1, 1, 1, 1, 1, 1}	/* r24 .. r31 */ \

/* 1 for registers not available across function calls.
   These must include the FIXED_REGISTERS and also any
   registers that can be used without being saved.
   The latter must include the registers where values are returned
   and the register where structure-value addresses are passed.
   Aside from that, you can include as many other registers as you like.  */

#define CALL_USED_REGISTERS  \
 {1, 1, 1, 1, 1, 1, 1, 1,       /* r0  .. r7  */ \
  1, 1, 1, 1, 1, 1, 0, 0,       /* r8  .. r15 */ \
  0, 0, 0, 0, 0, 0, 0, 0,       /* r16 .. r23 */ \
  0, 0, 1, 1, 1, 1, 1, 1}	/* r24 .. r31 */ \

/* Order in which registers are preferred (most to least).
   Use temp registers, then param registers top down.
   r13 although a temp register is delayed to avoid the
   use of r14 in some cases. */

#define REG_ALLOC_ORDER \
 {12, 11, 10,  9,  8,  7,  6,  5, \
   4,  3,  2,  1,  0, 13, 14, 15, \
  16, 17, 18, 19, 20, 21, 22, 23, \
  24, 25, 26, 27, 28, 29, 30, 31}

/* Return number of consecutive hard regs needed starting at reg REGNO
   to hold something of mode MODE.
   This is ordinarily the length in words of a value of mode MODE
   but can be less for certain modes in special long registers.

   On the m88000, ordinary registers hold 32 bits worth;
   a single floating point register is always enough for
   anything that can be stored in them at all.  */
#define HARD_REGNO_NREGS(REGNO, MODE)   \
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)

/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.

   For double integers, we never put the value into an odd register so that
   the operators don't run into the situation where the high part of one of
   the inputs is the low part of the result register (it's ok if the output
   registers are the same as the input registers.  */

#define HARD_REGNO_MODE_OK(REGNO, MODE) (((MODE) != DImode && (MODE) != DFmode) || ((REGNO) & 1) == 0)

/* Value is 1 if it is a good idea to tie two pseudo registers
   when one has mode MODE1 and one has mode MODE2.
   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
   for any hard reg, then this must be 0 for correct output.  */
#define MODES_TIEABLE_P(MODE1, MODE2) \
  (((MODE1) == DFmode || (MODE1) == DImode) \
   == ((MODE2) == DFmode || (MODE2) == DImode))

/* Specify the registers used for certain standard purposes.
   The values of these macros are register numbers.  */

/* the m88000 pc isn't overloaded on a register that the compiler knows about.  */
/* #define PC_REGNUM  */

/* Register to use for pushing function arguments.  */
#define STACK_POINTER_REGNUM 31

/* Base register for access to local variables of the function.  */
#define FRAME_POINTER_REGNUM 30

/* Value should be nonzero if functions must have frame pointers.
   Zero means the frame pointer need not be set up (and parms
   may be accessed via the stack pointer) in functions that seem suitable.
   This is computed in `reload', in reload1.c.  */
#define FRAME_POINTER_REQUIRED 1

/* Attempt to eliminate the frame pointer. */
/* #define ELIMINATE_FRAME_POINTER */

/* Base register for access to arguments of the function.  */
#define ARG_POINTER_REGNUM 0

/* Register used to hold the condition code. */
#define CONDITION_CODE_REGNUM 10

/* Register in which static-chain is passed to a function.  */
#define STATIC_CHAIN_REGNUM 11

/* Register in which address to store a structure value
   is passed to a function.  */
#define STRUCT_VALUE_REGNUM 12

/* Register to do literal synthesis in, if -mliteral-synthesis.  */
#define	LITERAL_SYNTHESIS_REGNUM	13

/* Register to do static literal synthesis in.  */
#define STATIC_LIT_SYNTH_REGNUM		25

/* Macro to conditionally modify fixed_regs/call_used_regs.  */
#define CONDITIONAL_REGISTER_USAGE		\
  {						\
    if (TARGET_LITERAL_SYNTHESIS)		\
      fixed_regs[LITERAL_SYNTHESIS_REGNUM] = 1;	\
						\
    if (TARGET_STATIC_LIT_SYNTH)		\
      fixed_regs[STATIC_LIT_SYNTH_REGNUM] = 1;	\
  }


/* Define the classes of registers for register constraints in the
   machine description.  Also define ranges of constants.

   One of the classes must always be named ALL_REGS and include all hard regs.
   If there is more than one class, another class must be named NO_REGS
   and contain no registers.

   The name GENERAL_REGS must be the name of a class (or an alias for
   another name such as ALL_REGS).  This is the class of registers
   that is allowed by "g" or "r" in a register constraint.
   Also, registers outside this class are allocated only when
   instructions express preferences for them.

   The classes must be numbered in nondecreasing order; that is,
   a larger-numbered class must never be contained completely
   in a smaller-numbered class.

   For any two classes, it is very desirable that there be another
   class that represents their union.  */
   
/* The 88000 has one kind of registers, hence two classes.  */

enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };

#define N_REG_CLASSES (int) LIM_REG_CLASSES

/* Since GENERAL_REGS is the same class as ALL_REGS,
   don't give it a different class number; just make it an alias.  */

#define GENERAL_REGS ALL_REGS

/* Give names of register classes as strings for dump file.   */

#define REG_CLASS_NAMES {"NO_REGS", "ALL_REGS" }

/* Define which registers fit in which classes.
   This is an initializer for a vector of HARD_REG_SET
   of length N_REG_CLASSES.  */

#define REG_CLASS_CONTENTS {0, -1}

/* The same information, inverted:
   Return the class number of the smallest class containing
   reg number REGNO.  This could be a conditional expression
   or could index an array.  */

#define REGNO_REG_CLASS(REGNO) ALL_REGS

/* The class value for index registers, and the one for base regs.  */
#define INDEX_REG_CLASS ALL_REGS
#define BASE_REG_CLASS ALL_REGS

/* Get reg_class from a letter such as appears in the machine description.  */

#define REG_CLASS_FROM_LETTER(C) NO_REGS

/* The letters I, J, K, L and M in a register constraint string
   can be used to stand for particular ranges of immediate operands.
   This macro defines what the ranges are.
   C is the letter, and VALUE is a constant value.
   Return 1 if VALUE is in the range specified by C.

   For the m88000,  the following contraints are used:
   `I' is used for the range of constants an insn can actually contain.
   `J' is used for the range which is just zero (since that is R0).
   `K' is used for the 5-bit operand of a compare and shift insns.
   `L' is used for the positive and negative 16-bit integers (for add/sub).  */

#ifndef	__GNUC__
#define	__builtin_abs(x) (((x) < 0) ? -(x) : (x))
#endif

#define CONST_OK_FOR_LETTER_P(VALUE, C)  \
  ((C) == 'I' ? (unsigned) (VALUE) < 0x10000		\
   : (C) == 'J' ? (VALUE) == 0				\
   : (C) == 'K' ? (unsigned) (VALUE) < 0x20		\
   : (C) == 'L' ? __builtin_abs (VALUE) < 0x10000	\
   : 0)

/* Similar, but for floating constants, and defining letters G and H.
   Here VALUE is the CONST_DOUBLE rtx itself.  */

#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)		\
  ((C) == 'G' ? (CONST_DOUBLE_HIGH (VALUE) == 0 &&	\
		 CONST_DOUBLE_LOW (VALUE) == 0)		\
   : (C) == 'H' ? real_power_of_2_operand (VALUE)	\
   : 0)
    

/* Given an rtx X being reloaded into a reg required to be
   in class CLASS, return the class of reg to actually use.
   In general this is just CLASS; but on some machines
   in some cases it is preferable to use a more restrictive class.  */
#define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)

/* Return the maximum number of consecutive registers
   needed to represent mode MODE in a register of class CLASS.  */
#define CLASS_MAX_NREGS(CLASS, MODE)	\
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)


/* Stack layout; function entry, exit and calling.  */

/* Define this if pushing a word on the stack
   makes the stack pointer a smaller address.  */
#define STACK_GROWS_DOWNWARD

/* Define this if the nominal address of the stack frame
   is at the high-address end of the local variables;
   that is, each additional local variable allocated
   goes at a more negative offset in the frame.

   Do not define this for the Motorola 88000.  There are no
   negative literals!  */
/* #define FRAME_GROWS_DOWNWARD */

/* Offset within stack frame to start allocating local variables at.
   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
   first local allocated.  Otherwise, it is the offset to the BEGINNING
   of the first local allocated.

   For the m88k, the debugger wants the function's return PC (ie, r1)
   stored at the location r30 points to, and the previous frame pointer
   stored at location r30+4.  */

#define STARTING_FRAME_OFFSET 8

/* /* Actual top-of-stack address includes the homing area if the caller is
   responsibile for creating it.  */

#define STACK_POINTER_OFFSET 0

/* If we generate an insn to push BYTES bytes,
   this says how many the stack pointer really advances by.
   On the m88000, don't define this because there are no push insns.  */
/*  #define PUSH_ROUNDING(BYTES) */

/* If BYTES is the size of arguments for a function call,
   return the size of the argument block (which is BYTES suitably rounded).
   Define this only on machines where the entire call block is allocated
   before the args are stored into it.  */
   
#define ROUND_CALL_BLOCK_SIZE(BYTES)  \
   (((BYTES) + 7) & ~7)

/* Offset of first parameter from the argument pointer register value.
   Using an argument pointer, this is 0 for the m88k.  GCC knows
   how to eliminate the argument pointer references if necessary.  */
#define FIRST_PARM_OFFSET(FNDECL) 0

/* Offset of the first parameter's shadow location from the nominal stack
   pointer value.  (That value is itself computed by adding the value of
   `STACK_POINTER_OFFSET' to the stack pointer register.) */

#if 0
/* jah, the first param is really at offset 0 */
#define FIRST_PARM_CALLER_OFFSET(FNDECL) (0 - STACK_POINTER_OFFSET)
#endif


#undef STACK_ARGS_ADJUST
#define STACK_ARGS_ADJUST(SIZE)         \
{                                      	\
  if (SIZE.constant < 32)         	\
    SIZE.constant = 32;                 \
}

/* When a parameter is passed in a register, stack space is still
   allocated for it.  */
#define REG_PARM_STACK_SPACE

/* Value is 1 if returning from a function call automatically
   pops the arguments described by the number-of-args field in the call.
   FUNTYPE is the data type of the function (as a tree),
   or for a library call it is an identifier node for the subroutine name.  */

#define RETURN_POPS_ARGS(FUNTYPE) 0

/* Define how to find the value returned by a function.
   VALTYPE is the data type of the value (as a tree).
   If the precise function being called is known, FUNC is its FUNCTION_DECL;
   otherwise, FUNC is 0.  */

/* ?? On the m88000 the value is found in the second "output" register.  */

#define FUNCTION_VALUE(VALTYPE, FUNC)  \
  gen_rtx (REG, TYPE_MODE (VALTYPE), 2)

/* ?? But the called function leaves it in the second "input" register.  */

#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC)  \
  gen_rtx (REG, TYPE_MODE (VALTYPE), 2)

/* Disable the promotion of some structures and unions to registers. */
#define RETURN_IN_MEMORY(TYPE) \
  (TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE)
/* Define how to find the value returned by a library function
   assuming the value has mode MODE.  */

#define LIBCALL_VALUE(MODE)  gen_rtx (REG, MODE, 2)

/* 1 if N is a possible register number for a function value
   as seen by the caller.
   On the m88000, the first "output" reg is the only register thus used.  */

#define FUNCTION_VALUE_REGNO_P(N) ((N) == 2)

/* 1 if N is a possible register number for function argument passing.
   On the m88000, these are registers 2 through 9.  */

#define FUNCTION_ARG_REGNO_P(N) ((N) <= 9 && (N) >= 2)

/* Specify how to pad function arguments.
   Value should be `upward', `downward' or `none'.  */

#define FUNCTION_ARG_PADDING(mode, size)		\
  (((mode) == BLKmode)					\
	? upward					\
	: ((GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)	\
		? downward				\
		: none))


/* Define a data type for recording info about an argument list during
   the scan of that argument list.  This data type should hold all
   necessary information about the function itself and about the args
   processed so far, enough to enable macros such as FUNCTION_ARG to
   determine where the next arg should go.

   On the m88000, we need three things: 1) the number of words in the
   argument list; 2) a bitmask of registers r2 - r9, which have
   structures loaded into them which should be saved to the homing
   area of the stack (see FUNCTION_ARG); and 3) whether we are dealing
   with incoming arguments (ie, function definitions), or outgoing
   arguments (ie, function calls).

   Because of bootstrap problems in passing structures, we pass a
   pointer to the appropriate structure instead.  */

enum m88k_args_enum 
{
  m88k_args_initial,
  m88k_args_call,
  m88k_args_function
};

struct m88k_cum_args
{
  int num;			/* number of words passed */
  enum m88k_args_enum which;	/* which type of */
};

#define CUMULATIVE_ARGS struct m88k_cum_args *

/* Initialize a variable CUM of type CUMULATIVE_ARGS
   for a call to a function whose data type is FNTYPE.
   For a library call, FNTYPE is 0. */

#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE) \
  { (CUM) = (struct m88k_cum_args *) alloca (sizeof (struct m88k_cum_args)); \
    (CUM)->num = 0; \
    (CUM)->which = m88k_args_initial; }


/* Figure out the size in words of the function argument. */

#define FUNCTION_ARG_SIZE(MODE, TYPE)	\
  (((((MODE) != BLKmode)		\
	? GET_MODE_SIZE (MODE)		\
	: int_size_in_bytes (TYPE)) + 3) / 4)

/* Update the data in CUM to advance over an argument
   of mode MODE and data type TYPE.
   (TYPE is null for libcalls where that information may not be available.)  */

#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
  m88k_arg_advance (CUM, MODE, TYPE, NAMED)


/* Determine where to put an argument to a function.
   Value is zero to push the argument on the stack,
   or a hard register in which to store the argument.

   MODE is the argument's machine mode, or VOIDmode to indicate
    no more arguments.  The result of FUNCTION_ARG when MODE
    is VOIDmode is passed to the CALL/CALL_VALUE rtx's.  We
    use it to pass the bitmask of which arguments need to be
    stored into the homing area.

   TYPE is the data type of the argument (as a tree).
    This is null for libcalls where that information may
    not be available.

   CUM is a variable of type CUMULATIVE_ARGS which gives info about
    the preceding args and about the function being called.

   NAMED is nonzero if this argument is a named parameter
    (otherwise it is an extra parameter matching an ellipsis).

   On the m88000 the first eight words of args are normally in registers
   and the rest are pushed.  Double precision floating point must be
   double word aligned (and if in a register, starting on an even
   register). Structures and unions which are not 4 byte, and word
   aligned are passed in memory rather than registers, even if they
   would fit completely in the registers under OCS rules.

   Note that FUNCTION_ARG and FUNCTION_INCOMING_ARG are different.
   For structures that are passed in memory, but could have been
   passed in registers, we first load the structure into the
   register, and then when the last argument is passed, we store
   the registers into the stack locations.  This fixes some bugs
   where GCC did not expect to have register arguments, followed
   by stack arguments, followed by register arguments.  */

#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
  m88k_func_call_arg (CUM, MODE, TYPE, NAMED)

#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
  m88k_func_param_arg (CUM, MODE, TYPE, NAMED)

/* Don't adjust the args size for varargs functions */
#define FUNCTION_ARG_REGISTER_VARARGS

/* Define this macro if an argument declared as `char' or
   `short' in a prototype should actually be passed as an
   `int'.  In addition to avoiding errors in certain cases of
   mismatch, it also makes for better code on certain machines.  */

#define PROMOTE_PROTOTYPES


/* Generate the assembly code for function entry.  Moved to be a
   real function in output-m88k.c for easier debugging [mrm]. */

#define FUNCTION_PROLOGUE(FILE, SIZE) m88k_function_prologue(FILE, SIZE)


/* Output assembler code to FILE to increment profiler label # LABELNO
   for profiling a function entry.  */

#ifndef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO)				\
  do {									\
    char label[256];							\
    char *fmt;								\
    fprintf (FILE, "\tsubu%s r31,r31,64\n", m88k_tab_align);		\
    if (TARGET_DOUBLE_MEMORY_REFS)					\
      {									\
	fprintf (FILE, "\tst.d%s r2,r31,0x0000\n", m88k_tab_align);	\
	fprintf (FILE, "\tst.d%s r4,r31,0x0008\n", m88k_tab_align);	\
	fprintf (FILE, "\tst.d%s r6,r31,0x0010\n", m88k_tab_align);	\
	fprintf (FILE, "\tst.d%s r8,r31,0x0018\n", m88k_tab_align);	\
      }									\
    else								\
      {									\
	fprintf (FILE, "\tst%s r2,r31,0x0000\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r3,r31,0x0004\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r4,r31,0x0008\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r5,r31,0x000c\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r6,r31,0x0010\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r7,r31,0x0014\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r8,r31,0x0018\n", m88k_tab_align);	\
	fprintf (FILE, "\tst%s r9,r31,0x001c\n", m88k_tab_align);	\
      }									\
    ASM_GENERATE_INTERNAL_LABEL (label, "LP", LABELNO);			\
    if (TARGET_LITERAL_SYNTHESIS)					\
      {									\
	fprintf (FILE, "\tor.u%s r2,r0,hi16(%s)\n", m88k_tab_align,	\
		 &label[1]);						\
	fmt = "\tor%s r2,r2,lo16(%s)\n";				\
      }									\
    else if (TARGET_STATIC_LIT_SYNTH)					\
      fmt = "\taddu%s r2,r25,lo16(%s)\n";				\
    else								\
      fmt = "\tlda%s r2,r0,%s\n";					\
									\
    fprintf (FILE, "\tbsr.n%s mcount\n", m88k_tab_align);		\
    fprintf (FILE, fmt, m88k_tab_align, &label[1]);			\
    if (!TARGET_REORDER)						\
      fprintf (FILE, "\n");						\
									\
    if (TARGET_DOUBLE_MEMORY_REFS)					\
      {									\
	fprintf (FILE, "\tld.d%s r2,r31,0x0000\n", m88k_tab_align);	\
	fprintf (FILE, "\tld.d%s r4,r31,0x0008\n", m88k_tab_align);	\
	fprintf (FILE, "\tld.d%s r6,r31,0x0010\n", m88k_tab_align);	\
	fprintf (FILE, "\tld.d%s r8,r31,0x0018\n", m88k_tab_align);	\
      }									\
    else								\
      {									\
	fprintf (FILE, "\tld%s r2,r31,0x0000\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r3,r31,0x0004\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r4,r31,0x0008\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r5,r31,0x000c\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r6,r31,0x0010\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r7,r31,0x0014\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r8,r31,0x0018\n", m88k_tab_align);	\
	fprintf (FILE, "\tld%s r9,r31,0x001c\n", m88k_tab_align);	\
      }									\
    fprintf (FILE, "\taddu%s r31,r31,64\n", m88k_tab_align);		\
  } while (0)
#endif


/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
   the stack pointer does not matter.  The value is tested only in
   functions that have frame pointers.
   No definition is equivalent to always zero.  */

#define EXIT_IGNORE_STACK	\
 (get_frame_size () != 0	\
  || may_call_alloca || current_function_pretend_args_size)


/* Generate the assembly code for function exit.  Moved to be a
   real function in output-m88k.c for easier debugging [mrm]. */

#define FUNCTION_EPILOGUE(FILE, SIZE) m88k_function_epilogue(FILE, SIZE)


/* If the memory address ADDR is relative to the frame pointer,
   correct it to be relative to the stack pointer instead.
   This is for when we don't use a frame pointer.
   ADDR should be a variable name.  Moved to be a real function in
   output-m88k.c [tmw].  */

#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH)  \
  (ADDR) = m88k_fix_frame_pointer_address(ADDR, DEPTH)

/* Perform actions needed to revoke the decision to eliminate the
   frame pointer.  */
#define REVOKE_FP_ELIM() m88k_revoke_fp_decision()


/* Addressing modes, and classification of registers for them.  */

/* #define HAVE_POST_INCREMENT */
/* #define HAVE_POST_DECREMENT */

/* #define HAVE_PRE_DECREMENT */
/* #define HAVE_PRE_INCREMENT */

/* Macros to check register numbers against specific register classes.  */

/* These assume that REGNO is a hard or pseudo reg number.
   They give nonzero only if REGNO is a hard reg of the suitable class
   or a pseudo reg currently allocated to a suitable hard reg.
   Since they use reg_renumber, they are safe only once reg_renumber
   has been allocated, which happens in local-alloc.c.  */

#define REGNO_OK_FOR_INDEX_P(REGNO) \
  ((REGNO) < FIRST_PSEUDO_REGISTER || \
   (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)

#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P(REGNO)

/* Now macros that check whether X is a register and also,
   strictly, whether it is in a specified class.

   These macros are specific to the the m88000, and may be used only
   in code for printing assembler insns and in conditions for
   define_optimization.  */


/* Maximum number of registers that can appear in a valid memory address.  */

#define MAX_REGS_PER_ADDRESS 2

/* Recognize any constant value that is a valid address.  */

#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)


/* Nonzero if the constant value X is a legitimate general operand.
   It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */

#define LEGITIMATE_CONSTANT_P(X) (1)

/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
   and check its validity for a certain class.
   We have two alternate definitions for each of them.
   The usual definition accepts all pseudo regs; the other rejects
   them unless they have been allocated suitable hard regs.
   The symbol REG_OK_STRICT causes the latter definition to be used.

   Most source files want to accept pseudo regs in the hope that
   they will get allocated to the class that the insn wants them to be in.
   Source files for reload pass need to be strict.
   After reload, it makes no difference, since pseudo regs have
   been eliminated by then.  */

#ifndef REG_OK_STRICT

/* Nonzero if X is a hard reg that can be used as an index
   or if1 it is a pseudo reg.  */
#define REG_OK_FOR_INDEX_P(X) (1)
/* Nonzero if X is a hard reg that can be used as a base reg
   or if it is a pseudo reg.  */
#define REG_OK_FOR_BASE_P(X) (1)

#else

/* Nonzero if X is a hard reg that can be used as an index.  */
#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
/* Nonzero if X is a hard reg that can be used as a base reg.  */
#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))

#endif


/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
   that is a valid memory address for an instruction.
   The MODE argument is the machine mode for the MEM expression
   that wants to use this address.

   On the m88000, the actual legitimate addresses must be REG+REG or
   REG+SMALLINT.
   But we can treat a SYMBOL_REF as legitimate if it is part of this
   function's constant-pool, because such addresses can actually
   be output as REG+SMALLINT.  */

#define INT_FITS_16_BITS(I) ((unsigned) (I) < 0x10000)

#define FITS_16_BITS(X)	\
   (GET_CODE (X) == CONST_INT && INT_FITS_16_BITS (INTVAL (X)))

#define LEGITIMATE_INDEX_P(X, MODE)   \
   (FITS_16_BITS (X)					\
    || (REG_P (X)					\
	&& REG_OK_FOR_INDEX_P (X))			\
    || (GET_CODE (X) == MULT				\
	&& REG_P (XEXP (X, 0))				\
	&& REG_OK_FOR_INDEX_P (XEXP (X, 0))		\
	&& GET_CODE (XEXP (X, 1)) == CONST_INT		\
	&& (INTVAL (XEXP (X, 1)) == GET_MODE_SIZE (MODE)))	\
    || (GET_CODE (X) == MULT				\
	&& REG_P (XEXP (X, 1))				\
	&& REG_OK_FOR_INDEX_P (XEXP (X, 1))		\
	&& GET_CODE (XEXP (X, 0)) == CONST_INT		\
	&& (INTVAL (XEXP (X, 0)) == GET_MODE_SIZE (MODE))	\
        && (warning ("MULT backwards"), 1))		\
    || (GET_CODE (X) == ZERO_EXTRACT			\
	&& INTVAL (XEXP (X, 1)) == 16			\
	&& INTVAL (XEXP (X, 2)) == 16			\
	&& CONSTANT_P (XEXP (X, 0))))

#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)  	\
{							\
  if (GET_CODE (X) == CONST_INT)			\
    {							\
      if (FITS_16_BITS (X))				\
	goto ADDR;					\
    }							\
  else if (CONSTANT_ADDRESS_P (X))			\
    goto ADDR;						\
  else if (REG_P (X))					\
    {							\
      if (REG_OK_FOR_BASE_P (X))			\
	goto ADDR;					\
    }							\
  else if (GET_CODE (X) == PLUS)			\
    {							\
      if (REG_P (XEXP (X, 0)) 				\
	  && REGNO (XEXP (X, 0)) == ARG_POINTER_REGNUM)	\
	{						\
	  if (FITS_16_BITS (XEXP (X, 1)))		\
	    goto ADDR;					\
	}						\
      else if (REG_P (XEXP (X, 0))			\
	  && REG_OK_FOR_BASE_P (XEXP (X, 0)))		\
	{						\
	  if (LEGITIMATE_INDEX_P (XEXP (X, 1), MODE))	\
	    goto ADDR;					\
	}						\
      else if (REG_P (XEXP (X, 1)) 			\
	  && REGNO (XEXP (X, 1)) == ARG_POINTER_REGNUM)	\
	{						\
	  if (FITS_16_BITS (XEXP (X, 0)))		\
	    goto ADDR;					\
	}						\
      else if (REG_P (XEXP (X, 1))			\
	       && REG_OK_FOR_BASE_P (XEXP (X, 1)))	\
	{						\
	  if (LEGITIMATE_INDEX_P (XEXP (X, 0), MODE))	\
	    goto ADDR;					\
	}						\
     }							\
}


/* Try machine-dependent ways of modifying an illegitimate address
   to be legitimate.  If we find one, return the new, valid address.
   This macro is used in only one place: `memory_address' in explow.c.

   OLDX is the address as it was before break_out_memory_refs was called.
   In some cases it is useful to look at this to decide what needs to be done.

   MODE and WIN are passed so that this macro can use
   GO_IF_LEGITIMATE_ADDRESS.

   It is always safe for this macro to do nothing.  It exists to recognize
   opportunities to optimize the output.  */

/* On the m88000, change REG+N into REG+REG, and REG+(X*Y) into REG+REG.  */

#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)			\
{								\
  if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1)))	\
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\
		   copy_to_mode_reg (SImode, XEXP (X, 1)));	\
  if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0)))	\
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\
		   copy_to_mode_reg (SImode, XEXP (X, 0)));	\
  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT)	\
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\
		   force_operand (XEXP (X, 0), 0));		\
  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT)	\
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\
		   force_operand (XEXP (X, 1), 0));		\
  if (memory_address_p (MODE, X))				\
    goto WIN; }

/* Go to LABEL if ADDR (a legitimate address expression)
   has an effect that depends on the machine mode it is used for.
   On the the m88000 this is never true.  */

#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)


/* Specify the machine mode that this machine uses
   for the index in the tablejump instruction.  */
#define CASE_VECTOR_MODE SImode

/* Define this if a raw index is all that is needed for a
   `tablejump' insn.  */
#define CASE_TAKES_INDEX_RAW

/* Define this if the tablejump instruction expects the table
   to contain offsets from the address of the table.
   Do not define this if the table should contain absolute addresses.  */
/* #define CASE_VECTOR_PC_RELATIVE */

/* Specify the tree operation to be used to convert reals to integers.  */
#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR

/* This is the kind of divide that is easiest to do in the general case.  */
#define EASY_DIV_EXPR TRUNC_DIV_EXPR

/* Define this as 1 if `char' should by default be signed; else as 0.  */
#define DEFAULT_SIGNED_CHAR 1

/* Define this as 1 if plain bitfields should be sign extended; else as 0. */
#define DEFAULT_SIGNED_BIT 0

/* Max number of bytes we can move from memory to memory
   in one reasonably fast instruction.  */
#define MOVE_MAX 64

/* Nonzero if access to memory by bytes is slow and undesirable.  */
#define SLOW_BYTE_ACCESS 0

/* The alignment in bits to promote DECL to for performance reasons.  */
#define FAST_ALIGNED_ACCESS(DECL) 32

/* Do not break .stabs pseudos into continuations.  */
#define DBX_CONTIN_LENGTH 0

/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
   is done just by pretending it is already truncated.  */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1

/* We assume that the store-condition-codes instructions store 0 for false
   and some other value for true.  This is the value stored for true.  */

#define STORE_FLAG_VALUE 1

/* Specify the machine mode that pointers have.
   After generation of rtl, the compiler makes no further distinction
   between pointers and any other objects of this machine mode.  */
#define Pmode SImode

/* A function address in a call instruction
   is a word address (for indexing purposes)
   so give the MEM rtx word mode.  */
#define FUNCTION_MODE SImode

/* Define this if addresses of constant functions
   shouldn't be put through pseudo regs where they can be cse'd.
   Desirable on machines where ordinary constants are expensive
   but a CALL with constant address is cheap.  */
#define NO_FUNCTION_CSE

/* Define this macro if GNU CC should generate calls to the System V
   (and ANSI C) library functions `memcpy' and `memset' rather than
   the BSD functions `bcopy' and `bzero'.  */
#define TARGET_MEM_FUNCTIONS	1

/* Compute the cost of computing a constant rtl expression RTX
   whose rtx-code is CODE.  The body of this macro is a portion
   of a switch statement.  If the code is computed here,
   return it with a return statement.  Otherwise, break from the switch.

   We assume that any 16 bit integer can easily be recreated, so we
   indicate 0 cost, in an attempt to get GCC not to optimize things
   like comparison against a constant.  */

#define CONST_COSTS(RTX,CODE)						\
  case CONST_INT:							\
  {									\
    rtx int_operands[10];						\
									\
    int_operands[0] = (rtx)0;						\
    int_operands[1] = RTX;						\
    if (INT_FITS_16_BITS (INTVAL (RTX)))				\
      return 0;								\
    if (classify_int_const (SImode, int_operands) != m88k_int_32_bits)	\
      return 1;								\
    return 2;								\
  }									\
									\
  case CONST:								\
  case LABEL_REF:							\
  case SYMBOL_REF:							\
    return (TARGET_LITERAL_SYNTHESIS) ? 1 : 0;				\
									\
  case CONST_DOUBLE:							\
    return (GET_MODE (RTX) == SFmode) ? 2 : 4;


/* Tell emit-rtl.c how to initialize special values on a per-function bass.  */
#define CC_STATUS_MDEP int
#define CC_STATUS_MDEP_INIT \
  ((((cc_status.mdep & MDEP_LS_CHANGE) != 0) \
   ? error ("CC_STATUS_INIT MDEP_LS_CHANGE bits were set") \
   : 0), cc_status.mdep = 0)

#define MDEP_LS_CACHE	0x00000001	/* l.s. hi16 value is cached */
#define MDEP_LS_LO16	0x00000002	/* next addr needs r13,lo16() */
#define MDEP_LS_ADDR	0x00000004	/* r13 contains a full address */
#define MDEP_LS_STATIC	0x00000008	/* next addr needs r25,lo16() */
#define MDEP_LS_DELAY	0x00000010	/* l.s. done for delay slot */

#define MDEP_AP_IN_USE	0x00000100	/* arg ptr is used in next addr */
#define MDEP_AP_USE_SP	0x00000200	/* use stack ptr for AP, not FP */
#define MDEP_AP_64K	0x00000400	/* arg ptr offset < 64K */
#define MDEP_AP_USE_LS	0x00000800	/* lit. synth. reg. has AP offset */
#define MDEP_AP_USE_CC	0x00001000	/* cond. code ret. has AP offset */

#define MDEP_AP_MASK	(MDEP_AP_IN_USE | \
			 MDEP_AP_USE_SP | \
			 MDEP_AP_64K    | \
			 MDEP_AP_USE_LS | \
			 MDEP_AP_USE_CC)

#define MDEP_LS_MASK	(MDEP_LS_CACHE  | /* All literal synthesis bits */ \
			 MDEP_LS_LO16   | \
			 MDEP_LS_ADDR   | \
			 MDEP_LS_STATIC | \
			 MDEP_LS_DELAY)

					/* Bits that change the next */
					/* PRINT_ADDRESS_OPERAND call */
#define MDEP_LS_CHANGE	(MDEP_LS_LO16   | \
			 MDEP_LS_STATIC | \
			 MDEP_LS_DELAY  | \
			 MDEP_AP_IN_USE)

#define LIT_SYNTH_NEEDED(op)					\
  (TARGET_EITHER_LIT_SYNTH && GET_CODE (op) == MEM &&		\
   (GET_CODE (XEXP (op, 0)) == SYMBOL_REF ||			\
    GET_CODE (XEXP (op, 0)) == LABEL_REF ||			\
    GET_CODE (XEXP (op, 0)) == CONST))

/* Macro to zap the normal portions of CC_STATUS, but leave the
   machine dependent parts (ie, literal synthesis) alone.  */

#define CC_STATUS_INIT_NO_MDEP \
  (cc_status.flags = 0, cc_status.value1 = 0, cc_status.value2 = 0)


/* Generalized macro to fix up any addresses that need it, possibly
   emitting output_asm_insn's.  Presently it does literal synthesis
   and argument pointer conversion.  */

#define FIX_ADDRESS_IF_NEEDED(op)				\
  do {								\
    rtx op2 = (GET_CODE (op) == MEM) ? XEXP (op, 0) : op;	\
								\
    if (REG_P (op2) && REGNO (op2) == ARG_POINTER_REGNUM)	\
      output_arg_ptr (0);					\
								\
    else if (GET_CODE (op2) == PLUS &&				\
	     REG_P (XEXP (op2, 0)) &&				\
	     REGNO (XEXP (op2, 0)) == ARG_POINTER_REGNUM &&	\
	     GET_CODE (XEXP (op2, 1)) == CONST_INT)		\
      output_arg_ptr (INTVAL (XEXP (op2, 1)));			\
								\
    else if (GET_CODE (op2) == PLUS &&				\
	     REG_P (XEXP (op2, 1)) &&				\
	     REGNO (XEXP (op2, 1)) == ARG_POINTER_REGNUM &&	\
	     GET_CODE (XEXP (op2, 0)) == CONST_INT)		\
      output_arg_ptr (INTVAL (XEXP (op2, 0)));			\
								\
    else if (TARGET_EITHER_LIT_SYNTH)				\
      {								\
	if (GET_CODE (op2) == SYMBOL_REF ||			\
	    GET_CODE (op2) == LABEL_REF ||			\
	    GET_CODE (op2) == CONST)				\
	  output_ls_address (op2, 1);				\
      }								\
  } while (0)
   

/* Generalized macro to do any fixup needed for instructions
   which set a register and fills the branch or call delay slot.
   In particular, we have to make sure that the literal synthesis
   stuff is done before the branch/call instruction is issued.  */

#define DELAY_SLOT_SET_REG(op0, op1)				\
  {								\
    rtx mem = (rtx) 0;						\
								\
    switch (GET_CODE (op1))					\
      {								\
      case MEM:							\
	mem = op1;						\
	break;							\
								\
      case SIGN_EXTEND:						\
      case ZERO_EXTEND:						\
      case SIGN_EXTRACT:					\
      case ZERO_EXTRACT:					\
      case TRUNCATE:						\
	if (GET_CODE (XEXP (op1, 0)) == MEM)			\
	  mem = XEXP (op1, 0);					\
	break;							\
      }								\
								\
    if (mem != (rtx) 0)						\
      {								\
	FIX_ADDRESS_IF_NEEDED (mem);				\
	if ((cc_status.mdep & MDEP_LS_CHANGE) != 0)		\
	  cc_status.mdep |= MDEP_LS_DELAY;			\
      }								\
  }


/* Delayed branch support */

/* Define this macro if the target machine has delayed branches, that is,
   a branch does not take effect immediately, and the actual branch
   instruction may be followed by one or more instructions that will be
   issued before the PC is actually changed.

   If defined, this allows a special scheduling pass to be run after the
   second jump optimization to attempt to reorder instructions to exploit
   this.  Defining this macro also requires the definition of certain
   other macros described below.  */

#define HAVE_DELAYED_BRANCH 1


/* This macro must be defined if `HAVE_DELAYED_BRANCH' is defined.
   Its definition should be a C expression returning the number of
   available delay slots following the instruction(s) output by the
   pattern for INSN.  The definition of "slot" is
   machine-dependent, and may denote instructions, bytes, or whatever.  */

#define DBR_SLOTS_AFTER(INSN) m88k_dbr_slots_after (INSN)


/* This macro must be defined if `HAVE_DELAYED_BRANCH' is defined.
   It should be a C expression returning the number of slots (typically
   the number of machine instructions) consumed by INSN.

   You may assume that INSN is truly an insn, not a note, label,
   barrier, dispatch table, `use', or `clobber'.  */

#define DBR_INSN_SLOTS(INSN) m88k_dbr_insn_slots (INSN)


/* A C expression whose value is non-zero if it is legitimate to put
   INSN in the delay slot following DINSN.

   You do not need to take account of data flow considerations in the
   definition of this macro, because the delayed branch optimizer always
   does that.  This macro is needed only when certain insns may not be
   placed in certain delay slots for reasons not evident from the RTL
   expressions themselves.  If there are no such problems, you don't need
   to define this macro.

   You may assume that INSN is truly an insn, not a note, label,
   barrier, dispatch table, `use', or `clobber'.  You may
   assume that DINSN is a jump insn with a delay slot.  */

#define DBR_INSN_ELIGIBLE_P(INSN, DINSN) \
  m88k_dbr_insn_eligible_p (INSN, DINSN)

/* A C statement to be executed after all slot-filler instructions
   have been output.  If necessary, call `dbr_sequence_length' to
   determine the number of slots filled in a sequence (zero if not
   not currently outputing a sequence), to decide how may no-ops
   to allocate or whatever.

   Don't define this macro if it has nothing to do, but it is
   helpful in reading assembly output if the extend of the delay
   sequences is made explicit (e.g. with white space).
   
   Note that output routines for instructions with delay slots must be
   prepared to deal with not being output as part of a sequence (i.e.
   when the scheduling pass is not run, or when no slot fillers could be
   found.)  The variable `final_sequence' is null when not
   processing a sequence, otherwise it contains the `sequence' rtx
   being output.  */

#define DBR_OUTPUT_SEQEND(FILE) m88k_dbr_output_seqend (FILE)


/* Tell final.c how to eliminate redundant test instructions.  */

/* Store in cc_status the expressions
   that the condition codes will describe
   after execution of an instruction whose pattern is EXP.
   Do not alter them if the instruction would not alter the cc's.  */

#define NOTICE_UPDATE_CC(EXP, INSN) \
{ if (GET_CODE (EXP) == SET)					\
    { if (GET_CODE (SET_DEST (EXP)) == CC0)			\
	{ cc_status.flags = 0;					\
	  cc_status.value1 = SET_DEST (EXP);			\
	  cc_status.value2 = SET_SRC (EXP);			\
	}							\
      else if (GET_CODE (SET_SRC (EXP)) == CALL)		\
	{ CC_STATUS_INIT; }					\
      else if (GET_CODE (SET_DEST (EXP)) == REG)		\
	{ if (cc_status.value1					\
	      && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value1)) \
	    cc_status.value1 = 0;				\
	  if (cc_status.value2					\
	      && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value2)) \
	    cc_status.value2 = 0;				\
	}							\
      else if (GET_CODE (SET_DEST (EXP)) == MEM)		\
	CC_STATUS_INIT_NO_MDEP;					\
    }								\
  else if (GET_CODE (EXP) == PARALLEL				\
	   && GET_CODE (XVECEXP (EXP, 0, 0)) == SET)		\
    { if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == CC0)	\
	{ cc_status.flags = 0;					\
	  cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0));	\
	  cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0));	\
	}							\
      else if (GET_CODE (SET_SRC (XVECEXP (EXP, 0, 0))) == CALL) \
	{ /* all bets are off */ CC_STATUS_INIT; }		\
      else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == REG) \
	{ if (cc_status.value1					\
	      && reg_overlap_mentioned_p (SET_DEST (XVECEXP (EXP, 0, 0)), cc_status.value1)) \
	    cc_status.value1 = 0;				\
	  if (cc_status.value2					\
	      && reg_overlap_mentioned_p (SET_DEST (XVECEXP (EXP, 0, 0)), cc_status.value2)) \
	    cc_status.value2 = 0;				\
	}							\
      else if (GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) == MEM) \
	CC_STATUS_INIT_NO_MDEP;					\
    }								\
  else if (GET_CODE (EXP) == PARALLEL				\
	   && GET_CODE (XVECEXP (EXP, 0, 0)) == REG)		\
  /* insn-peep has changed this insn beyond recognition
     by NOTICE_UPDATE_CC.  However, we know it is either
     a call or a branch with a delay slot filled, so we can
     give up on knowing condition codes in any case.  */	\
     { CC_STATUS_INIT; }					\
  else if (GET_CODE (EXP) == CALL)				\
    { /* all bets are off */ CC_STATUS_INIT; }			\
}


/* Don't let strength reduction attempt to move multiplies out
   of addressing modes.  */

#define DONT_REDUCE_ADDR


/* Control the assembler format that we output.  */

/* Output any initial stuff to the assembly file.  Always put out */
/* a file directive, even if not debugging.

   As of DG/UX 4.30, the ".coffsem" declaration is different.  The
   previous declaration used a storage class not present in the 88open
   OCS.  This causes a gratuitious failure in the 88open BCS tests 
   (no, not OCS--BCS) because the storage class is unknown.

   Immediately after putting out the file, put out a ".coffsem"
   declaration.  This should be harmless on other systems, and
   is used in DG/UX 4.20 by the debuggers to supliment COFF.  The
   fields in the integer value are as follows:

   Bits	Value	Meaning
   ----	-----	-------
   0-1	0	No information about stack locations
	1	Auto/param locations are based on r30
	2	Auto/param locations are based on CFA

   3-2	0	No information on dimension order
	1	Array dims in sym table matches source language
	2	Array dims in sym table is in reverse order

   5-4	0	No information about the case of global names
	1	Global names appear in the symbol table as in the source
	2	Global names have been converted to lower case
	3	Global names have been converted to upper case.  */

#if 1
#define ASM_COFFSEM(FILE)						\
    if (write_symbols == SDB_DEBUG)					\
      {									\
	fprintf (FILE, "sem.%x:\t\t; %s\n",				\
		 (((TARGET_OCS_FRAME_POSITION) ? 2 : 1) << 0) + (1 << 2) + (1 << 4),\
		 (TARGET_OCS_FRAME_POSITION)				\
			? "frame is CFA, normal array dims, case unchanged" \
			: "frame is r30, normal array dims, case unchanged"); \
	fprintf (FILE, "%s", (TARGET_REORDER) ? "\n" : "");		\
      }
#else
#define ASM_COFFSEM(FILE)						\
    if (write_symbols == SDB_DEBUG)					\
      {									\
	fprintf (FILE, "\tsdef%s .coffsem\n", m88k_tab_align);		\
	fprintf (FILE, "\tscl%s 108\n", m88k_tab_align);		\
	fprintf (FILE, "\ttype%s 0\n", m88k_tab_align);			\
	fprintf (FILE, "\tval%s 0x%x\t; %s\n", m88k_tab_align,		\
		 (((TARGET_OCS_FRAME_POSITION) ? 2 : 1) << 0) + (1 << 2) + (1 << 4),\
		 (TARGET_OCS_FRAME_POSITION)				\
			? "frame is CFA, normal array dims, case unchanged" \
			: "frame is r30, normal array dims, case unchanged"); \
	fprintf (FILE, "\tendef\n%s", (TARGET_REORDER) ? "\n" : "");	\
      }
#endif

#define ASM_FILE_START(FILE)						\
  do {									\
    int len, line_len;							\
    char **p;								\
    sdbout_filename ((FILE), main_input_filename);			\
    ASM_COFFSEM(FILE);							\
    fprintf ((FILE), "%s; Cc1 (%s) arguments:",				\
	     (TARGET_REORDER) ? "" : "\n", "1.37.3");		\
    line_len = 32767;							\
    for (p = &save_argv[1]; *p != (char *)0; p++)			\
      if (**p == '-')							\
	{								\
	  len = strlen (*p) + 1;					\
	  if (len + line_len > 79)					\
	    {								\
	      line_len = 1;						\
	      fputs ("\n;", (FILE));					\
	    }								\
	  fprintf ((FILE), " %s", *p);					\
	  line_len += len;						\
        }								\
    fputs ((TARGET_REORDER) ? "\n" : "\n\n", (FILE));			\
									\
    if (TARGET_IDENTIFY_REVISION)					\
      {									\
	extern time_t time ();						\
	extern char *ctime ();						\
	extern int flag_traditional;					\
	time_t now = time ((time_t *)0);				\
	fprintf (FILE, "\tident%s \"@(#)%s [%s on %.24s%s%s%s%s]\"\n%s", \
		 m88k_tab_align,					\
		 main_input_filename,					\
		 "GCC 1.37.3",						\
		 ctime (&now),						\
		 (optimize) ? ", -O" : "",				\
		 (write_symbols != NO_DEBUG) ? ", -g" : "",		\
		 (flag_traditional) ? ", -traditional" : "",		\
		 (profile_flag) ? ", -p" : "",				\
		 (TARGET_REORDER) ? "" : "\n");				\
      }									\
  } while (0)


#define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) \
  fprintf (FILE, "\tfile%s \"%s\"\n", m88k_tab_align, NAME)

#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE)			\
  if (m88k_prologue_done)					\
    fprintf (FILE, "%s\tln%s %d\t\t\t\t; Real source line %d\n",\
	     (TARGET_REORDER) ? "" : "\n",			\
	     m88k_tab_align, LINE - sdb_begin_function_line, LINE)


/* Allow and ignore #sccs directives */
#define SCCS_DIRECTIVE

/* Code to handle #ident directives */
#define ASM_OUTPUT_IDENT(FILE, NAME) \
  fprintf(FILE, "\tident%s \"%s\"\n", m88k_tab_align, NAME)

/* Tell GDB that GCC compiled this file.  */
#define	ASM_IDENTIFY_GCC(file) \
  { if (write_symbols != NO_DEBUG && !TARGET_STUPID_DEBUGGER) \
      fprintf (file, "gcc_compiled.:\n"); }

/* Output to assembler file text saying following lines
   may contain character constants, extra white space, comments, etc.  */

#define ASM_APP_ON ""

/* Output to assembler file text saying following lines
   no longer contain unusual constructs.  */

#define ASM_APP_OFF ""

#define TEXT_SECTION_ASM_OP "\ttext"

/* Output before writable data.  */

#define DATA_SECTION_ASM_OP "\tdata"

/* Output before read only data.  */

#define	RO_DATA_SECTION_ASM_OP \
  ((TARGET_CONST_USES_DATA) ? "\tdata\t\t\t\t; read only" : "\ttext")

/* Format the assembly opcode so that the arguments are all aligned, don't
   do this for reorder, since the program demands only one whitespace char.
   The maximum instruction size is 8 characters (fxxx.xxx), so a tab and a
   space will do to align the output.  */

#define ASM_OUTPUT_OPCODE(STREAM, PTR) \
  { \
    if (!TARGET_REORDER) \
      { \
	int ch; \
	char *orig_ptr; \
\
	for ( orig_ptr = (PTR); \
	     (ch = *(PTR)) != '\0' && ch != ' ' && ch != '\t' && ch != '\n'; \
	     (PTR)++ ) \
	  putc (ch, STREAM); \
\
	if (ch == ' ' && orig_ptr != (PTR) && (PTR) - orig_ptr < 8) \
	  putc ('\t', STREAM); \
      } \
  }


/* How to refer to registers in assembler output.
   This sequence is indexed by compiler's hard-register-number (see above).  */

#define REGISTER_NAMES \
{"ap", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",		\
 "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19",	\
 "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29",	\
 "r30", "r31"}

/* How to renumber registers for dbx and gdb.  */

#define DBX_REGISTER_NUMBER(REGNO) (REGNO)

/* This is how to start a function body */

#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
  do { text_section(); ASM_OUTPUT_LABEL(FILE, NAME); } while (0)

/* This is how to output the definition of a user-level label named NAME,
   such as the label on a static function or variable NAME.  */

#define ASM_OUTPUT_LABEL(FILE,NAME)	\
  do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)

/* This is how to output a command to make the user-level label named NAME
   defined for reference from other files.  */

#define ASM_GLOBALIZE_LABEL(FILE,NAME)			\
  do {							\
    fprintf (FILE, "\tglobal%s ", m88k_tab_align);	\
    assemble_name (FILE, NAME);				\
    putc ('\n', FILE);					\
  } while (0)

/* This is how to output a reference to a user-level label named NAME.
   `assemble_name' uses this.  Because we have defined memcpy to be
   __builtin_memcpy (and so on for strcpy, memcmp, and strcmp), catch
   any references to those names, and turn them back into the standard
   name (memcpy, etc.).  This is a hack.  */

#define ASM_OUTPUT_LABELREF(FILE,NAME)					\
  { char *n = NAME;							\
    char *format;							\
    if (n[0] == '_' &&							\
	memcmp (n, "__builtin_", sizeof ("__builtin_") - 1) == 0)	\
      n += sizeof ("__builtin_") - 1;					\
									\
    if (TARGET_NO_UNDERSCORES)						\
      format = "%s";							\
    else if (TARGET_TWO_UNDERSCORES)					\
      format = "__%s";							\
    else								\
      format = "_%s";							\
									\
    fprintf (FILE, format, n);						\
  }

/* This is how to output an internal numbered label where
   PREFIX is the class of label and NUM is the number within the class.
   The stupid debugger support is for an internal to DG port of sdb
   that can't recognize the difference between local and global symbols
   when doing a stack traceback, so it thinks the procedure calling the
   current one was @L5 or somesuch.  Sigh..........  */

#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)			\
  do {									\
    if (TARGET_STUPID_DEBUGGER &&					\
	PREFIX[0] == 'L' && PREFIX[1] == '\0' &&			\
	m88k_function_name != (char *)0)				\
									\
      fprintf (FILE, "@%s%d.%s:\n", PREFIX, NUM, m88k_function_name);	\
    else								\
      fprintf (FILE, "@%s%d:\n", PREFIX, NUM);				\
  } while (0)

/* This is how to store into the string LABEL
   the symbol_ref name of an internal numbered label where
   PREFIX is the class of label and NUM is the number within the class.
   This is suitable for output with `assemble_name'.  This must agree
   with ASM_OUTPUT_INTERNAL_LABEL above, except for being prefixed
   with an `*'.  */

#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)			\
  do {									\
    if (TARGET_STUPID_DEBUGGER &&					\
	PREFIX[0] == 'L' && PREFIX[1] == '\0' &&			\
	m88k_function_name != (char *)0)				\
									\
      sprintf (LABEL, "*@%s%d.%s", PREFIX, NUM, m88k_function_name);	\
    else								\
      sprintf (LABEL, "*@%s%d", PREFIX, NUM);				\
  } while (0)



/* Internal macro to get a single precision floating point value into
   an int, so we can print it's value in hex.  */

#define FLOAT_TO_INT_INTERNAL( FVALUE, IVALUE )				\
  { union {								\
      REAL_VALUE_TYPE d;						\
      struct {								\
	unsigned sign      :  1;					\
	unsigned exponent1 :  1;					\
	unsigned exponent2 :  3;					\
	unsigned exponent3 :  7;					\
	unsigned mantissa1 : 20;					\
	unsigned mantissa2 :  3;					\
	unsigned mantissa3 : 29;					\
      } s;								\
    } _u;								\
									\
    union {								\
      int i;								\
      struct {								\
        unsigned sign      :  1;					\
	unsigned exponent1 :  1;					\
	unsigned exponent3 :  7;					\
        unsigned mantissa1 : 20;					\
        unsigned mantissa2 :  3;					\
      } s;								\
    } _u2;								\
									\
    _u.d = REAL_VALUE_TRUNCATE (FVALUE);				\
    _u2.s.sign = _u.s.sign;						\
    _u2.s.exponent1 = _u.s.exponent1;					\
    _u2.s.exponent3 = _u.s.exponent3;					\
    _u2.s.mantissa1 = _u.s.mantissa1;					\
    _u2.s.mantissa2 = _u.s.mantissa2;					\
    IVALUE = _u2.i;							\
  }


/* This is how to output an assembler line defining a `double' constant.  */

#define ASM_OUTPUT_DOUBLE(FILE,VALUE)					\
  do {									\
    union { REAL_VALUE_TYPE d; long l[2]; } x;				\
    x.d = (VALUE);							\
    fprintf (FILE, "\tword%s 0x%.8x", m88k_tab_align, x.l[0]);		\
    m88k_print_float (FILE, VALUE, "\t\t\t; double ");			\
    fprintf (FILE, "\n\tword%s 0x%.8x\n", m88k_tab_align, x.l[1]);	\
  } while (0)

/* This is how to output an assembler line defining a `float' constant.  */

#define ASM_OUTPUT_FLOAT(FILE,VALUE)					\
  do {									\
    int i;								\
    FLOAT_TO_INT_INTERNAL (VALUE, i);					\
    fprintf (FILE, "\tword%s 0x%.8x", m88k_tab_align, i);		\
    m88k_print_float (FILE, REAL_VALUE_TRUNCATE (VALUE), "\t\t\t; float "); \
    fprintf (FILE, "\n");						\
  } while (0)

/* This is how to output an assembler line defining an `int' constant.  */

#define ASM_OUTPUT_INT(FILE,VALUE)  \
  do {							\
    if (GET_CODE (VALUE) == CONST_INT)			\
      fprintf (FILE, "\tword%s 0x%08x\t\t\t; %d\n",	\
	       m88k_tab_align,				\
	       INTVAL (VALUE), INTVAL (VALUE));		\
    else						\
      {							\
	fprintf (FILE, "\tword%s ", m88k_tab_align);	\
	output_addr_const (FILE, (VALUE));		\
	putc ('\n', FILE);				\
      }							\
  } while (0)

/* Likewise for `short' and `char' constants.  */

#define ASM_OUTPUT_SHORT(FILE,VALUE)  \
  do {							\
    if (GET_CODE (VALUE) == CONST_INT)			\
      fprintf (FILE, "\thalf%s 0x%04x\t\t\t\t; %d\n",	\
	       m88k_tab_align,				\
	       0xffff & (INTVAL (VALUE)),		\
	       (short) INTVAL (VALUE));			\
    else						\
      {							\
	fprintf (FILE, "\thalf%s ", m88k_tab_align);	\
	output_addr_const (FILE, (VALUE));		\
	putc ('\n', FILE);				\
      }							\
  } while (0)

#define ASM_OUTPUT_CHAR(FILE,VALUE)  \
  do {							\
    if (GET_CODE (VALUE) == CONST_INT)			\
      fprintf (FILE, "\tbyte%s 0x%02x\t\t\t\t; %d\n",	\
	       m88k_tab_align,				\
	       0xff & (INTVAL (VALUE)),			\
	       (char) INTVAL (VALUE));			\
    else						\
      {							\
	fprintf (FILE, "\tbyte%s ", m88k_tab_align);	\
	output_addr_const (FILE, (VALUE));		\
	putc ('\n', FILE);				\
      }							\
  } while (0)

/* This is how to output an assembler line for a numeric constant byte.  */

#define ASM_OUTPUT_BYTE(FILE,VALUE)  \
  fprintf (FILE, "\tbyte%s 0x%x\n", m88k_tab_align, (VALUE))

#define ASM_OUTPUT_ASCII(FILE, P, SIZE)  \
  output_ascii (FILE, P, SIZE)


/* Prologue/Epilogue for case labels.  */

#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, TABLE)		\
  {								\
    if (TARGET_CONST_USES_DATA)					\
      {								\
	ro_data_section ();					\
	fprintf (FILE, "\talign%s 4\n", m88k_tab_align);	\
      }								\
    ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM);		\
  }

#define ASM_OUTPUT_CASE_END(FILE, NUM, TABLE)			\
  {								\
    if (TARGET_CONST_USES_DATA)					\
      text_section ();						\
  }

/* This is how to output an element of a case-vector that is absolute.  */

#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)				\
  do {									\
    char buffer[256];							\
    ASM_GENERATE_INTERNAL_LABEL (buffer, "L", VALUE);			\
    fprintf (FILE, "\tword%s %s\n", m88k_tab_align, &buffer[1]);	\
  } while (0)

/* This is how to output an element of a case-vector that is relative.
   (the m88000 does not use such vectors,
   but we must define this macro anyway.)  */

#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)			\
  do {									\
    char buf1[256], buf2[256];						\
    ASM_GENERATE_INTERNAL_LABEL (buf1, "L", VALUE);			\
    ASM_GENERATE_INTERNAL_LABEL (buf2, "L", REL);			\
    fprintf (FILE, "\tword%s %s-%s\n", m88k_tab_align, &buf1[1], &buf2[1]); \
  } while (0)

/* This is how to output an assembler line
   that says to advance the location counter
   to a multiple of 2**LOG bytes.  */

#define ASM_OUTPUT_ALIGN(FILE,LOG)	\
  if ((LOG) != 0)			\
    fprintf (FILE, "\talign%s %d\n", m88k_tab_align, 1<<(LOG))

#define ASM_OUTPUT_SKIP(FILE,SIZE)  \
  fprintf (FILE, "\tzero%s %d\n", m88k_tab_align, (SIZE))

/* This says how to output an assembler line
   to define a global common symbol.  Size can be zero for
   the unusual case of a `struct { int : 0; }'.  */

#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fprintf ((FILE), "\tcomm%s ", m88k_tab_align),	\
  assemble_name ((FILE), (NAME)),			\
  fprintf ((FILE), ",%d\n", (SIZE) ? (SIZE) : 1))

/* This says how to output an assember line to
   define a local common symbol.  */

#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
( fprintf ((FILE), "\tbss%s ", m88k_tab_align),	\
  assemble_name ((FILE), (NAME)),		\
  fprintf ((FILE), ",%d,%d\n", (SIZE) ? (SIZE) : 1, (SIZE) <= 4 ? 4 : 8))

/* Store in OUTPUT a string (made with alloca) containing
   an assembler-name for a local static variable named NAME.
   LABELNO is an integer which is different for each call.  */

#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)	\
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),	\
  sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))

/* This is how to output an insn to push a register on the stack.
   It need not be very fast code.  (mrm) */

/* Because the Motorola calling convention requires the stack always
   be double word aligned, a hole is left by the push..... */

#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
  fprintf (FILE, "\tsubu%s %s,%s,8\n\tst%s %s,%s,0\n",	\
	   m88k_tab_align,				\
	   reg_names[STACK_POINTER_REGNUM],		\
	   reg_names[STACK_POINTER_REGNUM],		\
	   m88k_tab_align,				\
	   reg_names[REGNO],				\
	   reg_names[STACK_POINTER_REGNUM])

/* This is how to output an insn to pop a register from the stack.
   It need not be very fast code.  (mrm) */

#define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
  fprintf (FILE, "\tld%s %s,%s,0\n\taddu%s %s,%s,8\n",	\
	   m88k_tab_align,				\
	   reg_names[REGNO],				\
	   reg_names[STACK_POINTER_REGNUM],		\
	   m88k_tab_align,				\
	   reg_names[STACK_POINTER_REGNUM],		\
	   reg_names[STACK_POINTER_REGNUM])

/* Define the parentheses used to group arithmetic operations
   in assembler code.  */

#define ASM_OPEN_PAREN "("
#define ASM_CLOSE_PAREN ")"

/* Define results of standard character escape sequences.  */
#define TARGET_BELL 007
#define TARGET_BS 010
#define TARGET_TAB 011
#define TARGET_NEWLINE 012
#define TARGET_VT 013
#define TARGET_FF 014
#define TARGET_CR 015


/* Macros to add extra assembler sections.  */

/* List of names for sections other than text and data.  */
#define EXTRA_SECTIONS in_ro_data ,in_ctors, in_dtors

/* Functions that emit the appropriate code for the extra sections.  */
#define EXTRA_SECTION_FUNCTIONS					\
								\
void								\
ctors_section ()						\
{								\
  if (in_section != in_ctors)					\
    {								\
      fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);	\
      in_section = in_ctors;					\
    }								\
}								\
								\
void								\
dtors_section ()						\
{								\
  if (in_section != in_dtors)					\
    {								\
      fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);	\
      in_section = in_dtors;					\
    }								\
}								\
								\
void								\
ro_data_section ()						\
{								\
  if (in_section != in_ro_data)					\
    {								\
      in_section = in_ro_data;					\
      fprintf (asm_out_file, "%s\n", RO_DATA_SECTION_ASM_OP);	\
    }								\
}

/* A C statement or statements to switch to the appropriate
   section for output of EXP.  EXP is either a `VAR_DECL' node
   or a constant of some sort.  */

#define SELECT_SECTION(EXP)					\
  if (TREE_CODE (EXP) == STRING_CST)				\
    {								\
      if (flag_writable_strings)				\
	data_section ();					\
      else							\
	ro_data_section ();					\
    }								\
  else if (TREE_CODE (EXP) != VAR_DECL)				\
    ro_data_section ();						\
  else if (!TREE_READONLY (EXP) || TREE_VOLATILE (EXP))		\
    data_section ();						\
  else								\
    ro_data_section ();

/* A C statement or statements to switch to the appropriate
   section for output of RTX in mode MODE.  RTX is some kind
   of constant in RTL.  The argument MODE is redundant except
   in the case of a `const_int' rtx.  */

#define SELECT_RTX_SECTION(MODE, RTX) ro_data_section ();


/* Print operand X (an rtx) in assembler syntax to file FILE.
   CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
   For `%' followed by punctuation, CODE is the punctuation and X is null.

   On the m88000, the CODE can be one of the following:

	`a'	(standard), assume operand is an address
	`c'	(standard), assume operand is an immediate value
	`d'	second register of a two register pair
	`i'	print the integer constant in decimal
	`l'	(standard), assume operand is a label_ref
	`n'	(standard), like %c, except negate first
	`r'	an immediate 0 should be repesented as `r0'
	`x'	print the integer constant in hexidecimal (4 digits)
	`B'	bcnd branch values
	`C'	bb0/bb1 branch values for comparisons
	`F'	print a double constant
	`N'	Negate the integer constant, and print in hex (4 digits)
	`R'	reversed bb0/bb1 branch values (do: y op x, not: x op y)
	`X'	print the integer constant in hexidecimal (8 digits)
	`Z'	inverted bcnd branch values (ie, branch false)
	`!'	condition code register
	`@'	literal synthesis register
	`#'	static literal synthesis register
	`;'	current comment character
*/

#define PRINT_OPERAND_PUNCT_VALID_P(c) \
  ((c) == '!' || (c) == '@' || (c) == '#' || (c) == ';')

#define PRINT_OPERAND(FILE, X, CODE)					\
{ if (CODE == '!')							\
    fprintf (FILE, reg_names[CONDITION_CODE_REGNUM]);			\
									\
  else if (CODE == '@')							\
    fprintf (FILE, reg_names[LITERAL_SYNTHESIS_REGNUM]);		\
									\
  else if (CODE == '#')							\
    fprintf (FILE, reg_names[STATIC_LIT_SYNTH_REGNUM]);			\
									\
  else if (CODE == ';')							\
    fputs (m88k_comment, FILE);						\
									\
  else if (GET_CODE (X) == REG						\
	   && REGNO (X) == ARG_POINTER_REGNUM)				\
    fatal ("Arg Pointer found in PRINT_OPERAND");			\
									\
  else if (GET_CODE (X) == REG)						\
    fprintf (FILE, "%s", reg_names[REGNO (X) + ((CODE == 'd')? 1: 0)]);	\
									\
  else if (GET_CODE (X) == MEM)						\
    output_address (XEXP (X, 0));					\
									\
  else if ((CODE) == 'i')						\
    fprintf (FILE, "%d", INTVAL (X));					\
									\
  else if ((CODE) == 'x')						\
    fprintf (FILE, "0x%.4x", INTVAL (X));				\
									\
  else if ((CODE) == 'X')						\
    fprintf (FILE, "0x%.8x", INTVAL (X));				\
									\
  else if ((CODE) == 'N')						\
    fprintf (FILE, "0x%.4x", -INTVAL (X));				\
									\
  else if ((CODE) == 'r' && (X) == const0_rtx)				\
    fprintf (FILE, "r0");						\
									\
  else if ((CODE) == 'F')						\
    {									\
      union real_extract u;						\
      u.i[0] = CONST_DOUBLE_LOW (X);					\
      u.i[1] = CONST_DOUBLE_HIGH (X);					\
      m88k_print_float (FILE, u.d,					\
			(GET_MODE (X) == SFmode) ? "float " : "double "); \
    }									\
									\
  else if (GET_CODE (X) == CONST_DOUBLE)				\
    fatal ("PRINT_OPERAND called with a constant double");		\
									\
  else if (CODE == 'B')							\
    switch (GET_CODE (X))						\
      {									\
      case EQ:	fprintf (FILE, "eq0");	break;				\
      case NE:	fprintf (FILE, "ne0");	break;				\
      case GT:	fprintf (FILE, "gt0");	break;				\
      case LT:	fprintf (FILE, "lt0");	break;				\
      case GE:	fprintf (FILE, "ge0");	break;				\
      case LE:	fprintf (FILE, "le0");	break;				\
									\
      default:								\
	fatal ("PRINT_OPERAND, unknown case for %%B");			\
      }									\
									\
  else if (CODE == 'Z')							\
    switch (GET_CODE (X))						\
      {									\
      case EQ:	fprintf (FILE, "ne0");	break;				\
      case NE:	fprintf (FILE, "eq0");	break;				\
      case GT:	fprintf (FILE, "le0");	break;				\
      case LT:	fprintf (FILE, "ge0");	break;				\
      case GE:	fprintf (FILE, "lt0");	break;				\
      case LE:	fprintf (FILE, "gt0");	break;				\
									\
      default:								\
	fatal ("PRINT_OPERAND, unknown case for %%Z");			\
      }									\
									\
  else if (CODE == 'C')							\
    switch (GET_CODE (X))						\
      {									\
      case EQ:	fprintf (FILE, "eq");	break;				\
      case NE:	fprintf (FILE, "ne");	break;				\
      case GT:	fprintf (FILE, "gt");	break;				\
      case LT:	fprintf (FILE, "lt");	break;				\
      case GE:	fprintf (FILE, "ge");	break;				\
      case LE:	fprintf (FILE, "le");	break;				\
      case GTU:	fprintf (FILE, "hi");	break;				\
      case LTU:	fprintf (FILE, "lo");	break;				\
      case GEU:	fprintf (FILE, "hs");	break;				\
      case LEU:	fprintf (FILE, "ls");	break;				\
									\
      default:								\
	fatal ("PRINT_OPERAND, unknown case for %%C");			\
      }									\
									\
  else if (CODE == 'R')							\
    switch (GET_CODE (X))						\
      {									\
      case EQ:	fprintf (FILE, "eq");	break;				\
      case NE:	fprintf (FILE, "ne");	break;				\
      case GT:	fprintf (FILE, "le");	break;				\
      case LT:	fprintf (FILE, "ge");	break;				\
      case GE:	fprintf (FILE, "lt");	break;				\
      case LE:	fprintf (FILE, "gt");	break;				\
      case GTU:	fprintf (FILE, "ls");	break;				\
      case LTU:	fprintf (FILE, "hs");	break;				\
      case GEU:	fprintf (FILE, "lo");	break;				\
      case LEU:	fprintf (FILE, "hi");	break;				\
									\
      default:								\
	fatal ("PRINT_OPERAND, unknown case for %%R");			\
      }									\
									\
  else { output_addr_const (FILE, X); }}

/* Print a memory address as an operand to reference that memory location.  */

#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  				\
{ register rtx base, index = 0;						\
  register rtx addr = ADDR;						\
  register rtx reg0, reg1;						\
									\
  switch (GET_CODE (addr))						\
    {									\
									\
    case REG:								\
      if (REGNO (addr) == ARG_POINTER_REGNUM)				\
	{								\
	  char *base;							\
	  if ((cc_status.mdep & MDEP_AP_IN_USE) == 0)			\
	    fatal ("PRINT_OPERAND_ADDRESS, arg pointer #1");		\
									\
	  base = ((cc_status.mdep & MDEP_AP_USE_SP) == 0)		\
		? reg_names [FRAME_POINTER_REGNUM]			\
		: reg_names [STACK_POINTER_REGNUM];			\
									\
	  if ((cc_status.mdep & MDEP_AP_64K) != 0)			\
	    fprintf (FILE, "%s,0x%0.4x\t\t\t; %d", base,		\
		     m88k_ap_offset, m88k_ap_offset);			\
									\
	  else if ((cc_status.mdep & MDEP_AP_USE_LS) != 0)		\
	    fprintf (FILE, "%s,%s",					\
		     reg_names[LITERAL_SYNTHESIS_REGNUM], base);	\
									\
	  else if ((cc_status.mdep & MDEP_AP_USE_CC) != 0)		\
	    fprintf (FILE, "%s,%s",					\
		     reg_names[CONDITION_CODE_REGNUM], base);		\
									\
	  else								\
	    fatal ("PRINT_OPERAND_ADDRESS, arg pointer #2");		\
									\
	  cc_status.mdep &= ~ MDEP_AP_MASK;				\
	}								\
      else								\
	fprintf (FILE, "r0,%s", reg_names [REGNO (addr)]);		\
      break;								\
									\
    case PLUS:								\
      reg0 = XEXP (addr, 0);						\
      reg1 = XEXP (addr, 1);						\
      if (GET_CODE (reg0) == MULT || GET_CODE (reg0) == CONST_INT)	\
	{ rtx tmp = reg0; reg0 = reg1; reg1 = tmp; }			\
									\
      if (REG_P (reg0) && REGNO (reg0) == ARG_POINTER_REGNUM &&		\
	  GET_CODE (reg1) == CONST_INT)					\
	{								\
	  char *base;							\
	  if ((cc_status.mdep & MDEP_AP_IN_USE) == 0)			\
	    fatal ("PRINT_OPERAND_ADDRESS, arg pointer #3");		\
									\
	  base = ((cc_status.mdep & MDEP_AP_USE_SP) == 0)		\
		? reg_names [FRAME_POINTER_REGNUM]			\
		: reg_names [STACK_POINTER_REGNUM];			\
									\
	  if ((cc_status.mdep & MDEP_AP_64K) != 0)			\
	    fprintf (FILE, "%s,0x%0.4x\t\t\t; %d", base,		\
		     m88k_ap_offset, m88k_ap_offset);			\
									\
	  else if ((cc_status.mdep & MDEP_AP_USE_LS) != 0)		\
	    fprintf (FILE, "%s,%s",					\
		     reg_names[LITERAL_SYNTHESIS_REGNUM], base);	\
									\
	  else if ((cc_status.mdep & MDEP_AP_USE_CC) != 0)		\
	    fprintf (FILE, "%s,%s",					\
		     reg_names[CONDITION_CODE_REGNUM], base);		\
									\
	  else								\
	    fatal ("PRINT_OPERAND_ADDRESS, arg pointer #4");		\
									\
	  cc_status.mdep &= ~ MDEP_AP_MASK;				\
	}								\
									\
      else if ((REG_P (reg0) && REGNO (reg0) == ARG_POINTER_REGNUM) ||	\
	       (REG_P (reg1) && REGNO (reg1) == ARG_POINTER_REGNUM))	\
	fatal ("PRINT_OPERAND_ADDRESS, arg pointer #5");		\
									\
      else if (REG_P (reg0))						\
	{								\
	  if (REG_P (reg1))						\
	    fprintf (FILE, "%s,%s",					\
		     reg_names [REGNO (reg0)],				\
		     reg_names [REGNO (reg1)]);				\
									\
	  else if (GET_CODE (reg1) == CONST_INT)			\
	    fprintf (FILE, "%s,0x%.4x\t\t\t; %d",			\
		     reg_names [REGNO (reg0)], INTVAL (reg1),		\
		     INTVAL (reg1));					\
									\
	  else if (GET_CODE (reg1) == MULT)				\
	    {								\
	      rtx mreg = XEXP (reg1, 0);				\
	      if (REGNO (mreg) == ARG_POINTER_REGNUM)			\
		fatal ("PRINT_OPERAND_ADDRESS, arg pointer #6");	\
									\
	      fprintf (FILE, "%s[%s]", reg_names[REGNO (reg0)],		\
		       reg_names[REGNO (mreg)]);			\
	    }								\
									\
	  else if (GET_CODE (reg1) == ZERO_EXTRACT)			\
	    {								\
	      fprintf (FILE, "%s,lo16(", reg_names[REGNO (reg0)]);	\
	      output_addr_const (FILE, XEXP (reg1, 0));			\
	      fputc (')', FILE);					\
	    }								\
									\
	  else fatal ("bad XEXP (1) to PRINT_OPERAND_ADDRESS");		\
	}								\
									\
      else								\
	fatal ("unknown PLUS case in PRINT_OPERAND_ADDRESS");		\
      break;								\
									\
    case MULT:								\
      if (REGNO (XEXP (addr, 0)) == ARG_POINTER_REGNUM)			\
	fatal ("PRINT_OPERAND_ADDRESS, arg pointer #7");		\
									\
      fprintf (FILE, "r0[%s]", reg_names[REGNO (XEXP (addr, 0))]);	\
      break;								\
									\
    case LSHIFT:							\
      fprintf (FILE, "r0,hi16(");					\
      output_addr_const (FILE, XEXP (addr, 0));				\
      fprintf (FILE, ")");						\
      break;								\
									\
    case CONST_INT:							\
      fprintf (FILE, "r0,0x%.4x\t\t\t; %d", INTVAL (addr), INTVAL (addr)); \
      break;								\
									\
    default:								\
      if ((cc_status.mdep & MDEP_LS_LO16) != 0)				\
	{								\
	  cc_status.mdep &= ~ MDEP_LS_LO16;				\
	  fprintf (FILE, "%s,lo16(", reg_names[LITERAL_SYNTHESIS_REGNUM]); \
	  output_addr_const (FILE, addr);				\
	  fprintf (FILE, ")");						\
	}								\
									\
      else if ((cc_status.mdep & MDEP_LS_STATIC) != 0)			\
	{								\
	  cc_status.mdep &= ~ MDEP_LS_STATIC;				\
	  fprintf (FILE, "%s,lo16(", reg_names[STATIC_LIT_SYNTH_REGNUM]); \
	  output_addr_const (FILE, addr);				\
	  fprintf (FILE, ")");						\
	}								\
									\
      else								\
	{								\
	  fprintf (FILE, "r0,");					\
	  output_addr_const (FILE, addr);				\
	}								\
    }									\
									\
    if ((cc_status.mdep & MDEP_LS_CHANGE) != 0)				\
      fatal ("PRINT_OPERAND_ADDRESS, MDEP_LS_CHANGE bits set at end");	\
}
