home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / config / m68k / mot3300.h < prev    next >
C/C++ Source or Header  |  1995-06-15  |  20KB  |  603 lines

  1. /* Definitions of target machine for GNU compiler,
  2.    SysV68 Motorola 3300 Delta Series.
  3.    Copyright (C) 1987, 1993, 1994, 1995 Free Software Foundation, Inc.
  4.    Contributed by Abramo and Roberto Bagnara (bagnara@dipisa.di.unipi.it)
  5.    based on Alex Crain's 3B1 definitions.
  6.    Maintained by Philippe De Muyter (phdm@info.ucl.ac.be).
  7.  
  8. This file is part of GNU CC.
  9.  
  10. GNU CC is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14.  
  15. GNU CC is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. GNU General Public License for more details.
  19.  
  20. You should have received a copy of the GNU General Public License
  21. along with GNU CC; see the file COPYING.  If not, write to
  22. the Free Software Foundation, 59 Temple Place - Suite 330,
  23. Boston, MA 02111-1307, USA.  */
  24.  
  25. #define MOTOROLA        /* Use Motorola syntax rather than "MIT" */
  26. #define MOTOROLA_BSR        /* Use Span-dependent optimized bsr */
  27. #define SGS            /* Uses SGS assembler */
  28. #define SGS_CMP_ORDER        /* Takes cmp operands in reverse order */
  29. #define SGS_SWAP_W        /* Use swap.w rather than just plain swap */
  30.  
  31. #define NO_DOLLAR_IN_LABEL
  32. #define NO_DOT_IN_LABEL
  33.  
  34. #include "m68k/m68k.h"
  35.  
  36. /* See m68k.h.  0407 means 68020-68040.  */
  37.  
  38. #ifndef TARGET_DEFAULT
  39. #define    TARGET_DEFAULT 0407
  40. #endif
  41.  
  42. /* -m[c]6800 requires special flag to the assembler.  */
  43.  
  44. #undef ASM_SPEC
  45. #define ASM_SPEC "%{m68000:-p 000}%{mc68000:-p 000}"
  46.  
  47. /* NYI: FP= is equivalent to -msoft-float  */
  48.  
  49. /* We use /lib/libp/lib* when profiling.  */
  50.  
  51. /* NYI: if FP=M68881U library is -lc881u  */
  52. /* NYI: if FP= library is -lc.  */
  53. /* Default for us: FP=M68881 library is -lc881  */
  54. #undef LIB_SPEC
  55. #define LIB_SPEC "%{!shlib:%{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp} -lc881}"
  56.  
  57. #define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__}"
  58.  
  59. /* Shared libraries need to use crt0s.o  */
  60.  
  61. #undef STARTFILE_SPEC
  62. #define STARTFILE_SPEC \
  63.   "%{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
  64.    %{shlib:crt0s.o%s shlib.ifile%s} "
  65.  
  66. /* Generate calls to memcpy, memcmp and memset.  */
  67.  
  68. #define TARGET_MEM_FUNCTIONS
  69.  
  70. /* size_t is unsigned int.  */
  71.  
  72. #define SIZE_TYPE "unsigned int"
  73.  
  74. /* Every structure or union's size must be a multiple of 2 bytes.  */
  75.  
  76. #define STRUCTURE_SIZE_BOUNDARY 16
  77.  
  78. /* Follow sysV68 cc regarding alignment imposed by char:0; */
  79.  
  80. #define PCC_BITFIELD_TYPE_MATTERS 1
  81.   
  82. /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  83. /* Be compatible with native compiler.  */
  84. #undef PARM_BOUNDARY
  85. #define PARM_BOUNDARY 16
  86.  
  87. /* cpp has to support a #sccs directive for the /usr/include files */
  88.  
  89. #define SCCS_DIRECTIVE
  90.  
  91. /* Make output for SDB.  */
  92.  
  93. #define SDB_DEBUGGING_INFO
  94.  
  95. #undef REGISTER_PREFIX
  96. #define REGISTER_PREFIX "%"
  97.  
  98. #if 0
  99. #undef LOCAL_LABEL_PREFIX
  100. #define LOCAL_LABEL_PREFIX "~"
  101. #endif
  102.  
  103. #undef IMMEDIATE_PREFIX
  104. #define IMMEDIATE_PREFIX "&"
  105.  
  106. #undef REGISTER_NAMES
  107. #define REGISTER_NAMES \
  108. {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",    \
  109.  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",    \
  110.  "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
  111.  
  112. #undef FUNCTION_EXTRA_EPILOGUE
  113. #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE)                \
  114.   { extern int current_function_returns_pointer;            \
  115.     if ((current_function_returns_pointer) &&                \
  116.       ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode))        \
  117.       asm_fprintf (FILE, "\tmov.l %Ra0,%Rd0\n"); } 
  118.  
  119. #undef FUNCTION_PROFILER
  120. #define FUNCTION_PROFILER(FILE, LABEL_NO)    \
  121.     fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount%%\n", (LABEL_NO))
  122.  
  123. /* This is how to output an insn to push a register on the stack.
  124.    It need not be very fast code.  */
  125.  
  126. #undef ASM_OUTPUT_REG_PUSH
  127. #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
  128.   fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
  129.  
  130. /* This is how to output an insn to pop a register from the stack.
  131.    It need not be very fast code.  */
  132.  
  133. #undef ASM_OUTPUT_REG_POP
  134. #define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
  135.   fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
  136.  
  137. #undef ASM_APP_ON
  138. #define ASM_APP_ON ""
  139.  
  140. #undef ASM_APP_OFF
  141. #define ASM_APP_OFF ""
  142.  
  143. #undef TEXT_SECTION_ASM_OP
  144. #define TEXT_SECTION_ASM_OP "text"
  145. #undef DATA_SECTION_ASM_OP
  146. #define DATA_SECTION_ASM_OP "data"
  147. #undef ASCII_DATA_ASM_OP
  148. #define    ASCII_DATA_ASM_OP "byte"
  149.  
  150. /* The file command should always begin the output.  */
  151.  
  152. #undef ASM_FILE_START
  153. #define ASM_FILE_START(FILE) \
  154. output_file_directive ((FILE), main_input_filename)
  155.  
  156. /* The sysV68 assembler does not accept dots in labels.
  157.    Let's use percent instead  */
  158.  
  159. #define ASM_IDENTIFY_GCC(FILE)        fputs("gcc2_compiled%:\n", FILE)
  160.  
  161. /* Names to predefine in the preprocessor for this target machine.  */
  162. /* ihnp4!lmayk!lgm@eddie.mit.edu says mc68000 and m68k should not be here,
  163.    on the other hand I don't care what he says.  */
  164.  
  165. #undef CPP_PREDEFINES
  166. #define CPP_PREDEFINES "-Dm68k -Dunix -DsysV68 -D__motorola__ -Asystem(unix) -Asystem(svr3) -Acpu(m68k) -Amachine(m68k)"
  167.  
  168. #undef TARGET_VERSION
  169. #define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T sysV68 syntax)");
  170.  
  171. /* Function calls save all but a0, a1, d0, d1, fp0, fp1.  */
  172.  
  173. #undef CALL_USED_REGISTERS
  174. #define CALL_USED_REGISTERS                        \
  175.  {1, 1, 0, 0, 0, 0, 0, 0,                        \
  176.   1, 1, 0, 0, 0, 0, 0, 1,                        \
  177.   1, 1, 0, 0, 0, 0, 0, 0}
  178.  
  179. /* This will return small structs in d0.  */
  180. #define RETURN_IN_MEMORY(type) \
  181.   ((TYPE_MODE (type) == BLKmode) \
  182.    || (AGGREGATE_TYPE_P (type) \
  183.        && GET_MODE_SIZE (TYPE_MODE (type)) > UNITS_PER_WORD))
  184.  
  185. /* Don't default to pcc-struct-return, because we have already specified
  186.    exactly how to return structures in the RETURN_IN_MEMORY macro.  */
  187. #define DEFAULT_PCC_STRUCT_RETURN 0
  188.  
  189. /* If TARGET_68881, return SF and DF values in fp0 instead of d0.  */
  190. /* NYI: If FP=M68881U return SF and DF values in d0. */
  191. /* NYI: If -mold return pointer in a0 and d0 */
  192.  
  193. #undef FUNCTION_VALUE
  194. /* sysV68 (brain damaged) cc convention support. */
  195. #define FUNCTION_VALUE(VALTYPE,FUNC) \
  196.   (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881     \
  197.    ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16)        \
  198.    : (POINTER_TYPE_P (VALTYPE)                \
  199.       ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8)        \
  200.       : gen_rtx (REG, TYPE_MODE (VALTYPE), 0)))
  201.  
  202. /* If TARGET_68881, SF and DF values are returned in fp0 instead of d0.  */
  203.  
  204. /* Is LIBCALL_VALUE never called with a pointer ? */
  205. #undef LIBCALL_VALUE
  206. #define LIBCALL_VALUE(MODE)                           \
  207.  gen_rtx (REG, (MODE),                               \
  208.       ((TARGET_68881                           \
  209.         && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) \
  210.        ? 16 : 0))
  211.  
  212. /* 1 if N is a possible register number for a function value.
  213.    d0 may be used, and fp0 as well if -msoft-float is not specified.  */
  214.  
  215. #undef FUNCTION_VALUE_REGNO_P
  216. /* sysV68 (brain damaged) cc convention support. */
  217. #define FUNCTION_VALUE_REGNO_P(N) \
  218.  ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16))
  219.  
  220. /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
  221.    more than one register.  */
  222.  
  223. #undef NEEDS_UNTYPED_CALL
  224. #define NEEDS_UNTYPED_CALL 1
  225.  
  226. /* This is the command to make the user-level label named NAME
  227.    defined for reference from other files.  */
  228.  
  229. #undef GLOBAL_ASM_OP
  230. #define GLOBAL_ASM_OP "global"
  231.  
  232. /* Store in OUTPUT a string (made with alloca) containing
  233.    an assembler-name for a local static variable named NAME.
  234.    LABELNO is an integer which is different for each call.  */
  235.  
  236. #undef ASM_FORMAT_PRIVATE_NAME
  237. #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)    \
  238. ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),    \
  239.   sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
  240.  
  241. /* The sysV68 as doesn't know about double's and float's.  */
  242. /* This is how to output an assembler line defining a `double' constant.  */
  243.  
  244. #undef ASM_OUTPUT_DOUBLE
  245. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \
  246. do { long l[2];                        \
  247.      REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l);        \
  248.      fprintf (FILE, "\tlong 0x%x,0x%x\n", l[0], l[1]); \
  249.    } while (0)
  250.  
  251. #undef ASM_OUTPUT_LONG_DOUBLE
  252. #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE)                  \
  253. do { long l[3];                                \
  254.      REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l);            \
  255.      fprintf (FILE, "\tlong 0x%x,0x%x,0x%x\n", l[0], l[1], l[2]);    \
  256.    } while (0)
  257.  
  258. /* This is how to output an assembler line defining a `float' constant.  */
  259.  
  260. #undef ASM_OUTPUT_FLOAT
  261. #define ASM_OUTPUT_FLOAT(FILE,VALUE)  \
  262. do { long l;                    \
  263.      REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);    \
  264.      fprintf ((FILE), "\tlong 0x%x\n", l);    \
  265.    } while (0)
  266.  
  267. /* This is how to output an assembler line defining an `int' constant.  */
  268.  
  269. #undef ASM_OUTPUT_INT
  270. #define ASM_OUTPUT_INT(FILE,VALUE)  \
  271. ( fprintf (FILE, "\tlong "),            \
  272.   output_addr_const (FILE, (VALUE)),        \
  273.   fprintf (FILE, "\n"))
  274.  
  275. /* Likewise for `char' and `short' constants.  */
  276.  
  277. #undef ASM_OUTPUT_SHORT
  278. #define ASM_OUTPUT_SHORT(FILE,VALUE)  \
  279. ( fprintf (FILE, "\tshort "),            \
  280.   output_addr_const (FILE, (VALUE)),        \
  281.   fprintf (FILE, "\n"))
  282.  
  283. #undef ASM_OUTPUT_CHAR
  284. #define ASM_OUTPUT_CHAR(FILE,VALUE)  \
  285. ( fprintf (FILE, "\tbyte "),            \
  286.   output_addr_const (FILE, (VALUE)),        \
  287.   fprintf (FILE, "\n"))
  288.  
  289. /* This is how to output an assembler line for a numeric constant byte.  */
  290.  
  291. #undef ASM_OUTPUT_BYTE
  292. #define ASM_OUTPUT_BYTE(FILE,VALUE)  \
  293.   fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
  294.  
  295. /* This is how to output an assembler line
  296.    that says to advance the location counter
  297.    to a multiple of 2**LOG bytes.  */
  298.  
  299. #undef ASM_OUTPUT_ALIGN
  300. #define ASM_OUTPUT_ALIGN(FILE,LOG)    \
  301.   if ((LOG) == 1)            \
  302.     fprintf (FILE, "\teven\n");        \
  303.   else if ((LOG) != 0)            \
  304.     abort ();
  305.  
  306. #undef ASM_OUTPUT_SKIP
  307. #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
  308.   fprintf (FILE, "\tspace %u\n", (SIZE))
  309.  
  310. /* Can't use ASM_OUTPUT_SKIP in text section.  */
  311.  
  312. #define ASM_NO_SKIP_IN_TEXT 1
  313.  
  314. /* The beginnings of sdb support...  */
  315.  
  316. #undef ASM_OUTPUT_SOURCE_FILENAME
  317. #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
  318.   do {    fprintf (FILE, "\tfile\t");        \
  319.     output_quoted_string (FILE, FILENAME);    \
  320.     fprintf (FILE, "\n");            \
  321.   } while (0)
  322.  
  323. #undef ASM_OUTPUT_SOURCE_LINE
  324. #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)    \
  325.   fprintf (FILE, "\tln\t%d\n",            \
  326.        (sdb_begin_function_line        \
  327.         ? last_linenum - sdb_begin_function_line : 1))
  328.  
  329. /* Yet another null terminated string format.  */
  330.  
  331. #undef ASM_OUTPUT_ASCII
  332. #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
  333.   do { register int sp = 0, lp = 0;                \
  334.     fprintf ((FILE), "\tbyte\t");                \
  335.   loop:                                \
  336.     if ((PTR)[sp] > ' ' && ! ((PTR)[sp] & 0x80) && (PTR)[sp] != '\\')    \
  337.       { lp += 3;                        \
  338.     fprintf ((FILE), "'%c", (PTR)[sp]); }            \
  339.     else                            \
  340.       { lp += 5;                        \
  341.     fprintf ((FILE), "0x%x", (PTR)[sp]); }            \
  342.     if (++sp < (LEN))                        \
  343.       {    if (lp > 60)                        \
  344.       { lp = 0;                        \
  345.         fprintf ((FILE), "\n\t%s ", ASCII_DATA_ASM_OP); }    \
  346.     else                            \
  347.       putc (',', (FILE));                    \
  348.     goto loop; }                        \
  349.     putc ('\n', (FILE)); } while (0)
  350.  
  351. /* Output a float value (represented as a C double) as an immediate operand.
  352.    This macro is a 68k-specific macro.  */
  353.  
  354. #undef ASM_OUTPUT_FLOAT_OPERAND
  355. #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE)            \
  356.  do { long l;                                \
  357.       REAL_VALUE_TO_TARGET_SINGLE (r, l);                \
  358.       /* Use hex representation even if CODE is f.  as needs it.  */    \
  359.       fprintf ((FILE), "&0x%lx", l);                    \
  360.     } while (0)
  361.  
  362. /* Output a double value (represented as a C double) as an immediate operand.
  363.    This macro is a 68k-specific macro.  */
  364. #undef ASM_OUTPUT_DOUBLE_OPERAND
  365. #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)                \
  366.  do { long l[2];                            \
  367.       REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l);                \
  368.       fprintf ((FILE), "&0x%lx%08lx", l[0], l[1]);            \
  369.     } while (0)
  370.  
  371. /* This is how to store into the string LABEL
  372.    the symbol_ref name of an internal numbered label where
  373.    PREFIX is the class of label and NUM is the number within the class.
  374.    This is suitable for output with `assemble_name'.  */
  375.  
  376. #undef ASM_GENERATE_INTERNAL_LABEL
  377. #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)    \
  378.   sprintf ((LABEL), "%s%%%d", (PREFIX), (NUM))
  379.  
  380. /* This is how to output an internal numbered label where
  381.    PREFIX is the class of label and NUM is the number within the class.  */
  382.  
  383. #undef ASM_OUTPUT_INTERNAL_LABEL
  384. #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)    \
  385.     fprintf (FILE, "%s%%%d:\n", PREFIX, NUM)
  386.  
  387. /* This is how to output a reference to a user-level label named NAME.
  388.    `assemble_name' uses this.  */
  389.  
  390. #undef ASM_OUTPUT_LABELREF
  391. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  392.   fprintf (FILE, "%s", NAME)
  393.  
  394. /* This is how to output an element of a case-vector that is absolute.
  395.    (The 68000 does not use such vectors,
  396.    but we must define this macro anyway.)  */
  397.  
  398. #undef ASM_OUTPUT_ADDR_VEC_ELT
  399. #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)    \
  400.     fprintf (FILE, "\tlong L%%%d\n", (VALUE))
  401.  
  402. /* This is how to output an element of a case-vector that is relative.  */
  403.  
  404. #undef ASM_OUTPUT_ADDR_DIFF_ELT
  405. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)    \
  406.     fprintf (FILE, "\tshort L%%%d-L%%%d\n", (VALUE), (REL))
  407.  
  408. #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE)            \
  409.     fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n",                \
  410.          XVECLEN (PATTERN (TABLE), 1), (PREFIX), (NUM))
  411.  
  412. /* sysV68 as cannot handle LD%n(%pc,%reg) */ 
  413. #define SGS_NO_LI
  414.  
  415. /* labelno is not used here */
  416. #define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
  417.     asm_fprintf (file, "12(%Rpc,%s.", regname)
  418.  
  419. #define ASM_RETURN_CASE_JUMP   return "jmp 8(%%pc,%0.w)"
  420.          
  421. /* Translate some opcodes to fit the sysV68 assembler syntax.  */
  422. /* The opcodes fdmov and fsmov are guesses.  */
  423.  
  424. /* cliffm@netcom.com says no need for .w suffix on jumps.  */
  425. #undef ASM_OUTPUT_OPCODE
  426. #define ASM_OUTPUT_OPCODE(FILE, PTR)            \
  427. { if ((PTR)[0] == 'j' && (PTR)[1] == 'b')        \
  428.     { ++(PTR);                        \
  429.       while (*(PTR) != ' ')                \
  430.     { putc (*(PTR), (FILE)); ++(PTR); }        \
  431.     }                            \
  432.   else if ((PTR)[0] == 's')                \
  433.     {                            \
  434.       if (!strncmp ((PTR), "swap", 4))            \
  435.     { fprintf ((FILE), "swap.w"); (PTR) += 4; }    \
  436.     }                            \
  437.   else if ((PTR)[0] == 'f')                \
  438.     {                            \
  439.       if (!strncmp ((PTR), "fmove", 5))            \
  440.     { fprintf ((FILE), "fmov"); (PTR) += 5; }    \
  441.       else if (!strncmp ((PTR), "f%$move", 7))        \
  442.     { if (TARGET_68040_ONLY)            \
  443.         { fprintf ((FILE), "fsmov"); (PTR) += 7; }    \
  444.       else                        \
  445.         { fprintf ((FILE), "fmov"); (PTR) += 7; } }    \
  446.       else if (!strncmp ((PTR), "f%&move", 7))        \
  447.     { if (TARGET_68040_ONLY)            \
  448.         { fprintf ((FILE), "fdmov"); (PTR) += 7; }    \
  449.       else                        \
  450.         { fprintf ((FILE), "fmov"); (PTR) += 7; } }    \
  451.       else if (!strncmp ((PTR), "ftst", 4))        \
  452.     { fprintf ((FILE), "ftest"); (PTR) += 4; }    \
  453.       else if (!strncmp ((PTR), "fbne", 4))        \
  454.     { fprintf ((FILE), "fbneq"); (PTR) += 4; }    \
  455.       else if (!strncmp ((PTR), "fsne", 4))        \
  456.     { fprintf ((FILE), "fsneq"); (PTR) += 4; }    \
  457.     }                            \
  458. /* MOVE, MOVEA, MOVEQ, MOVEC ==> MOV    */        \
  459.   else if ((PTR)[0] == 'm' && (PTR)[1] == 'o'        \
  460.        && (PTR)[2] == 'v' && (PTR)[3] == 'e')    \
  461.     { fprintf ((FILE), "mov"); (PTR) += 4;        \
  462.        if ((PTR)[0] == 'q' || (PTR)[0] == 'a'        \
  463.        || (PTR)[0] == 'c') (PTR)++; }        \
  464. /* SUB, SUBQ, SUBA, SUBI ==> SUB */            \
  465.   else if ((PTR)[0] == 's' && (PTR)[1] == 'u'         \
  466.        && (PTR)[2] == 'b')                \
  467.     { fprintf ((FILE), "sub"); (PTR) += 3;        \
  468.        if ((PTR)[0] == 'q' || (PTR)[0] == 'i'         \
  469.        || (PTR)[0] == 'a') (PTR)++; }        \
  470. /* CMP, CMPA, CMPI, CMPM ==> CMP    */        \
  471.   else if ((PTR)[0] == 'c' && (PTR)[1] == 'm'        \
  472.        && (PTR)[2] == 'p')                \
  473.     { fprintf ((FILE), "cmp"); (PTR) += 3;        \
  474.        if ((PTR)[0] == 'a' || (PTR)[0] == 'i'         \
  475.        || (PTR)[0] == 'm') (PTR)++; }        \
  476. }
  477.  
  478. /* phdm@info.ucl.ac.be says to pass SIZE, not ROUNDED.  */
  479.  
  480. /* This says how to output an assembler line
  481.    to define a global common symbol.  */
  482.  
  483. #undef ASM_OUTPUT_COMMON
  484. #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
  485. ( fputs ("\tcomm ", (FILE)),            \
  486.   assemble_name ((FILE), (NAME)),        \
  487.   fprintf ((FILE), ",%u\n", (SIZE)))
  488.  
  489. /* This says how to output an assembler line
  490.    to define a local common symbol.  */
  491.  
  492. #undef ASM_OUTPUT_LOCAL
  493. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
  494. ( fputs ("\tlcomm ", (FILE)),            \
  495.   assemble_name ((FILE), (NAME)),        \
  496.   fprintf ((FILE), ",%u\n", (SIZE)))
  497.  
  498.  
  499. /* Override usual definitions of SDB output macros.
  500.    These definitions differ only in the absence of the period
  501.    at the beginning of the name of the directive
  502.    and in the use of `~' as the symbol for the current location.  */
  503.  
  504. #define PUT_SDB_SCL(a) fprintf(asm_out_file, "\tscl\t%d;", (a))
  505. #define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\tval\t%d;", (a))
  506. #define PUT_SDB_VAL(a)                \
  507. ( fputs ("\tval\t", asm_out_file),        \
  508.   output_addr_const (asm_out_file, (a)),    \
  509.   fputc (';', asm_out_file))
  510.  
  511. #define PUT_SDB_DEF(a)                \
  512. do { fprintf (asm_out_file, "\tdef\t");    \
  513.      ASM_OUTPUT_LABELREF (asm_out_file, a);     \
  514.      fprintf (asm_out_file, ";"); } while (0)
  515.  
  516. #define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\tdef\t~%s;",a)
  517. #define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file)
  518. #define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o;", a)
  519. #define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d;", a)
  520. #define PUT_SDB_START_DIM fprintf(asm_out_file, "\tdim\t")
  521. #define PUT_SDB_NEXT_DIM(a) fprintf(asm_out_file, "%d,", a)
  522. #define PUT_SDB_LAST_DIM(a) fprintf(asm_out_file, "%d;", a)
  523.  
  524. #define PUT_SDB_TAG(a)                \
  525. do { fprintf (asm_out_file, "\ttag\t");    \
  526.      ASM_OUTPUT_LABELREF (asm_out_file, a);    \
  527.      fprintf (asm_out_file, ";"); } while (0)
  528.  
  529. #define PUT_SDB_BLOCK_START(LINE)        \
  530.   fprintf (asm_out_file,            \
  531.        "\tdef\t~bb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n",    \
  532.        (LINE))
  533.  
  534. #define PUT_SDB_BLOCK_END(LINE)            \
  535.   fprintf (asm_out_file,            \
  536.        "\tdef\t~eb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n",    \
  537.        (LINE))
  538.  
  539. #define PUT_SDB_FUNCTION_START(LINE)        \
  540.   fprintf (asm_out_file,            \
  541.        "\tdef\t~bf;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n",    \
  542.        (LINE))
  543.  
  544. #define PUT_SDB_FUNCTION_END(LINE)        \
  545.   fprintf (asm_out_file,            \
  546.        "\tdef\t~ef;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n",    \
  547.        (LINE))
  548.  
  549. #define PUT_SDB_EPILOGUE_END(NAME)        \
  550.   fprintf (asm_out_file,            \
  551.        "\tdef\t%s;\tval\t~;\tscl\t-1;\tendef\n",    \
  552.        (NAME))
  553.  
  554. #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
  555.   sprintf ((BUFFER), "~%dfake", (NUMBER));
  556.  
  557. /* Define subroutines to call to handle multiply, divide, and remainder.
  558.    Use the subroutines that the sysV68's library provides.
  559.    The `*' prevents an underscore from being prepended by the compiler.  */
  560. /* The '*' is also used by INIT_CUMULATIVE_ARGS */
  561.  
  562. #define DIVSI3_LIBCALL "*ldiv%%"
  563. #define UDIVSI3_LIBCALL "*uldiv%%"
  564. #define MODSI3_LIBCALL "*lrem%%"
  565. #define UMODSI3_LIBCALL "*ulrem%%"
  566. #define MULSI3_LIBCALL "*lmul%%"
  567.  
  568. struct sysV68_cumulative_args
  569.     {
  570.     int    offset;
  571.     int    libcall;
  572.     };
  573.  
  574. #undef CUMULATIVE_ARGS
  575. #define CUMULATIVE_ARGS struct sysV68_cumulative_args
  576.  
  577. #undef INIT_CUMULATIVE_ARGS
  578. #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME)    \
  579. do {(CUM).offset = 0;\
  580. (CUM).libcall = (LIBNAME) && (*XSTR((LIBNAME), 0) == '*');} while(0)
  581.  
  582. #undef FUNCTION_ARG_ADVANCE
  583. #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
  584.  ((CUM).offset += ((MODE) != BLKmode            \
  585.         ? (GET_MODE_SIZE (MODE) + 3) & ~3    \
  586.         : (int_size_in_bytes (TYPE) + 3) & ~3))
  587.  
  588. #undef FUNCTION_ARG
  589. #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
  590. (((CUM).libcall && (CUM).offset == 0) ? gen_rtx(REG, (MODE), 0)\
  591. : (TARGET_REGPARM && (CUM).offset < 8) ? gen_rtx (REG, (MODE), (CUM).offset / 4) : 0)
  592.  
  593. #undef FUNCTION_ARG_PARTIAL_NREGS
  594. #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
  595. ((TARGET_REGPARM && (CUM).offset < 8                \
  596.   && 8 < ((CUM).offset + ((MODE) == BLKmode            \
  597.               ? int_size_in_bytes (TYPE)        \
  598.               : GET_MODE_SIZE (MODE))))          \
  599.  ? 2 - (CUM).offset / 4 : 0)
  600.  
  601. #undef FUNCTION_ARG_REGNO_P
  602. #define FUNCTION_ARG_REGNO_P(N) (TARGET_68020 ? 0 : (N) == 0)
  603.