home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Sources-Targets / 3b1.h next >
Encoding:
C/C++ Source or Header  |  1993-02-05  |  16.5 KB  |  499 lines  |  [TEXT/MPS ]

  1. /* Definitions of target machine for GNU compiler.
  2.    AT&T UNIX PC version (pc7300, 3b1)
  3.  
  4.    Written by Alex Crain
  5.    bug reports to alex@umbc3.umd.edu
  6.  
  7.    Copyright (C) 1987 Free Software Foundation, Inc.
  8.  
  9. This file is part of GNU CC.
  10.  
  11. GNU CC is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2, or (at your option)
  14. any later version.
  15.  
  16. GNU CC is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. GNU General Public License for more details.
  20.  
  21. You should have received a copy of the GNU General Public License
  22. along with GNU CC; see the file COPYING.  If not, write to
  23. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. #define SGS_SWITCH_TABLES    /* Different switch table handling */
  26.  
  27. #include "hp320.h"
  28.  
  29. /* See m68k.h.  0 means 680[01]0 with no 68881.  */
  30.  
  31. #undef TARGET_DEFAULT
  32. #define    TARGET_DEFAULT 0
  33.  
  34. /* -m68020 requires special flags to the assembler.  */
  35.  
  36. #undef ASM_SPEC
  37. #define ASM_SPEC "%{m68020:-68020}%{!m68020:-68010} %{m68881:-68881}"
  38.  
  39. /* we use /lib/libp/lib*  when profiling */
  40.  
  41. #undef LIB_SPEC
  42. #define LIB_SPEC "%{!shlib:%{p:-L/lib/libp} %{pg:-L/lib/libp} -lc}"
  43.  
  44. /* shared libraries need to use crt0s.o  */
  45.  
  46. #undef STARTFILE_SPEC
  47. #define STARTFILE_SPEC \
  48.   "%{!shlib:%{pg:mcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}\
  49.    %{shlib:crt0s.o%s shlib.ifile%s} "
  50.  
  51. /* cpp has to support a #sccs directive for the /usr/include files */
  52.  
  53. #define SCCS_DIRECTIVE
  54.  
  55. /* Make output for SDB.  */
  56.  
  57. #define SDB_DEBUGGING_INFO
  58.  
  59. /* The .file command should always begin the output.  */
  60.  
  61. #undef ASM_FILE_START
  62. #define ASM_FILE_START(FILE) \
  63. output_file_directive ((FILE), main_input_filename)
  64.  
  65. /* Don't try to define `gcc_compiled.' since the assembler might not
  66.    accept symbols with periods and GDB doesn't run on this machine anyway.  */
  67. #define ASM_IDENTIFY_GCC(FILE)
  68.  
  69. /* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
  70.    This will control the use of inline 68881 insns in certain macros.  */
  71.  
  72. #undef CPP_SPEC
  73. #define CPP_SPEC "%{m68881:-D__HAVE_68881__}"
  74.  
  75. /* Names to predefine in the preprocessor for this target machine.  */
  76. /* ihnp4!lmayk!lgm@eddie.mit.edu says mc68000 and m68k should not be here.  */
  77.  
  78. #undef CPP_PREDEFINES
  79. #define CPP_PREDEFINES "-Dmc68k -Dunix -Dunixpc"
  80.  
  81. #undef REGISTER_NAMES
  82. #define REGISTER_NAMES \
  83. {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",    \
  84.  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",    \
  85.  "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7"}
  86.  
  87. /* Specify how to pad function arguments.
  88.    Value should be `upward', `downward' or `none'.
  89.    Same as the default, except no padding for large or variable-size args.  */
  90.  
  91. #define FUNCTION_ARG_PADDING(MODE, TYPE)                \
  92.   (((MODE) == BLKmode                            \
  93.     ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST        \
  94.        && int_size_in_bytes (TYPE) < PARM_BOUNDARY / BITS_PER_UNIT)    \
  95.     : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY)                \
  96.    ? downward : none)
  97.  
  98. /* Override part of the obstack macros.  */
  99.  
  100. #define __PTR_TO_INT(P) ((int)(P))
  101. #define __INT_TO_PTR(P) ((char *)(P))
  102.  
  103. /* The 3b1 does not have `atexit'.  */
  104.  
  105. #undef HAVE_ATEXIT
  106.  
  107. /* Override parts of m68k.h to fit the SGS-3b1 assembler.  */
  108.  
  109. #undef TARGET_VERSION
  110. #undef ASM_FORMAT_PRIVATE_NAME
  111. #undef ASM_OUTPUT_DOUBLE
  112. #undef ASM_OUTPUT_FLOAT
  113. #undef ASM_OUTPUT_ALIGN
  114. #undef ASM_OUTPUT_SOURCE_FILENAME
  115. #undef ASM_OUTPUT_SOURCE_LINE
  116. #undef PRINT_OPERAND_ADDRESS
  117. #undef ASM_GENERATE_INTERNAL_LABEL
  118. #undef FUNCTION_PROFILER
  119. #undef ASM_OUTPUT_ADDR_VEC_ELT
  120. #undef ASM_OUTPUT_ADDR_DIFF_ELT
  121. #undef ASM_OUTPUT_INTERNAL_LABEL
  122. #undef ASM_OUTPUT_OPCODE
  123. #undef ASM_OUTPUT_LOCAL
  124. #undef ASM_OUTPUT_LABELREF
  125. #undef ASM_OUTPUT_ASCII
  126.  
  127. #define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T unixpc syntax)");
  128.  
  129. /* Store in OUTPUT a string (made with alloca) containing
  130.    an assembler-name for a local static variable named NAME.
  131.    LABELNO is an integer which is different for each call.  */
  132.  
  133. #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)    \
  134. ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),    \
  135.   sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
  136.  
  137. /* The unixpc doesn't know about double's and float's */
  138.  
  139. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \
  140. do { union { double d; long l[2]; } tem;        \
  141.      tem.d = (VALUE);                    \
  142.      fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
  143.    } while (0)
  144.  
  145. #define ASM_OUTPUT_FLOAT(FILE,VALUE)  \
  146. do { union { float f; long l;} tem;            \
  147.      tem.f = (VALUE);                    \
  148.      fprintf (FILE, "\tlong 0x%x\n", tem.l);    \
  149.    } while (0)
  150.  
  151. #define ASM_OUTPUT_ALIGN(FILE,LOG)    \
  152.   if ((LOG) == 1)            \
  153.     fprintf (FILE, "\teven\n");    \
  154.   else if ((LOG) != 0)            \
  155.     abort ();
  156.  
  157. /* This is how to output an assembler line
  158.    that says to advance the location counter by SIZE bytes.  */
  159.  
  160. #undef ASM_OUTPUT_SKIP
  161. #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
  162.   fprintf (FILE, "\tspace %d\n", (SIZE))
  163.  
  164. /* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s.  */
  165.  
  166. #define ASM_NO_SKIP_IN_TEXT 1
  167.  
  168. /* The beginnings of sdb support... */
  169.  
  170. #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
  171.   fprintf (FILE, "\tfile\t\"%s\"\n", FILENAME)
  172.  
  173. #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)    \
  174.   fprintf (FILE, "\tln\t%d\n",            \
  175.        (sdb_begin_function_line        \
  176.         ? last_linenum - sdb_begin_function_line : 1))
  177.  
  178. /* Yet another null terminated string format. */
  179.  
  180. #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
  181.   { register int sp = 0, lp = 0; \
  182.     fprintf ((FILE), "\tbyte\t"); \
  183.   loop: \
  184.     if ((PTR)[sp] > ' ' && ! ((PTR)[sp] & 0x80) && (PTR)[sp] != '\\') \
  185.       { lp += 3; \
  186.     fprintf ((FILE), "'%c", (PTR)[sp]); } \
  187.     else \
  188.       { lp += 5; \
  189.     fprintf ((FILE), "0x%x", (PTR)[sp]); } \
  190.     if (++sp < (LEN)) \
  191.       {    if (lp > 60) \
  192.       { lp = 0; \
  193.         fprintf ((FILE), "\n\t%s ", ASCII_DATA_ASM_OP); }    \
  194.     else \
  195.       putc (',', (FILE)); \
  196.     goto loop; } \
  197.     putc ('\n', (FILE)); }
  198.  
  199. /* Note that in the case of the movhi which fetches an element of
  200.    an ADDR_DIFF_VEC the offset output is too large by 2.
  201.    This is because the 3b1 assembler refuses to subtract 2.
  202.    ASM_OUTPUT_CASE_LABEL, below, compensates for this.  */
  203.  
  204. #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \
  205. { register rtx reg1, reg2, breg, ireg;                    \
  206.   register rtx addr = ADDR;                        \
  207.   rtx offset;                                \
  208.   switch (GET_CODE (addr))                        \
  209.     {                                    \
  210.     case REG:                                \
  211.       fprintf (FILE, "(%s)", reg_names[REGNO (addr)]);            \
  212.       break;                                \
  213.     case PRE_DEC:                            \
  214.       fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]);    \
  215.       break;                                \
  216.     case POST_INC:                            \
  217.       fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]);    \
  218.       break;                                \
  219.     case PLUS:                                \
  220.       reg1 = 0;    reg2 = 0;                        \
  221.       ireg = 0;    breg = 0;                        \
  222.       offset = 0;                            \
  223.       if (CONSTANT_ADDRESS_P (XEXP (addr, 0)))                \
  224.     {                                \
  225.       offset = XEXP (addr, 0);                    \
  226.       addr = XEXP (addr, 1);                    \
  227.     }                                \
  228.       else if (CONSTANT_ADDRESS_P (XEXP (addr, 1)))            \
  229.     {                                \
  230.       offset = XEXP (addr, 1);                    \
  231.       addr = XEXP (addr, 0);                    \
  232.     }                                \
  233.       if (GET_CODE (addr) != PLUS) ;                    \
  234.       else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND)        \
  235.     {                                \
  236.       reg1 = XEXP (addr, 0);                    \
  237.       addr = XEXP (addr, 1);                    \
  238.     }                                \
  239.       else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND)        \
  240.     {                                \
  241.       reg1 = XEXP (addr, 1);                    \
  242.       addr = XEXP (addr, 0);                    \
  243.     }                                \
  244.       else if (GET_CODE (XEXP (addr, 0)) == MULT)            \
  245.     {                                \
  246.       reg1 = XEXP (addr, 0);                    \
  247.       addr = XEXP (addr, 1);                    \
  248.     }                                \
  249.       else if (GET_CODE (XEXP (addr, 1)) == MULT)            \
  250.     {                                \
  251.       reg1 = XEXP (addr, 1);                    \
  252.       addr = XEXP (addr, 0);                    \
  253.     }                                \
  254.       else if (GET_CODE (XEXP (addr, 0)) == REG)            \
  255.     {                                \
  256.       reg1 = XEXP (addr, 0);                    \
  257.       addr = XEXP (addr, 1);                    \
  258.     }                                \
  259.       else if (GET_CODE (XEXP (addr, 1)) == REG)            \
  260.     {                                \
  261.       reg1 = XEXP (addr, 1);                    \
  262.       addr = XEXP (addr, 0);                    \
  263.     }                                \
  264.       if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT        \
  265.       || GET_CODE (addr) == SIGN_EXTEND)                \
  266.     { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; }    \
  267. /*  for OLD_INDEXING                            \
  268.       else if (GET_CODE (addr) == PLUS)                    \
  269.     {                                \
  270.       if (GET_CODE (XEXP (addr, 0)) == REG)                \
  271.         {                                \
  272.           reg2 = XEXP (addr, 0);                    \
  273.           addr = XEXP (addr, 1);                    \
  274.         }                                \
  275.       else if (GET_CODE (XEXP (addr, 1)) == REG)            \
  276.         {                                \
  277.           reg2 = XEXP (addr, 1);                    \
  278.           addr = XEXP (addr, 0);                    \
  279.         }                                \
  280.     }                                \
  281.   */                                    \
  282.       if (offset != 0) { if (addr != 0) abort (); addr = offset; }    \
  283.       if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND            \
  284.             || GET_CODE (reg1) == MULT))            \
  285.       || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2))))        \
  286.     { breg = reg2; ireg = reg1; }                    \
  287.       else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1)))        \
  288.     { breg = reg1; ireg = reg2; }                    \
  289.       if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF)    \
  290.         { int scale = 1;                        \
  291.       if (GET_CODE (ireg) == MULT)                    \
  292.         { scale = INTVAL (XEXP (ireg, 1));                \
  293.           ireg = XEXP (ireg, 0); }                    \
  294.       if (GET_CODE (ireg) == SIGN_EXTEND)                \
  295.         fprintf (FILE, "LD%%%d(%%pc,%s.w",                \
  296.              CODE_LABEL_NUMBER (XEXP (addr, 0)),        \
  297.              reg_names[REGNO (XEXP (ireg, 0))]);         \
  298.       else                                \
  299.         fprintf (FILE, "LD%%%d(%%pc,%s.l",                \
  300.              CODE_LABEL_NUMBER (XEXP (addr, 0)),        \
  301.              reg_names[REGNO (ireg)]);                \
  302.       if (scale != 1) fprintf (FILE, "*%d", scale);            \
  303.       fprintf (FILE, ")");                        \
  304.       break; }                            \
  305.       if (breg != 0 && ireg == 0 && GET_CODE (addr) == LABEL_REF)    \
  306.         { fprintf (FILE, "LD%%%d(%%pc,%s.l",                \
  307.            CODE_LABEL_NUMBER (XEXP (addr, 0)),            \
  308.            reg_names[REGNO (breg)]);                \
  309.       putc (')', FILE);                        \
  310.       break; }                            \
  311.       if (ireg != 0 || breg != 0)                    \
  312.     { int scale = 1;                        \
  313.       if (breg == 0)                        \
  314.         abort ();                            \
  315.       if (addr != 0)                        \
  316.         output_addr_const (FILE, addr);                \
  317.       fprintf (FILE, "(%s", reg_names[REGNO (breg)]);        \
  318.       if (ireg != 0)                            \
  319.         putc (',', FILE);                        \
  320.       if (ireg != 0 && GET_CODE (ireg) == MULT)            \
  321.         { scale = INTVAL (XEXP (ireg, 1));                \
  322.           ireg = XEXP (ireg, 0); }                    \
  323.       if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)        \
  324.         fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]);    \
  325.       else if (ireg != 0)                        \
  326.         fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]);        \
  327.       if (scale != 1) fprintf (FILE, "*%d", scale);            \
  328.       putc (')', FILE);                        \
  329.       break;                            \
  330.     }                                \
  331.       else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF)        \
  332.     { fprintf (FILE, "LD%%%d(%%pc,%s.w)",                \
  333.            CODE_LABEL_NUMBER (XEXP (addr, 0)),            \
  334.            reg_names[REGNO (reg1)]);                \
  335.       break; }                            \
  336.     default:                                \
  337.       if (GET_CODE (addr) == CONST_INT                    \
  338.       && INTVAL (addr) < 0x8000                    \
  339.       && INTVAL (addr) >= -0x8000)                    \
  340.     fprintf (FILE, "%d", INTVAL (addr));                \
  341.       else                                \
  342.         output_addr_const (FILE, addr);                    \
  343.     }}
  344.  
  345. #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)    \
  346.   sprintf ((LABEL), "%s%%%d", (PREFIX), (NUM))
  347.  
  348. #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)    \
  349.     fprintf (FILE, "%s%%%d:\n", PREFIX, NUM)
  350.  
  351. /* Must put address in  %a0 , not  %d0 . -- LGM, 7/15/88 */
  352. #define FUNCTION_PROFILER(FILE, LABEL_NO)    \
  353.     fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount\n", (LABEL_NO))
  354.  
  355. #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)    \
  356.     fprintf (FILE, "\tlong L%%%d\n", (VALUE))
  357.  
  358. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)    \
  359.     fprintf (FILE, "\tshort L%%%d-L%%%d\n", (VALUE), (REL))
  360.  
  361. /* ihnp4!lmayk!lgm says that `short 0' triggers assembler bug;
  362.    `short L%nn-L%nn' supposedly works.  */
  363. #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE)            \
  364.   if (! RTX_INTEGRATED_P (TABLE))                    \
  365.     fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n",                \
  366.          XVECLEN (PATTERN (TABLE), 1), (PREFIX), (NUM));        \
  367.   else                                    \
  368.     fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n\tshort %s%%%d-%s%%%d\n",    \
  369.          XVECLEN (PATTERN (TABLE), 1) + 1, (PREFIX), (NUM),        \
  370.          (PREFIX), (NUM), (PREFIX), (NUM))
  371.  
  372. /* At end of a switch table, define LDnnn iff the symbol LInnn was defined.
  373.    Some SGS assemblers have a bug such that "Lnnn-LInnn-2.b(pc,d0.l*2)"
  374.    fails to assemble.  Luckily "LDnnn(pc,d0.l*2)" produces the results
  375.    we want.  This difference can be accommodated by making the assembler
  376.    define such "LDnnn" to be either "Lnnn-LInnn-2.b", "Lnnn", or any other
  377.    string, as necessary.  This is accomplished via the ASM_OUTPUT_CASE_END
  378.    macro. */
  379.  
  380. #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE)                \
  381. { if (switch_table_difference_label_flag)                \
  382.     fprintf (FILE, "\tset LD%%%d,L%%%d-LI%%%d\n", (NUM), (NUM), (NUM))    \
  383.   switch_table_difference_label_flag = 0; }
  384.  
  385. int switch_table_difference_label_flag;
  386.  
  387. #define ASM_OUTPUT_OPCODE(FILE, PTR)            \
  388. { if ((PTR)[0] == 'j' && (PTR)[1] == 'b')        \
  389.     { ++(PTR);                        \
  390.       while (*(PTR) != ' ')                \
  391.     { putc (*(PTR), (FILE)); ++(PTR); }        \
  392.       fprintf ((FILE), ".w"); }                \
  393.   else if ((PTR)[0] == 's')                \
  394.     {                            \
  395.       if (!strncmp ((PTR), "swap", 4))            \
  396.     { fprintf ((FILE), "swap.w"); (PTR) += 4; }    \
  397.     }                            \
  398.   else if ((PTR)[0] == 'f')                \
  399.     {                            \
  400.       if (!strncmp ((PTR), "fmove", 5))            \
  401.     { fprintf ((FILE), "fmov"); (PTR) += 5; }    \
  402.       else if (!strncmp ((PTR), "fbne", 4))        \
  403.     { fprintf ((FILE), "fbneq"); (PTR) += 4; }    \
  404.     }                            \
  405. /* MOVE, MOVEA, MOVEQ, MOVEC ==> MOV    */        \
  406.   else if ((PTR)[0] == 'm' && (PTR)[1] == 'o'        \
  407.        && (PTR)[2] == 'v' && (PTR)[3] == 'e')    \
  408.     { fprintf ((FILE), "mov"); (PTR) += 4;        \
  409.        if ((PTR)[0] == 'q' || (PTR)[0] == 'a'        \
  410.        || (PTR)[0] == 'c') (PTR)++; }        \
  411. /* SUB, SUBQ, SUBA, SUBI ==> SUB */            \
  412.   else if ((PTR)[0] == 's' && (PTR)[1] == 'u'         \
  413.        && (PTR)[2] == 'b')                \
  414.     { fprintf ((FILE), "sub"); (PTR) += 3;        \
  415.        if ((PTR)[0] == 'q' || (PTR)[0] == 'i'         \
  416.        || (PTR)[0] == 'a') (PTR)++; }        \
  417. /* CMP, CMPA, CMPI, CMPM ==> CMP    */        \
  418.   else if ((PTR)[0] == 'c' && (PTR)[1] == 'm'        \
  419.        && (PTR)[2] == 'p')                \
  420.     { fprintf ((FILE), "cmp"); (PTR) += 3;        \
  421.        if ((PTR)[0] == 'a' || (PTR)[0] == 'i'         \
  422.        || (PTR)[0] == 'm') (PTR)++; }        \
  423. }
  424.  
  425. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
  426. ( fputs ("\tlcomm ", (FILE)),            \
  427.   assemble_name ((FILE), (NAME)),        \
  428.   fprintf ((FILE), ",%u\n", (ROUNDED)))
  429.  
  430. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  431.   fprintf (FILE, "%s", NAME)
  432.  
  433. /* Override usual definitions of SDB output macros.
  434.    These definitions differ only in the absence of the period
  435.    at the beginning of the name of the directive
  436.    and in the use of `~' as the symbol for the current location.  */
  437.  
  438. #define PUT_SDB_SCL(a) fprintf(asm_out_file, "\tscl\t%d;", (a))
  439. #define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\tval\t%d;", (a))
  440. #define PUT_SDB_VAL(a)                \
  441. ( fputs ("\tval\t", asm_out_file),        \
  442.   output_addr_const (asm_out_file, (a)),    \
  443.   fputc (';', asm_out_file))
  444.  
  445. #define PUT_SDB_DEF(a)                \
  446. do { fprintf (asm_out_file, "\tdef\t");    \
  447.      ASM_OUTPUT_LABELREF (asm_out_file, a);     \
  448.      fprintf (asm_out_file, ";"); } while (0)
  449.  
  450. #define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\tdef\t~%s;",a)
  451. #define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file)
  452. #define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o;", a)
  453. #define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d;", a)
  454. #define PUT_SDB_START_DIM fprintf(asm_out_file, "\tdim\t")
  455.  
  456. #define PUT_SDB_TAG(a)                \
  457. do { fprintf (asm_out_file, "\ttag\t");    \
  458.      ASM_OUTPUT_LABELREF (asm_out_file, a);    \
  459.      fprintf (asm_out_file, ";"); } while (0)
  460.  
  461. #define PUT_SDB_BLOCK_START(LINE)        \
  462.   fprintf (asm_out_file,            \
  463.        "\tdef\t~bb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n",    \
  464.        (LINE))
  465.  
  466. #define PUT_SDB_BLOCK_END(LINE)            \
  467.   fprintf (asm_out_file,            \
  468.        "\tdef\t~eb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n",    \
  469.        (LINE))
  470.  
  471. #define PUT_SDB_FUNCTION_START(LINE)        \
  472.   fprintf (asm_out_file,            \
  473.        "\tdef\t~bf;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n",    \
  474.        (LINE))
  475.  
  476. #define PUT_SDB_FUNCTION_END(LINE)        \
  477.   fprintf (asm_out_file,            \
  478.        "\tdef\t~ef;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n",    \
  479.        (LINE))
  480.  
  481. #define PUT_SDB_EPILOGUE_END(NAME)        \
  482.   fprintf (asm_out_file,            \
  483.        "\tdef\t%s;\tval\t~;\tscl\t-1;\tendef\n",    \
  484.        (NAME))
  485.  
  486. #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
  487.   sprintf ((BUFFER), "~%dfake", (NUMBER));
  488.  
  489. /* Define subroutines to call to handle multiply, divide, and remainder.
  490.    Use the subroutines that the 3b1's library provides.
  491.    The `*' prevents an underscore from being prepended by the compiler.  */
  492.  
  493. #define DIVSI3_LIBCALL "*ldiv"
  494. #define UDIVSI3_LIBCALL "*uldiv"
  495. #define MODSI3_LIBCALL "*lrem"
  496. #define UMODSI3_LIBCALL "*ulrem"
  497. #define MULSI3_LIBCALL "*lmul"
  498. #define UMULSI3_LIBCALL "*ulmul"
  499.