home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gcc258s.zoo / config / m68k / m68k.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  71.3 KB  |  1,978 lines

  1. /* Definitions of target machine for GNU compiler.  Sun 68000/68020 version.
  2.    Copyright (C) 1987, 1988, 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. /* Note that some other tm.h files include this one and then override
  22.    many of the definitions that relate to assembler syntax.  */
  23.  
  24.  
  25. /* Names to predefine in the preprocessor for this target machine.  */
  26.  
  27. /* See sun3.h, sun2.h, isi.h for different CPP_PREDEFINES.  */
  28.  
  29. /* Print subsidiary information on the compiler version in use.  */
  30. #ifdef MOTOROLA
  31. #define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)");
  32. #else
  33. #define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)");
  34. #endif
  35.  
  36. /* Define SUPPORT_SUN_FPA to include support for generating code for
  37.    the Sun Floating Point Accelerator, an optional product for Sun 3
  38.    machines.  By default, it is not defined.  Avoid defining it unless
  39.    you need to output code for the Sun3+FPA architecture, as it has the
  40.    effect of slowing down the register set operations in hard-reg-set.h
  41.    (total number of registers will exceed number of bits in a long,
  42.    if defined, causing the set operations to expand to loops).
  43.    SUPPORT_SUN_FPA is typically defined in sun3.h.  */
  44.  
  45. /* Run-time compilation parameters selecting different hardware subsets.  */
  46.  
  47. extern int target_flags;
  48.  
  49. /* Macros used in the machine description to test the flags.  */
  50.  
  51. /* Compile for a 68020 (not a 68000 or 68010).  */
  52. #define TARGET_68020 (target_flags & 1)
  53.  
  54. /* Compile 68881 insns for floating point (not library calls).  */
  55. #define TARGET_68881 (target_flags & 2)
  56.  
  57. /* Compile using 68020 bitfield insns.  */
  58. #define TARGET_BITFIELD (target_flags & 4)
  59.  
  60. /* Compile using rtd insn calling sequence.
  61.    This will not work unless you use prototypes at least
  62.    for all functions that can take varying numbers of args.  */
  63. #define TARGET_RTD (target_flags & 8)
  64.  
  65. /* Compile passing first two args in regs 0 and 1.
  66.    This exists only to test compiler features that will
  67.    be needed for RISC chips.  It is not usable
  68.    and is not intended to be usable on this cpu.  */
  69. #define TARGET_REGPARM (target_flags & 020)
  70.  
  71. /* Compile with 16-bit `int'.  */
  72. #define TARGET_SHORT (target_flags & 040)
  73.  
  74. /* Compile with special insns for Sun FPA.  */
  75. #ifdef SUPPORT_SUN_FPA
  76. #define TARGET_FPA (target_flags & 0100)
  77. #else
  78. #define TARGET_FPA 0
  79. #endif
  80.  
  81. /* Compile (actually, link) for Sun SKY board.  */
  82. #define TARGET_SKY (target_flags & 0200)
  83.  
  84. /* Optimize for 68040, but still allow execution on 68020
  85.    (-m68020-40 or -m68040).
  86.    The 68040 will execute all 68030 and 68881/2 instructions, but some
  87.    of them must be emulated in software by the OS.  When TARGET_68040 is
  88.    turned on, these instructions won't be used.  This code will still
  89.    run on a 68030 and 68881/2. */
  90. #define TARGET_68040 (target_flags & 01400)
  91.  
  92. /* Use the 68040-only fp instructions (-m68040).  */
  93. #define TARGET_68040_ONLY (target_flags & 01000)
  94.  
  95. /* Use PC-relative addressing for refs to read-only data */
  96. #define TARGET_PC_REL (target_flags & 02000)
  97.  
  98. /* Use base-relative addressing for refs to data&bss segments */
  99. #define TARGET_BASE_REL (target_flags & 04000)
  100.  
  101. /* Macro to define tables used to set the flags.
  102.    This is a list in braces of pairs in braces,
  103.    each pair being { "NAME", VALUE }
  104.    where VALUE is the bits to set or minus the bits to clear.
  105.    An empty string NAME is used to identify the default VALUE.  */
  106.  
  107. #define TARGET_SWITCHES  \
  108.   { { "68020", -01400},                \
  109.     { "c68020", -01400},            \
  110.     { "68020", 5},                \
  111.     { "c68020", 5},                \
  112.     { "68881", 2},                \
  113.     { "bitfield", 4},                \
  114.     { "68000", -01405},                \
  115.     { "c68000", -01405},            \
  116.     { "soft-float", -01102},            \
  117.     { "nobitfield", -4},            \
  118.     { "rtd", 8},                \
  119.     { "nortd", -8},                \
  120.     { "short", 040},                \
  121.     { "noshort", -040},                \
  122.     { "fpa", 0100},                \
  123.     { "nofpa", -0100},                \
  124.     { "sky", 0200},                \
  125.     { "nosky", -0200},                \
  126.     { "68020-40", 0407},            \
  127.     { "68030", -01400},                \
  128.     { "68030", 5},                \
  129.     { "68040", 01007},                \
  130.     { "pcrel", 02000},                \
  131.     { "nopcrel", -02000},            \
  132.     { "baserel", 04000},            \
  133.     { "nobaserel", -04000},            \
  134.     { "68851", 0},    /* Affects *_SPEC and/or GAS.  */    \
  135.     { "no-68851", 0},    /* Affects *_SPEC and/or GAS.  */    \
  136.     { "68302", 0},    /* Affects *_SPEC and/or GAS.  */    \
  137.     { "no-68302", 0},    /* Affects *_SPEC and/or GAS.  */    \
  138.     { "68332", 0},    /* Affects *_SPEC and/or GAS.  */    \
  139.     { "no-68332", 0},    /* Affects *_SPEC and/or GAS.  */    \
  140.     SUBTARGET_SWITCHES                \
  141.     { "", TARGET_DEFAULT}}
  142. /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc.  */
  143.  
  144. /* This is meant to be redefined in the host dependent files */
  145. #define SUBTARGET_SWITCHES
  146.  
  147. #ifdef SUPPORT_SUN_FPA
  148. /* Blow away 68881 flag silently on TARGET_FPA (since we can't clear
  149.    any bits in TARGET_SWITCHES above) */
  150. #define OVERRIDE_OPTIONS        \
  151. {                    \
  152.   if (TARGET_FPA) target_flags &= ~2;    \
  153.   if (! TARGET_68020 && flag_pic == 2)    \
  154.     error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  155.   SUBTARGET_OVERRIDE_OPTIONS        \
  156.   if (TARGET_BASE_REL) flag_pic = 3;    \
  157. }
  158. #else
  159. #define OVERRIDE_OPTIONS        \
  160. {                    \
  161.   if (! TARGET_68020 && flag_pic == 2)    \
  162.     error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  163.   if (TARGET_BASE_REL) flag_pic = 3;    \
  164.   SUBTARGET_OVERRIDE_OPTIONS        \
  165. }
  166. #endif /* defined SUPPORT_SUN_FPA */
  167.  
  168. /* This is meant to be redefined in the host dependent files */
  169. #define SUBTARGET_OVERRIDE_OPTIONS
  170.  
  171. /* target machine storage layout */
  172.  
  173. /* Define for XFmode extended real floating point support.
  174.    This will automatically cause REAL_ARITHMETIC to be defined.  */
  175. #define LONG_DOUBLE_TYPE_SIZE 96
  176.  
  177. /* Define if you don't want extended real, but do want to use the
  178.    software floating point emulator for REAL_ARITHMETIC and
  179.    decimal <-> binary conversion. */
  180. /* #define REAL_ARITHMETIC */
  181.  
  182. /* Define this if most significant bit is lowest numbered
  183.    in instructions that operate on numbered bit-fields.
  184.    This is true for 68020 insns such as bfins and bfexts.
  185.    We make it true always by avoiding using the single-bit insns
  186.    except in special cases with constant bit numbers.  */
  187. #define BITS_BIG_ENDIAN 1
  188.  
  189. /* Define this if most significant byte of a word is the lowest numbered.  */
  190. /* That is true on the 68000.  */
  191. #define BYTES_BIG_ENDIAN 1
  192.  
  193. /* Define this if most significant word of a multiword number is the lowest
  194.    numbered.  */
  195. /* For 68000 we can decide arbitrarily
  196.    since there are no machine instructions for them.
  197.    So let's be consistent.  */
  198. #define WORDS_BIG_ENDIAN 1
  199.  
  200. /* number of bits in an addressable storage unit */
  201. #define BITS_PER_UNIT 8
  202.  
  203. /* Width in bits of a "word", which is the contents of a machine register.
  204.    Note that this is not necessarily the width of data type `int';
  205.    if using 16-bit ints on a 68000, this would still be 32.
  206.    But on a machine with 16-bit registers, this would be 16.  */
  207. #define BITS_PER_WORD 32
  208.  
  209. /* Width of a word, in units (bytes).  */
  210. #define UNITS_PER_WORD 4
  211.  
  212. /* Width in bits of a pointer.
  213.    See also the macro `Pmode' defined below.  */
  214. #define POINTER_SIZE 32
  215.  
  216. /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  217. #define PARM_BOUNDARY (TARGET_SHORT ? 16 : 32)
  218.  
  219. /* Boundary (in *bits*) on which stack pointer should be aligned.  */
  220. #define STACK_BOUNDARY 16
  221.  
  222. /* Allocation boundary (in *bits*) for the code of a function.  */
  223. #define FUNCTION_BOUNDARY 16
  224.  
  225. /* Alignment of field after `int : 0' in a structure.  */
  226. #define EMPTY_FIELD_BOUNDARY 16
  227.  
  228. /* No data type wants to be aligned rounder than this.  */
  229. #define BIGGEST_ALIGNMENT 16
  230.  
  231. /* Set this nonzero if move instructions will actually fail to work
  232.    when given unaligned data.  */
  233. #define STRICT_ALIGNMENT 1
  234.  
  235. #define SELECT_RTX_SECTION(MODE, X)                    \
  236. {                                    \
  237.   if (!flag_pic)                            \
  238.     readonly_data_section();                        \
  239.   else if (LEGITIMATE_PIC_OPERAND_P (X))                \
  240.     readonly_data_section();                        \
  241.   else                                    \
  242.     data_section();                            \
  243. }
  244.  
  245. /* Define number of bits in most basic integer type.
  246.    (If undefined, default is BITS_PER_WORD).  */
  247.  
  248. #define INT_TYPE_SIZE (TARGET_SHORT ? 16 : 32)
  249.  
  250. /* Define these to avoid dependence on meaning of `int'.
  251.    Note that WCHAR_TYPE_SIZE is used in cexp.y,
  252.    where TARGET_SHORT is not available.  */
  253.  
  254. #define WCHAR_TYPE "long int"
  255. #define WCHAR_TYPE_SIZE 32
  256.  
  257. /* Standard register usage.  */
  258.  
  259. /* Number of actual hardware registers.
  260.    The hardware registers are assigned numbers for the compiler
  261.    from 0 to just below FIRST_PSEUDO_REGISTER.
  262.    All registers that the compiler knows about must be given numbers,
  263.    even those that are not normally considered general registers.
  264.    For the 68000, we give the data registers numbers 0-7,
  265.    the address registers numbers 010-017,
  266.    and the 68881 floating point registers numbers 020-027.  */
  267. #ifndef SUPPORT_SUN_FPA
  268. #define FIRST_PSEUDO_REGISTER 24
  269. #else
  270. #define FIRST_PSEUDO_REGISTER 56
  271. #endif
  272.  
  273. /* This defines the register which is used to hold the offset table for PIC. */
  274. #define PIC_OFFSET_TABLE_REGNUM 13
  275.  
  276. /* Used to output a (use pic_offset_table_rtx) so that we 
  277.    always save/restore a5 in functions that use PIC relocation
  278.    at *any* time during the compilation process. */
  279. #define FINALIZE_PIC finalize_pic()
  280.  
  281. #ifndef SUPPORT_SUN_FPA
  282.  
  283. /* 1 for registers that have pervasive standard uses
  284.    and are not available for the register allocator.
  285.    On the 68000, only the stack pointer is such.  */
  286.  
  287. #define FIXED_REGISTERS        \
  288.  {/* Data registers.  */       \
  289.   0, 0, 0, 0, 0, 0, 0, 0,      \
  290.                                \
  291.   /* Address registers.  */    \
  292.   0, 0, 0, 0, 0, 0, 0, 1,      \
  293.                                \
  294.   /* Floating point registers  \
  295.      (if available).  */       \
  296.   0, 0, 0, 0, 0, 0, 0, 0 }
  297.  
  298. /* 1 for registers not available across function calls.
  299.    These must include the FIXED_REGISTERS and also any
  300.    registers that can be used without being saved.
  301.    The latter must include the registers where values are returned
  302.    and the register where structure-value addresses are passed.
  303.    Aside from that, you can include as many other registers as you like.  */
  304. #define CALL_USED_REGISTERS \
  305.  {1, 1, 0, 0, 0, 0, 0, 0,   \
  306.   1, 1, 0, 0, 0, 0, 0, 1,   \
  307.   1, 1, 0, 0, 0, 0, 0, 0 }
  308.  
  309. #else /* SUPPORT_SUN_FPA */
  310.  
  311. /* 1 for registers that have pervasive standard uses
  312.    and are not available for the register allocator.
  313.    On the 68000, only the stack pointer is such.  */
  314.  
  315. /* fpa0 is also reserved so that it can be used to move shit back and
  316.    forth between high fpa regs and everything else. */
  317.  
  318. #define FIXED_REGISTERS        \
  319.  {/* Data registers.  */       \
  320.   0, 0, 0, 0, 0, 0, 0, 0,      \
  321.                                \
  322.   /* Address registers.  */    \
  323.   0, 0, 0, 0, 0, 0, 0, 1,      \
  324.                                \
  325.   /* Floating point registers  \
  326.      (if available).  */       \
  327.   0, 0, 0, 0, 0, 0, 0, 0,      \
  328.                                \
  329.   /* Sun3 FPA registers.  */   \
  330.   1, 0, 0, 0, 0, 0, 0, 0,      \
  331.   0, 0, 0, 0, 0, 0, 0, 0,      \
  332.   0, 0, 0, 0, 0, 0, 0, 0,      \
  333.   0, 0, 0, 0, 0, 0, 0, 0 }
  334.  
  335. /* 1 for registers not available across function calls.
  336.    These must include the FIXED_REGISTERS and also any
  337.    registers that can be used without being saved.
  338.    The latter must include the registers where values are returned
  339.    and the register where structure-value addresses are passed.
  340.    Aside from that, you can include as many other registers as you like.  */
  341. #define CALL_USED_REGISTERS \
  342.  {1, 1, 0, 0, 0, 0, 0, 0, \
  343.   1, 1, 0, 0, 0, 0, 0, 1, \
  344.   1, 1, 0, 0, 0, 0, 0, 0, \
  345.   /* FPA registers.  */   \
  346.   1, 1, 1, 1, 0, 0, 0, 0, \
  347.   0, 0, 0, 0, 0, 0, 0, 0, \
  348.   0, 0, 0, 0, 0, 0, 0, 0, \
  349.   0, 0, 0, 0, 0, 0, 0, 0  }
  350.  
  351. #endif /* defined SUPPORT_SUN_FPA */
  352.  
  353.  
  354. /* Make sure everything's fine if we *don't* have a given processor.
  355.    This assumes that putting a register in fixed_regs will keep the
  356.    compiler's mitts completely off it.  We don't bother to zero it out
  357.    of register classes.  If neither TARGET_FPA or TARGET_68881 is set,
  358.    the compiler won't touch since no instructions that use these
  359.    registers will be valid.  
  360.  
  361.    Reserve PIC_OFFSET_TABLE_REGNUM (a5) for doing PIC relocation if
  362.    position independent code is being generated by making it a 
  363.    fixed register */
  364.  
  365. #ifndef SUPPORT_SUN_FPA
  366.  
  367. #define CONDITIONAL_REGISTER_USAGE \
  368. {                                               \
  369.   if (flag_pic)                                 \
  370.     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  371.   /* prevent saving/restoring of the base reg */ \
  372.   if (flag_pic == 3)                 \
  373.     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  374. }
  375.  
  376. #else /* defined SUPPORT_SUN_FPA */
  377.  
  378. #define CONDITIONAL_REGISTER_USAGE \
  379. {                         \
  380.   int i;                     \
  381.   HARD_REG_SET x;                 \
  382.   if (!TARGET_FPA)                \
  383.     {                         \
  384.       COPY_HARD_REG_SET (x, reg_class_contents[(int)FPA_REGS]); \
  385.       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \
  386.        if (TEST_HARD_REG_BIT (x, i))         \
  387.     fixed_regs[i] = call_used_regs[i] = 1;     \
  388.     }                         \
  389.   if (TARGET_FPA)                \
  390.     {                         \
  391.       COPY_HARD_REG_SET (x, reg_class_contents[(int)FP_REGS]); \
  392.       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \
  393.        if (TEST_HARD_REG_BIT (x, i))         \
  394.     fixed_regs[i] = call_used_regs[i] = 1;     \
  395.     }                         \
  396.   if (flag_pic)                                 \
  397.     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  398.   /* prevent saving/restoring of the base reg */ \
  399.   if (flag_pic == 3)                 \
  400.     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  401. }
  402.  
  403. #endif /* defined SUPPORT_SUN_FPA */
  404.  
  405. /* Return number of consecutive hard regs needed starting at reg REGNO
  406.    to hold something of mode MODE.
  407.    This is ordinarily the length in words of a value of mode MODE
  408.    but can be less for certain modes in special long registers.
  409.  
  410.    On the 68000, ordinary registers hold 32 bits worth;
  411.    for the 68881 registers, a single register is always enough for
  412.    anything that can be stored in them at all.  */
  413. #define HARD_REGNO_NREGS(REGNO, MODE)   \
  414.   ((REGNO) >= 16 ? GET_MODE_NUNITS (MODE)    \
  415.    : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
  416.  
  417. #ifndef SUPPORT_SUN_FPA
  418.  
  419. /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
  420.    On the 68000, the cpu registers can hold any mode but the 68881 registers
  421.    can hold only SFmode or DFmode.  The 68881 registers can't hold anything
  422.    if 68881 use is disabled.  */
  423.  
  424. #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  425.   (((REGNO) < 16)                                       \
  426.    || ((REGNO) < 24                        \
  427.        && TARGET_68881                                  \
  428.        && (GET_MODE_CLASS (MODE) == MODE_FLOAT        \
  429.        || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)))
  430.  
  431. #else /* defined SUPPORT_SUN_FPA */
  432.  
  433. /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
  434.    On the 68000, the cpu registers can hold any mode but the 68881 registers
  435.    can hold only SFmode or DFmode.  And the 68881 registers can't hold anything
  436.    if 68881 use is disabled.  However, the Sun FPA register can
  437.    (apparently) hold whatever you feel like putting in them.
  438.    If using the fpa, don't put a double in d7/a0.  */
  439.  
  440. #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  441. (((REGNO) < 16                                \
  442.   && !(TARGET_FPA                            \
  443.        && GET_MODE_CLASS ((MODE)) != MODE_INT                \
  444.        && GET_MODE_UNIT_SIZE ((MODE)) > 4                \
  445.        && (REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8    \
  446.        && (REGNO) % (GET_MODE_UNIT_SIZE ((MODE)) / 4) != 0))        \
  447.  || ((REGNO) < 24                            \
  448.      ? TARGET_68881 && (GET_MODE_CLASS (MODE) == MODE_FLOAT        \
  449.             || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)    \
  450.      : ((REGNO) < 56 ? TARGET_FPA : 0)))
  451.  
  452. #endif /* defined SUPPORT_SUN_FPA */
  453.  
  454. /* Value is 1 if it is a good idea to tie two pseudo registers
  455.    when one has mode MODE1 and one has mode MODE2.
  456.    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
  457.    for any hard reg, then this must be 0 for correct output.  */
  458. #define MODES_TIEABLE_P(MODE1, MODE2)            \
  459.   (! TARGET_68881                    \
  460.    || ((GET_MODE_CLASS (MODE1) == MODE_FLOAT        \
  461.     || GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT)    \
  462.        == (GET_MODE_CLASS (MODE2) == MODE_FLOAT        \
  463.        || GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT)))
  464.  
  465. /* Specify the registers used for certain standard purposes.
  466.    The values of these macros are register numbers.  */
  467.  
  468. /* m68000 pc isn't overloaded on a register.  */
  469. /* #define PC_REGNUM  */
  470.  
  471. /* Register to use for pushing function arguments.  */
  472. #define STACK_POINTER_REGNUM 15
  473.  
  474. /* Base register for access to local variables of the function.  */
  475. #define FRAME_POINTER_REGNUM 14
  476.  
  477. /* Value should be nonzero if functions must have frame pointers.
  478.    Zero means the frame pointer need not be set up (and parms
  479.    may be accessed via the stack pointer) in functions that seem suitable.
  480.    This is computed in `reload', in reload1.c.  */
  481. #define FRAME_POINTER_REQUIRED 0
  482.  
  483. /* Base register for access to arguments of the function.  */
  484. #define ARG_POINTER_REGNUM 14
  485.  
  486. /* Register in which static-chain is passed to a function.  */
  487. #define STATIC_CHAIN_REGNUM 8
  488.  
  489. /* Register in which address to store a structure value
  490.    is passed to a function.  */
  491. #define STRUCT_VALUE_REGNUM 9
  492.  
  493. /* Define the classes of registers for register constraints in the
  494.    machine description.  Also define ranges of constants.
  495.  
  496.    One of the classes must always be named ALL_REGS and include all hard regs.
  497.    If there is more than one class, another class must be named NO_REGS
  498.    and contain no registers.
  499.  
  500.    The name GENERAL_REGS must be the name of a class (or an alias for
  501.    another name such as ALL_REGS).  This is the class of registers
  502.    that is allowed by "g" or "r" in a register constraint.
  503.    Also, registers outside this class are allocated only when
  504.    instructions express preferences for them.
  505.  
  506.    The classes must be numbered in nondecreasing order; that is,
  507.    a larger-numbered class must never be contained completely
  508.    in a smaller-numbered class.
  509.  
  510.    For any two classes, it is very desirable that there be another
  511.    class that represents their union.  */
  512.  
  513. /* The 68000 has three kinds of registers, so eight classes would be
  514.    a complete set.  One of them is not needed.  */
  515.  
  516. #ifndef SUPPORT_SUN_FPA
  517.  
  518. enum reg_class {
  519.   NO_REGS, DATA_REGS,
  520.   ADDR_REGS, FP_REGS,
  521.   GENERAL_REGS, DATA_OR_FP_REGS,
  522.   ADDR_OR_FP_REGS, ALL_REGS,
  523.   LIM_REG_CLASSES };
  524.  
  525. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  526.  
  527. /* Give names of register classes as strings for dump file.   */
  528.  
  529. #define REG_CLASS_NAMES \
  530.  { "NO_REGS", "DATA_REGS",              \
  531.    "ADDR_REGS", "FP_REGS",              \
  532.    "GENERAL_REGS", "DATA_OR_FP_REGS",   \
  533.    "ADDR_OR_FP_REGS", "ALL_REGS" }
  534.  
  535. /* Define which registers fit in which classes.
  536.    This is an initializer for a vector of HARD_REG_SET
  537.    of length N_REG_CLASSES.  */
  538.  
  539. #define REG_CLASS_CONTENTS \
  540. {                    \
  541.  0x00000000,       /* NO_REGS */        \
  542.  0x000000ff,    /* DATA_REGS */        \
  543.  0x0000ff00,    /* ADDR_REGS */        \
  544.  0x00ff0000,    /* FP_REGS */        \
  545.  0x0000ffff,    /* GENERAL_REGS */    \
  546.  0x00ff00ff,    /* DATA_OR_FP_REGS */    \
  547.  0x00ffff00,    /* ADDR_OR_FP_REGS */   \
  548.  0x00ffffff,    /* ALL_REGS */        \
  549. }
  550.  
  551. /* The same information, inverted:
  552.    Return the class number of the smallest class containing
  553.    reg number REGNO.  This could be a conditional expression
  554.    or could index an array.  */
  555.  
  556. #define REGNO_REG_CLASS(REGNO) (((REGNO)>>3)+1)
  557.  
  558. #else /* defined SUPPORT_SUN_FPA */
  559.  
  560. /*
  561.  * Notes on final choices:
  562.  *
  563.  *   1) Didn't feel any need to union-ize LOW_FPA_REGS with anything
  564.  * else.
  565.  *   2) Removed all unions that involve address registers with
  566.  * floating point registers (left in unions of address and data with
  567.  * floating point).
  568.  *   3) Defined GENERAL_REGS as ADDR_OR_DATA_REGS.
  569.  *   4) Defined ALL_REGS as FPA_OR_FP_OR_GENERAL_REGS.
  570.  *   4) Left in everything else.
  571.  */
  572. enum reg_class { NO_REGS, LO_FPA_REGS, FPA_REGS, FP_REGS,
  573.   FP_OR_FPA_REGS, DATA_REGS, DATA_OR_FPA_REGS, DATA_OR_FP_REGS,
  574.   DATA_OR_FP_OR_FPA_REGS, ADDR_REGS, GENERAL_REGS,
  575.   GENERAL_OR_FPA_REGS, GENERAL_OR_FP_REGS, ALL_REGS,
  576.   LIM_REG_CLASSES };
  577.  
  578. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  579.  
  580. /* Give names of register classes as strings for dump file.   */
  581.  
  582. #define REG_CLASS_NAMES \
  583.  { "NO_REGS", "LO_FPA_REGS", "FPA_REGS", "FP_REGS",  \
  584.    "FP_OR_FPA_REGS", "DATA_REGS", "DATA_OR_FPA_REGS", "DATA_OR_FP_REGS",  \
  585.    "DATA_OR_FP_OR_FPA_REGS", "ADDR_REGS", "GENERAL_REGS",  \
  586.    "GENERAL_OR_FPA_REGS", "GENERAL_OR_FP_REGS", "ALL_REGS" }
  587.  
  588. /* Define which registers fit in which classes.
  589.    This is an initializer for a vector of HARD_REG_SET
  590.    of length N_REG_CLASSES.  */
  591.  
  592. #define REG_CLASS_CONTENTS \
  593. {                            \
  594.  {0, 0},            /* NO_REGS */        \
  595.  {0xff000000, 0x000000ff},    /* LO_FPA_REGS */    \
  596.  {0xff000000, 0x00ffffff},    /* FPA_REGS */        \
  597.  {0x00ff0000, 0x00000000},    /* FP_REGS */        \
  598.  {0xffff0000, 0x00ffffff},    /* FP_OR_FPA_REGS */    \
  599.  {0x000000ff, 0x00000000},    /* DATA_REGS */        \
  600.  {0xff0000ff, 0x00ffffff},    /* DATA_OR_FPA_REGS */    \
  601.  {0x00ff00ff, 0x00000000},    /* DATA_OR_FP_REGS */    \
  602.  {0xffff00ff, 0x00ffffff},    /* DATA_OR_FP_OR_FPA_REGS */\
  603.  {0x0000ff00, 0x00000000},    /* ADDR_REGS */        \
  604.  {0x0000ffff, 0x00000000},    /* GENERAL_REGS */    \
  605.  {0xff00ffff, 0x00ffffff},    /* GENERAL_OR_FPA_REGS */\
  606.  {0x00ffffff, 0x00000000},    /* GENERAL_OR_FP_REGS */\
  607.  {0xffffffff, 0x00ffffff},    /* ALL_REGS */        \
  608. }
  609.  
  610. /* The same information, inverted:
  611.    Return the class number of the smallest class containing
  612.    reg number REGNO.  This could be a conditional expression
  613.    or could index an array.  */
  614.  
  615. extern enum reg_class regno_reg_class[];
  616. #define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)>>3])
  617.  
  618. #endif /* SUPPORT_SUN_FPA */
  619.  
  620. /* The class value for index registers, and the one for base regs.  */
  621.  
  622. #define INDEX_REG_CLASS GENERAL_REGS
  623. #define BASE_REG_CLASS ADDR_REGS
  624.  
  625. /* Get reg_class from a letter such as appears in the machine description.
  626.    We do a trick here to modify the effective constraints on the
  627.    machine description; we zorch the constraint letters that aren't
  628.    appropriate for a specific target.  This allows us to guarantee
  629.    that a specific kind of register will not be used for a given target
  630.    without fiddling with the register classes above. */
  631.  
  632. #ifndef SUPPORT_SUN_FPA
  633.  
  634. #define REG_CLASS_FROM_LETTER(C) \
  635.   ((C) == 'a' ? ADDR_REGS :            \
  636.    ((C) == 'd' ? DATA_REGS :            \
  637.     ((C) == 'f' ? (TARGET_68881 ? FP_REGS :    \
  638.            NO_REGS) :            \
  639.      NO_REGS)))
  640.  
  641. #else /* defined SUPPORT_SUN_FPA */
  642.  
  643. #define REG_CLASS_FROM_LETTER(C) \
  644.   ((C) == 'a' ? ADDR_REGS :            \
  645.    ((C) == 'd' ? DATA_REGS :            \
  646.     ((C) == 'f' ? (TARGET_68881 ? FP_REGS :    \
  647.            NO_REGS) :            \
  648.      ((C) == 'x' ? (TARGET_FPA ? FPA_REGS :    \
  649.             NO_REGS) :            \
  650.       ((C) == 'y' ? (TARGET_FPA ? LO_FPA_REGS :    \
  651.              NO_REGS) :            \
  652.        NO_REGS)))))
  653.  
  654. #endif /* defined SUPPORT_SUN_FPA */
  655.  
  656. /* The letters I, J, K, L and M in a register constraint string
  657.    can be used to stand for particular ranges of immediate operands.
  658.    This macro defines what the ranges are.
  659.    C is the letter, and VALUE is a constant value.
  660.    Return 1 if VALUE is in the range specified by C.
  661.  
  662.    For the 68000, `I' is used for the range 1 to 8
  663.    allowed as immediate shift counts and in addq.
  664.    `J' is used for the range of signed numbers that fit in 16 bits.
  665.    `K' is for numbers that moveq can't handle.
  666.    `L' is for range -8 to -1, range of values that can be added with subq.  */
  667.  
  668. #define CONST_OK_FOR_LETTER_P(VALUE, C)  \
  669.   ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 8 :    \
  670.    (C) == 'J' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF :    \
  671.    (C) == 'K' ? (VALUE) < -0x80 || (VALUE) >= 0x80 :    \
  672.    (C) == 'L' ? (VALUE) < 0 && (VALUE) >= -8 : 0)
  673.  
  674. /*
  675.  * A small bit of explanation:
  676.  * "G" defines all of the floating constants that are *NOT* 68881
  677.  * constants.  this is so 68881 constants get reloaded and the
  678.  * fpmovecr is used.  "H" defines *only* the class of constants that
  679.  * the fpa can use, because these can be gotten at in any fpa
  680.  * instruction and there is no need to force reloads.
  681.  */
  682. #ifndef SUPPORT_SUN_FPA
  683. #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \
  684.   ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : 0 )
  685. #else /* defined SUPPORT_SUN_FPA */
  686. #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \
  687.   ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : \
  688.    (C) == 'H' ? (TARGET_FPA && standard_sun_fpa_constant_p (VALUE)) : 0)
  689. #endif /* defined SUPPORT_SUN_FPA */
  690.  
  691. /* Given an rtx X being reloaded into a reg required to be
  692.    in class CLASS, return the class of reg to actually use.
  693.    In general this is just CLASS; but on some machines
  694.    in some cases it is preferable to use a more restrictive class.
  695.    On the 68000 series, use a data reg if possible when the
  696.    value is a constant in the range where moveq could be used
  697.    and we ensure that QImodes are reloaded into data regs.
  698.    Also, if a floating constant needs reloading, put it in memory
  699.    if possible.  */
  700.  
  701. #define PREFERRED_RELOAD_CLASS(X,CLASS)  \
  702.   ((GET_CODE (X) == CONST_INT            \
  703.     && (unsigned) (INTVAL (X) + 0x80) < 0x100    \
  704.     && (CLASS) != ADDR_REGS)            \
  705.    ? DATA_REGS                    \
  706.    : (GET_MODE (X) == QImode && (CLASS) != ADDR_REGS) \
  707.    ? DATA_REGS                    \
  708.    : (GET_CODE (X) == CONST_DOUBLE        \
  709.       && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
  710.    ? NO_REGS                    \
  711.    : (CLASS))
  712.  
  713. /* Return the maximum number of consecutive registers
  714.    needed to represent mode MODE in a register of class CLASS.  */
  715. /* On the 68000, this is the size of MODE in words,
  716.    except in the FP regs, where a single reg is always enough.  */
  717. #ifndef SUPPORT_SUN_FPA
  718.  
  719. #define CLASS_MAX_NREGS(CLASS, MODE)    \
  720.  ((CLASS) == FP_REGS ? 1 \
  721.   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
  722.  
  723. /* Moves between fp regs and other regs are two insns.  */
  724. #define REGISTER_MOVE_COST(CLASS1, CLASS2)        \
  725.   (((CLASS1) == FP_REGS && (CLASS2) != FP_REGS)            \
  726.     || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS)    \
  727.     ? 4 : 2)
  728.  
  729. #else /* defined SUPPORT_SUN_FPA */
  730.  
  731. #define CLASS_MAX_NREGS(CLASS, MODE)    \
  732.  ((CLASS) == FP_REGS || (CLASS) == FPA_REGS || (CLASS) == LO_FPA_REGS ? 1 \
  733.   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
  734.  
  735. /* Moves between fp regs and other regs are two insns.  */
  736. /* Likewise for high fpa regs and other regs.  */
  737. #define REGISTER_MOVE_COST(CLASS1, CLASS2)        \
  738.   ((((CLASS1) == FP_REGS && (CLASS2) != FP_REGS)    \
  739.     || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS)    \
  740.     || ((CLASS1) == FPA_REGS && (CLASS2) != FPA_REGS)    \
  741.     || ((CLASS2) == FPA_REGS && (CLASS1) != FPA_REGS))    \
  742.    ? 4 : 2)
  743.  
  744. #endif /* define SUPPORT_SUN_FPA */
  745.  
  746. /* Stack layout; function entry, exit and calling.  */
  747.  
  748. /* Define this if pushing a word on the stack
  749.    makes the stack pointer a smaller address.  */
  750. #define STACK_GROWS_DOWNWARD
  751.  
  752. /* Nonzero if we need to generate stack-probe insns.
  753.    On most systems they are not needed.
  754.    When they are needed, define this as the stack offset to probe at.  */
  755. #define NEED_PROBE 0
  756.  
  757. /* Define this if the nominal address of the stack frame
  758.    is at the high-address end of the local variables;
  759.    that is, each additional local variable allocated
  760.    goes at a more negative offset in the frame.  */
  761. #define FRAME_GROWS_DOWNWARD
  762.  
  763. /* Offset within stack frame to start allocating local variables at.
  764.    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
  765.    first local allocated.  Otherwise, it is the offset to the BEGINNING
  766.    of the first local allocated.  */
  767. #define STARTING_FRAME_OFFSET 0
  768.  
  769. /* If we generate an insn to push BYTES bytes,
  770.    this says how many the stack pointer really advances by.
  771.    On the 68000, sp@- in a byte insn really pushes a word.  */
  772. #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
  773.  
  774. /* Offset of first parameter from the argument pointer register value.  */
  775. #define FIRST_PARM_OFFSET(FNDECL) 8
  776.  
  777. /* Value is the number of byte of arguments automatically
  778.    popped when returning from a subroutine call.
  779.    FUNTYPE is the data type of the function (as a tree),
  780.    or for a library call it is an identifier node for the subroutine name.
  781.    SIZE is the number of bytes of arguments passed on the stack.
  782.  
  783.    On the 68000, the RTS insn cannot pop anything.
  784.    On the 68010, the RTD insn may be used to pop them if the number
  785.      of args is fixed, but if the number is variable then the caller
  786.      must pop them all.  RTD can't be used for library calls now
  787.      because the library is compiled with the Unix compiler.
  788.    Use of RTD is a selectable option, since it is incompatible with
  789.    standard Unix calling sequences.  If the option is not selected,
  790.    the caller must always pop the args.  */
  791.  
  792. #define RETURN_POPS_ARGS(FUNTYPE,SIZE)   \
  793.   ((TARGET_RTD && TREE_CODE (FUNTYPE) != IDENTIFIER_NODE    \
  794.     && (TYPE_ARG_TYPES (FUNTYPE) == 0                \
  795.     || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE)))    \
  796.         == void_type_node)))                \
  797.    ? (SIZE) : 0)
  798.  
  799. /* Define how to find the value returned by a function.
  800.    VALTYPE is the data type of the value (as a tree).
  801.    If the precise function being called is known, FUNC is its FUNCTION_DECL;
  802.    otherwise, FUNC is 0.  */
  803.  
  804. /* On the 68000 the return value is in D0 regardless.  */
  805.  
  806. #define FUNCTION_VALUE(VALTYPE, FUNC)  \
  807.   gen_rtx (REG, TYPE_MODE (VALTYPE), 0)
  808.  
  809. /* Define how to find the value returned by a library function
  810.    assuming the value has mode MODE.  */
  811.  
  812. /* On the 68000 the return value is in D0 regardless.  */
  813.  
  814. #define LIBCALL_VALUE(MODE)  gen_rtx (REG, MODE, 0)
  815.  
  816. /* 1 if N is a possible register number for a function value.
  817.    On the 68000, d0 is the only register thus used.  */
  818.  
  819. #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
  820.  
  821. /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
  822.    more than one register.  */
  823.  
  824. #define NEEDS_UNTYPED_CALL 0
  825.  
  826. /* Define this if PCC uses the nonreentrant convention for returning
  827.    structure and union values.  */
  828.  
  829. #define PCC_STATIC_STRUCT_RETURN
  830.  
  831. /* 1 if N is a possible register number for function argument passing.
  832.    On the 68000, no registers are used in this way.  */
  833.  
  834. #define FUNCTION_ARG_REGNO_P(N) 0
  835.  
  836. /* Define a data type for recording info about an argument list
  837.    during the scan of that argument list.  This data type should
  838.    hold all necessary information about the function itself
  839.    and about the args processed so far, enough to enable macros
  840.    such as FUNCTION_ARG to determine where the next arg should go.
  841.  
  842.    On the m68k, this is a single integer, which is a number of bytes
  843.    of arguments scanned so far.  */
  844.  
  845. #define CUMULATIVE_ARGS int
  846.  
  847. /* Initialize a variable CUM of type CUMULATIVE_ARGS
  848.    for a call to a function whose data type is FNTYPE.
  849.    For a library call, FNTYPE is 0.
  850.  
  851.    On the m68k, the offset starts at 0.  */
  852.  
  853. #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME)    \
  854.  ((CUM) = 0)
  855.  
  856. /* Update the data in CUM to advance over an argument
  857.    of mode MODE and data type TYPE.
  858.    (TYPE is null for libcalls where that information may not be available.)  */
  859.  
  860. #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
  861.  ((CUM) += ((MODE) != BLKmode            \
  862.         ? (GET_MODE_SIZE (MODE) + 3) & ~3    \
  863.         : (int_size_in_bytes (TYPE) + 3) & ~3))
  864.  
  865. /* Define where to put the arguments to a function.
  866.    Value is zero to push the argument on the stack,
  867.    or a hard register in which to store the argument.
  868.  
  869.    MODE is the argument's machine mode.
  870.    TYPE is the data type of the argument (as a tree).
  871.     This is null for libcalls where that information may
  872.     not be available.
  873.    CUM is a variable of type CUMULATIVE_ARGS which gives info about
  874.     the preceding args and about the function being called.
  875.    NAMED is nonzero if this argument is a named parameter
  876.     (otherwise it is an extra parameter matching an ellipsis).  */
  877.  
  878. /* On the 68000 all args are pushed, except if -mregparm is specified
  879.    then the first two words of arguments are passed in d0, d1.
  880.    *NOTE* -mregparm does not work.
  881.    It exists only to test register calling conventions.  */
  882.  
  883. #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
  884. ((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0)
  885.  
  886. /* For an arg passed partly in registers and partly in memory,
  887.    this is the number of registers used.
  888.    For args passed entirely in registers or entirely in memory, zero.  */
  889.  
  890. #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
  891. ((TARGET_REGPARM && (CUM) < 8                    \
  892.   && 8 < ((CUM) + ((MODE) == BLKmode                \
  893.               ? int_size_in_bytes (TYPE)        \
  894.               : GET_MODE_SIZE (MODE))))          \
  895.  ? 2 - (CUM) / 4 : 0)
  896.  
  897. /* Generate the assembly code for function entry. */
  898. #define FUNCTION_PROLOGUE(FILE, SIZE) output_function_prologue(FILE, SIZE)
  899.  
  900. /* Output assembler code to FILE to increment profiler label # LABELNO
  901.    for profiling a function entry.  */
  902.  
  903. #define FUNCTION_PROFILER(FILE, LABELNO)  \
  904.   asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))
  905.  
  906. /* Output assembler code to FILE to initialize this source file's
  907.    basic block profiling info, if that has not already been done.  */
  908.  
  909. #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO)  \
  910.   asm_fprintf (FILE, "\ttstl %LLPBX0\n\tbne %LLPI%d\n\tpea %LLPBX0\n\tjsr %U__bb_init_func\n\taddql %I4,%Rsp\n%LLPI%d:\n",  \
  911.        LABELNO, LABELNO);
  912.  
  913. /* Output assembler code to FILE to increment the entry-count for
  914.    the BLOCKNO'th basic block in this source file.  */
  915.  
  916. #define BLOCK_PROFILER(FILE, BLOCKNO)    \
  917.   asm_fprintf (FILE, "\taddql %I1,%LLPBX2+%d\n", 4 * BLOCKNO)
  918.  
  919. /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
  920.    the stack pointer does not matter.  The value is tested only in
  921.    functions that have frame pointers.
  922.    No definition is equivalent to always zero.  */
  923.  
  924. #define EXIT_IGNORE_STACK 1
  925.  
  926. /* Generate the assembly code for function exit. */
  927. #define FUNCTION_EPILOGUE(FILE, SIZE) output_function_epilogue (FILE, SIZE)
  928.   
  929. /* This is a hook for other tm files to change.  */
  930. /* #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) */
  931.  
  932. /* Determine if the epilogue should be output as RTL.
  933.    You should override this if you define FUNCTION_EXTRA_EPILOGUE.  */
  934. #define USE_RETURN_INSN use_return_insn ()
  935.  
  936. /* Store in the variable DEPTH the initial difference between the
  937.    frame pointer reg contents and the stack pointer reg contents,
  938.    as of the start of the function body.  This depends on the layout
  939.    of the fixed parts of the stack frame and on how registers are saved.
  940.  
  941.    On the 68k, if we have a frame, we must add one word to its length
  942.    to allow for the place that a6 is stored when we do have a frame pointer.
  943.    Otherwise, we would need to compute the offset from the frame pointer
  944.    of a local variable as a function of frame_pointer_needed, which
  945.    is hard.  */
  946.  
  947. #define INITIAL_FRAME_POINTER_OFFSET(DEPTH)            \
  948. { int regno;                            \
  949.   int offset = -4;                        \
  950.   for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++)    \
  951.     if (regs_ever_live[regno] && ! call_used_regs[regno])    \
  952.       offset += 12;                        \
  953.   for (regno = 0; regno < 16; regno++)                \
  954.     if (regs_ever_live[regno] && ! call_used_regs[regno])    \
  955.       offset += 4;                        \
  956.   (DEPTH) = (offset + ((get_frame_size () + 3) & -4)        \
  957.          + (get_frame_size () == 0 ? 0 : 4));        \
  958. }
  959.  
  960. /* Output assembler code for a block containing the constant parts
  961.    of a trampoline, leaving space for the variable parts.  */
  962.  
  963. /* On the 68k, the trampoline looks like this:
  964.      mov  @#.,a0
  965.      jsr  @#___trampoline
  966.      jsr  @#___trampoline
  967.      .long STATIC
  968.      .long FUNCTION
  969. The reason for having three jsr insns is so that an entire line
  970. of the instruction cache is filled in a predictable way
  971. that will always be the same.
  972.  
  973. We always use the assembler label ___trampoline
  974. regardless of whether the system adds underscores.  */
  975.  
  976. #define TRAMPOLINE_TEMPLATE(FILE)                    \
  977. {                                    \
  978.   ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x207c));    \
  979.   ASM_OUTPUT_SHORT (FILE, const0_rtx);                    \
  980.   ASM_OUTPUT_SHORT (FILE, const0_rtx);                    \
  981.   ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9));    \
  982.   ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\
  983.   ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9));    \
  984.   ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\
  985.   ASM_OUTPUT_SHORT (FILE, const0_rtx);                    \
  986.   ASM_OUTPUT_SHORT (FILE, const0_rtx);                    \
  987.   ASM_OUTPUT_SHORT (FILE, const0_rtx);                    \
  988.   ASM_OUTPUT_SHORT (FILE, const0_rtx);                    \
  989. }
  990.  
  991. /* Length in units of the trampoline for entering a nested function.  */
  992.  
  993. #define TRAMPOLINE_SIZE 26
  994.  
  995. /* Alignment required for a trampoline.  16 is used to find the
  996.    beginning of a line in the instruction cache.  */
  997.  
  998. #define TRAMPOLINE_ALIGN 16
  999.  
  1000. /* Emit RTL insns to initialize the variable parts of a trampoline.
  1001.    FNADDR is an RTX for the address of the function's pure code.
  1002.    CXT is an RTX for the static chain value for the function.  */
  1003.  
  1004. #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)            \
  1005. {                                    \
  1006.   emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), TRAMP); \
  1007.   emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 18)), CXT); \
  1008.   emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 22)), FNADDR); \
  1009. }
  1010.  
  1011. /* This is the library routine that is used
  1012.    to transfer control from the trampoline
  1013.    to the actual nested function.  */
  1014.  
  1015. /* A colon is used with no explicit operands
  1016.    to cause the template string to be scanned for %-constructs.  */
  1017. /* The function name __transfer_from_trampoline is not actually used.
  1018.    The function definition just permits use of "asm with operands"
  1019.    (though the operand list is empty).  */
  1020. #define TRANSFER_FROM_TRAMPOLINE                \
  1021. void                                \
  1022. __transfer_from_trampoline ()                    \
  1023. {                                \
  1024.   register char *a0 asm ("%a0");                \
  1025.   asm (GLOBAL_ASM_OP " ___trampoline");                \
  1026.   asm ("___trampoline:");                    \
  1027.   asm volatile ("move%.l %0,%@" : : "m" (a0[22]));        \
  1028.   asm volatile ("move%.l %1,%0" : "=a" (a0) : "m" (a0[18]));    \
  1029.   asm ("rts":);                            \
  1030. }
  1031.  
  1032. /* Addressing modes, and classification of registers for them.  */
  1033.  
  1034. #define HAVE_POST_INCREMENT
  1035. /* #define HAVE_POST_DECREMENT */
  1036.  
  1037. #define HAVE_PRE_DECREMENT
  1038. /* #define HAVE_PRE_INCREMENT */
  1039.  
  1040. /* Macros to check register numbers against specific register classes.  */
  1041.  
  1042. /* These assume that REGNO is a hard or pseudo reg number.
  1043.    They give nonzero only if REGNO is a hard reg of the suitable class
  1044.    or a pseudo reg currently allocated to a suitable hard reg.
  1045.    Since they use reg_renumber, they are safe only once reg_renumber
  1046.    has been allocated, which happens in local-alloc.c.  */
  1047.  
  1048. #define REGNO_OK_FOR_INDEX_P(REGNO) \
  1049. ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)
  1050. #define REGNO_OK_FOR_BASE_P(REGNO) \
  1051. (((REGNO) ^ 010) < 8 || (unsigned) (reg_renumber[REGNO] ^ 010) < 8)
  1052. #define REGNO_OK_FOR_DATA_P(REGNO) \
  1053. ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)
  1054. #define REGNO_OK_FOR_FP_P(REGNO) \
  1055. (((REGNO) ^ 020) < 8 || (unsigned) (reg_renumber[REGNO] ^ 020) < 8)
  1056. #ifdef SUPPORT_SUN_FPA
  1057. #define REGNO_OK_FOR_FPA_P(REGNO) \
  1058. (((REGNO) >= 24 && (REGNO) < 56) || (reg_renumber[REGNO] >= 24 && reg_renumber[REGNO] < 56))
  1059. #endif
  1060.  
  1061. /* Now macros that check whether X is a register and also,
  1062.    strictly, whether it is in a specified class.
  1063.  
  1064.    These macros are specific to the 68000, and may be used only
  1065.    in code for printing assembler insns and in conditions for
  1066.    define_optimization.  */
  1067.  
  1068. /* 1 if X is a data register.  */
  1069.  
  1070. #define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))
  1071.  
  1072. /* 1 if X is an fp register.  */
  1073.  
  1074. #define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))
  1075.  
  1076. /* 1 if X is an address register  */
  1077.  
  1078. #define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))
  1079.  
  1080. #ifdef SUPPORT_SUN_FPA
  1081. /* 1 if X is a register in the Sun FPA.  */
  1082. #define FPA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FPA_P (REGNO (X)))
  1083. #else
  1084. /* Answer must be no if we don't have an FPA.  */
  1085. #define FPA_REG_P(X) 0
  1086. #endif
  1087.  
  1088. /* Maximum number of registers that can appear in a valid memory address.  */
  1089.  
  1090. #define MAX_REGS_PER_ADDRESS 2
  1091.  
  1092. /* Recognize any constant value that is a valid address.  */
  1093.  
  1094. #define CONSTANT_ADDRESS_P(X)   \
  1095.   (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF        \
  1096.    || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST        \
  1097.    || GET_CODE (X) == HIGH)
  1098.  
  1099. /* Nonzero if the constant value X is a legitimate general operand.
  1100.    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
  1101.  
  1102. #define LEGITIMATE_CONSTANT_P(X) 1
  1103.  
  1104. /* Nonzero if the constant value X is a legitimate general operand
  1105.    when generating PIC code.  It is given that flag_pic is on and 
  1106.    that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
  1107.  
  1108. #define LEGITIMATE_PIC_OPERAND_P(X)    \
  1109.   (! symbolic_operand (X, VOIDmode))
  1110.  
  1111. /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
  1112.    and check its validity for a certain class.
  1113.    We have two alternate definitions for each of them.
  1114.    The usual definition accepts all pseudo regs; the other rejects
  1115.    them unless they have been allocated suitable hard regs.
  1116.    The symbol REG_OK_STRICT causes the latter definition to be used.
  1117.  
  1118.    Most source files want to accept pseudo regs in the hope that
  1119.    they will get allocated to the class that the insn wants them to be in.
  1120.    Source files for reload pass need to be strict.
  1121.    After reload, it makes no difference, since pseudo regs have
  1122.    been eliminated by then.  */
  1123.  
  1124. #ifndef REG_OK_STRICT
  1125.  
  1126. /* Nonzero if X is a hard reg that can be used as an index
  1127.    or if it is a pseudo reg.  */
  1128. #define REG_OK_FOR_INDEX_P(X) ((REGNO (X) ^ 020) >= 8)
  1129. /* Nonzero if X is a hard reg that can be used as a base reg
  1130.    or if it is a pseudo reg.  */
  1131. #define REG_OK_FOR_BASE_P(X) ((REGNO (X) & ~027) != 0)
  1132.  
  1133. #else
  1134.  
  1135. /* Nonzero if X is a hard reg that can be used as an index.  */
  1136. #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
  1137. /* Nonzero if X is a hard reg that can be used as a base reg.  */
  1138. #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
  1139.  
  1140. #endif
  1141.  
  1142. /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
  1143.    that is a valid memory address for an instruction.
  1144.    The MODE argument is the machine mode for the MEM expression
  1145.    that wants to use this address.
  1146.  
  1147.    When generating PIC, an address involving a SYMBOL_REF is legitimate
  1148.    if and only if it is the sum of pic_offset_table_rtx and the SYMBOL_REF.
  1149.    We use LEGITIMATE_PIC_OPERAND_P to throw out the illegitimate addresses,
  1150.    and we explicitly check for the sum of pic_offset_table_rtx and a SYMBOL_REF.
  1151.  
  1152.    Likewise for a LABEL_REF when generating PIC.
  1153.  
  1154.    The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS.  */
  1155.  
  1156. /* Allow SUBREG everywhere we allow REG.  This results in better code.  It
  1157.    also makes function inlining work when inline functions are called with
  1158.    arguments that are SUBREGs.  */
  1159.  
  1160. #define LEGITIMATE_BASE_REG_P(X)   \
  1161.   ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))    \
  1162.    || (GET_CODE (X) == SUBREG                \
  1163.        && GET_CODE (SUBREG_REG (X)) == REG        \
  1164.        && REG_OK_FOR_BASE_P (SUBREG_REG (X))))
  1165.  
  1166. #define INDIRECTABLE_1_ADDRESS_P(X)  \
  1167.   ((CONSTANT_ADDRESS_P (X) && (!flag_pic || LEGITIMATE_PIC_OPERAND_P (X))) \
  1168.    || LEGITIMATE_BASE_REG_P (X)                        \
  1169.    || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC)        \
  1170.        && LEGITIMATE_BASE_REG_P (XEXP (X, 0)))                \
  1171.    || (GET_CODE (X) == PLUS                        \
  1172.        && LEGITIMATE_BASE_REG_P (XEXP (X, 0))                \
  1173.        && GET_CODE (XEXP (X, 1)) == CONST_INT                \
  1174.        && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)        \
  1175.    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  1176.        && flag_pic == 3 && CONSTANT_ADDRESS_P (XEXP (X, 1)))        \
  1177.    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  1178.        && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)        \
  1179.    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  1180.        && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF))        \
  1181.  
  1182. #if 0
  1183. /* This should replace the last two (non-pic) lines
  1184.    except that Sun's assembler does not seem to handle such operands.  */
  1185.        && (TARGET_68020 ? CONSTANT_ADDRESS_P (XEXP (X, 1))        \
  1186.        : (GET_CODE (XEXP (X, 1)) == CONST_INT            \
  1187.           && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000))))
  1188. #endif
  1189.  
  1190.  
  1191. #define GO_IF_NONINDEXED_ADDRESS(X, ADDR)  \
  1192. { if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; }
  1193.  
  1194. /* Only labels on dispatch tables are valid for indexing from.  */
  1195. #define GO_IF_INDEXABLE_BASE(X, ADDR)                \
  1196. { rtx temp;                            \
  1197.   if (GET_CODE (X) == LABEL_REF                    \
  1198.       && (temp = next_nonnote_insn (XEXP (X, 0))) != 0        \
  1199.       && GET_CODE (temp) == JUMP_INSN                \
  1200.       && (GET_CODE (PATTERN (temp)) == ADDR_VEC            \
  1201.       || GET_CODE (PATTERN (temp)) == ADDR_DIFF_VEC))    \
  1202.     goto ADDR;                            \
  1203.   if (LEGITIMATE_BASE_REG_P (X)) goto ADDR; }
  1204.  
  1205. #define GO_IF_INDEXING(X, ADDR)    \
  1206. { if (GET_CODE (X) == PLUS && LEGITIMATE_INDEX_P (XEXP (X, 0)))        \
  1207.     { GO_IF_INDEXABLE_BASE (XEXP (X, 1), ADDR); }            \
  1208.   if (GET_CODE (X) == PLUS && LEGITIMATE_INDEX_P (XEXP (X, 1)))        \
  1209.     { GO_IF_INDEXABLE_BASE (XEXP (X, 0), ADDR); } }
  1210.  
  1211. #define GO_IF_INDEXED_ADDRESS(X, ADDR)     \
  1212. { GO_IF_INDEXING (X, ADDR);                        \
  1213.   if (GET_CODE (X) == PLUS)                        \
  1214.     { if (GET_CODE (XEXP (X, 1)) == CONST_INT                \
  1215.       && (unsigned) INTVAL (XEXP (X, 1)) + 0x80 < 0x100)        \
  1216.     { rtx go_temp = XEXP (X, 0); GO_IF_INDEXING (go_temp, ADDR); }    \
  1217.       if (GET_CODE (XEXP (X, 0)) == CONST_INT                \
  1218.       && (unsigned) INTVAL (XEXP (X, 0)) + 0x80 < 0x100)        \
  1219.     { rtx go_temp = XEXP (X, 1); GO_IF_INDEXING (go_temp, ADDR); } } }
  1220.  
  1221. #define LEGITIMATE_INDEX_REG_P(X)   \
  1222.   ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X))    \
  1223.    || (GET_CODE (X) == SIGN_EXTEND            \
  1224.        && GET_CODE (XEXP (X, 0)) == REG            \
  1225.        && GET_MODE (XEXP (X, 0)) == HImode        \
  1226.        && REG_OK_FOR_INDEX_P (XEXP (X, 0)))        \
  1227.    || (GET_CODE (X) == SUBREG                \
  1228.        && GET_CODE (SUBREG_REG (X)) == REG        \
  1229.        && REG_OK_FOR_INDEX_P (SUBREG_REG (X))))
  1230.  
  1231. #define LEGITIMATE_INDEX_P(X)   \
  1232.    (LEGITIMATE_INDEX_REG_P (X)                \
  1233.     || (TARGET_68020 && GET_CODE (X) == MULT        \
  1234.     && LEGITIMATE_INDEX_REG_P (XEXP (X, 0))        \
  1235.     && GET_CODE (XEXP (X, 1)) == CONST_INT        \
  1236.     && (INTVAL (XEXP (X, 1)) == 2            \
  1237.         || INTVAL (XEXP (X, 1)) == 4        \
  1238.         || INTVAL (XEXP (X, 1)) == 8)))
  1239.  
  1240. /* If pic, we accept INDEX+LABEL, which is what do_tablejump makes.  */
  1241. #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
  1242. { GO_IF_NONINDEXED_ADDRESS (X, ADDR);                    \
  1243.   GO_IF_INDEXED_ADDRESS (X, ADDR);                    \
  1244.   if ((flag_pic && flag_pic < 3) && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS    \
  1245.       && LEGITIMATE_INDEX_P (XEXP (X, 0))                \
  1246.       && GET_CODE (XEXP (X, 1)) == LABEL_REF)                \
  1247.     goto ADDR; }
  1248.  
  1249. /* Don't call memory_address_noforce for the address to fetch
  1250.    the switch offset.  This address is ok as it stands (see above),
  1251.    but memory_address_noforce would alter it.  */
  1252. #define PIC_CASE_VECTOR_ADDRESS(index) index
  1253.  
  1254. /* Try machine-dependent ways of modifying an illegitimate address
  1255.    to be legitimate.  If we find one, return the new, valid address.
  1256.    This macro is used in only one place: `memory_address' in explow.c.
  1257.  
  1258.    OLDX is the address as it was before break_out_memory_refs was called.
  1259.    In some cases it is useful to look at this to decide what needs to be done.
  1260.  
  1261.    MODE and WIN are passed so that this macro can use
  1262.    GO_IF_LEGITIMATE_ADDRESS.
  1263.  
  1264.    It is always safe for this macro to do nothing.  It exists to recognize
  1265.    opportunities to optimize the output.
  1266.  
  1267.    For the 68000, we handle X+REG by loading X into a register R and
  1268.    using R+REG.  R will go in an address reg and indexing will be used.
  1269.    However, if REG is a broken-out memory address or multiplication,
  1270.    nothing needs to be done because REG can certainly go in an address reg.  */
  1271.  
  1272. #define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = 1; }
  1273. #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)   \
  1274. { register int ch = (X) != (OLDX);                    \
  1275.   if (GET_CODE (X) == PLUS)                        \
  1276.     { int copied = 0;                            \
  1277.       if (GET_CODE (XEXP (X, 0)) == MULT)                \
  1278.     { COPY_ONCE (X); XEXP (X, 0) = force_operand (XEXP (X, 0), 0);}    \
  1279.       if (GET_CODE (XEXP (X, 1)) == MULT)                \
  1280.     { COPY_ONCE (X); XEXP (X, 1) = force_operand (XEXP (X, 1), 0);}    \
  1281.       if (ch && GET_CODE (XEXP (X, 1)) == REG                \
  1282.       && GET_CODE (XEXP (X, 0)) == REG)                \
  1283.     goto WIN;                            \
  1284.       if (ch) { GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); }        \
  1285.       if (GET_CODE (XEXP (X, 0)) == REG                    \
  1286.            || (GET_CODE (XEXP (X, 0)) == SIGN_EXTEND        \
  1287.            && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG        \
  1288.            && GET_MODE (XEXP (XEXP (X, 0), 0)) == HImode))    \
  1289.     { register rtx temp = gen_reg_rtx (Pmode);            \
  1290.       register rtx val = force_operand (XEXP (X, 1), 0);        \
  1291.       emit_move_insn (temp, val);                    \
  1292.       COPY_ONCE (X);                        \
  1293.       XEXP (X, 1) = temp;                        \
  1294.       goto WIN; }                            \
  1295.       else if (GET_CODE (XEXP (X, 1)) == REG                \
  1296.            || (GET_CODE (XEXP (X, 1)) == SIGN_EXTEND        \
  1297.            && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG        \
  1298.            && GET_MODE (XEXP (XEXP (X, 1), 0)) == HImode))    \
  1299.     { register rtx temp = gen_reg_rtx (Pmode);            \
  1300.       register rtx val = force_operand (XEXP (X, 0), 0);        \
  1301.       emit_move_insn (temp, val);                    \
  1302.       COPY_ONCE (X);                        \
  1303.       XEXP (X, 0) = temp;                        \
  1304.       goto WIN; }}}
  1305.  
  1306. /* Go to LABEL if ADDR (a legitimate address expression)
  1307.    has an effect that depends on the machine mode it is used for.
  1308.    On the 68000, only predecrement and postincrement address depend thus
  1309.    (the amount of decrement or increment being the length of the operand).  */
  1310.  
  1311. #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)    \
  1312.  if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) goto LABEL
  1313.  
  1314. /* Specify the machine mode that this machine uses
  1315.    for the index in the tablejump instruction.  */
  1316. #define CASE_VECTOR_MODE HImode
  1317.  
  1318. /* Define this if the tablejump instruction expects the table
  1319.    to contain offsets from the address of the table.
  1320.    Do not define this if the table should contain absolute addresses.  */
  1321. #define CASE_VECTOR_PC_RELATIVE
  1322.  
  1323. /* Specify the tree operation to be used to convert reals to integers.  */
  1324. #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
  1325.  
  1326. /* This is the kind of divide that is easiest to do in the general case.  */
  1327. #define EASY_DIV_EXPR TRUNC_DIV_EXPR
  1328.  
  1329. /* Define this as 1 if `char' should by default be signed; else as 0.  */
  1330. #define DEFAULT_SIGNED_CHAR 1
  1331.  
  1332. /* Don't cse the address of the function being compiled.  */
  1333. #define NO_RECURSIVE_FUNCTION_CSE
  1334.  
  1335. /* Max number of bytes we can move from memory to memory
  1336.    in one reasonably fast instruction.  */
  1337. #define MOVE_MAX 4
  1338.  
  1339. /* Define this if zero-extension is slow (more than one real instruction).  */
  1340. #define SLOW_ZERO_EXTEND
  1341.  
  1342. /* Nonzero if access to memory by bytes is slow and undesirable.  */
  1343. #define SLOW_BYTE_ACCESS 0
  1344.  
  1345. /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
  1346.    is done just by pretending it is already truncated.  */
  1347. #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
  1348.  
  1349. /* We assume that the store-condition-codes instructions store 0 for false
  1350.    and some other value for true.  This is the value stored for true.  */
  1351.  
  1352. #define STORE_FLAG_VALUE -1
  1353.  
  1354. /* When a prototype says `char' or `short', really pass an `int'.  */
  1355. #define PROMOTE_PROTOTYPES
  1356.  
  1357. /* Specify the machine mode that pointers have.
  1358.    After generation of rtl, the compiler makes no further distinction
  1359.    between pointers and any other objects of this machine mode.  */
  1360. #define Pmode SImode
  1361.  
  1362. /* A function address in a call instruction
  1363.    is a byte address (for indexing purposes)
  1364.    so give the MEM rtx a byte's mode.  */
  1365. #define FUNCTION_MODE QImode
  1366.  
  1367. /* Compute the cost of computing a constant rtl expression RTX
  1368.    whose rtx-code is CODE.  The body of this macro is a portion
  1369.    of a switch statement.  If the code is computed here,
  1370.    return it with a return statement.  Otherwise, break from the switch.  */
  1371.  
  1372. #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
  1373.   case CONST_INT:                        \
  1374.     /* Constant zero is super cheap due to clr instruction.  */    \
  1375.     if (RTX == const0_rtx) return 0;                \
  1376.     /* Constants between -128 and 127 are cheap due to moveq */ \
  1377.     if (INTVAL (RTX) >= -128 && INTVAL (RTX) <= 127) return 1;    \
  1378.     /* Constants between -136 and 254 are easily generated */    \
  1379.     /* by intelligent uses of moveq, add[q], and subq        */   \
  1380.     if ((OUTER_CODE) == SET && INTVAL (RTX) >= -136        \
  1381.     && INTVAL (RTX) <= 254) return 2;            \
  1382.   case CONST:                            \
  1383.   case LABEL_REF:                        \
  1384.   case SYMBOL_REF:                        \
  1385.     return 3;                            \
  1386.   case CONST_DOUBLE:                        \
  1387.     return 5;
  1388.  
  1389. /* Compute the cost of various arithmetic operations.
  1390.    These are vaguely right for a 68020.  */
  1391. /* The costs for long multiply have been adjusted to
  1392.    work properly in synth_mult on the 68020,
  1393.    relative to an average of the time for add and the time for shift,
  1394.    taking away a little more because sometimes move insns are needed.  */
  1395. #define MULL_COST (TARGET_68040 ? 5 : 13)
  1396. #define MULW_COST (TARGET_68040 ? 3 : 8)
  1397.  
  1398. #define RTX_COSTS(X,CODE,OUTER_CODE)                \
  1399.   case PLUS:                            \
  1400.     /* An lea costs about three times as much as a simple add.  */  \
  1401.     if (GET_MODE (X) == SImode                    \
  1402.     && GET_CODE (XEXP (X, 0)) == REG            \
  1403.     && GET_CODE (XEXP (X, 1)) == MULT            \
  1404.     && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG        \
  1405.     && GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT    \
  1406.     && (INTVAL (XEXP (XEXP (X, 1), 1)) == 2            \
  1407.         || INTVAL (XEXP (XEXP (X, 1), 1)) == 4        \
  1408.         || INTVAL (XEXP (XEXP (X, 1), 1)) == 8))        \
  1409.       return COSTS_N_INSNS (3);     /* lea an@(dx:l:i),am */    \
  1410.     break;                            \
  1411.   case ASHIFT:                            \
  1412.   case ASHIFTRT:                        \
  1413.   case LSHIFT:                            \
  1414.   case LSHIFTRT:                        \
  1415.     /* A shift by a big integer takes an extra instruction.  */ \
  1416.     if (GET_CODE (XEXP (X, 1)) == CONST_INT            \
  1417.     && (INTVAL (XEXP (X, 1)) == 16))            \
  1418.       return COSTS_N_INSNS (2);     /* clrw;swap */        \
  1419.     if (GET_CODE (XEXP (X, 1)) == CONST_INT            \
  1420.     && !(INTVAL (XEXP (X, 1)) > 0                \
  1421.          && INTVAL (XEXP (X, 1)) <= 8))            \
  1422.       return COSTS_N_INSNS (3);     /* lsr #i,dn */        \
  1423.     break;                            \
  1424.   case MULT:                            \
  1425.     if (GET_MODE (X) == QImode || GET_MODE (X) == HImode)    \
  1426.       return COSTS_N_INSNS (MULW_COST);                \
  1427.     else                            \
  1428.       return COSTS_N_INSNS (MULL_COST);                \
  1429.   case DIV:                            \
  1430.   case UDIV:                            \
  1431.   case MOD:                            \
  1432.   case UMOD:                            \
  1433.     if (GET_MODE (X) == QImode || GET_MODE (X) == HImode)    \
  1434.       return COSTS_N_INSNS (27); /* div.w */            \
  1435.     return COSTS_N_INSNS (43);     /* div.l */
  1436.  
  1437. /* Tell final.c how to eliminate redundant test instructions.  */
  1438.  
  1439. /* Here we define machine-dependent flags and fields in cc_status
  1440.    (see `conditions.h').  */
  1441.  
  1442. /* Set if the cc value is actually in the 68881, so a floating point
  1443.    conditional branch must be output.  */
  1444. #define CC_IN_68881 04000
  1445.  
  1446. /* Store in cc_status the expressions that the condition codes will
  1447.    describe after execution of an instruction whose pattern is EXP.
  1448.    Do not alter them if the instruction would not alter the cc's.  */
  1449.  
  1450. /* On the 68000, all the insns to store in an address register fail to
  1451.    set the cc's.  However, in some cases these instructions can make it
  1452.    possibly invalid to use the saved cc's.  In those cases we clear out
  1453.    some or all of the saved cc's so they won't be used.  */
  1454.  
  1455. #define NOTICE_UPDATE_CC(EXP,INSN) notice_update_cc (EXP, INSN)
  1456.  
  1457. #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV)  \
  1458. { if (cc_prev_status.flags & CC_IN_68881)            \
  1459.     return FLOAT;                        \
  1460.   if (cc_prev_status.flags & CC_NO_OVERFLOW)            \
  1461.     return NO_OV;                        \
  1462.   return NORMAL; }
  1463.  
  1464. /* Control the assembler format that we output.  */
  1465.  
  1466. /* Output at beginning of assembler file.  */
  1467.  
  1468. #define ASM_FILE_START(FILE)    \
  1469.   fprintf (FILE, "#NO_APP\n");
  1470.  
  1471. /* Output to assembler file text saying following lines
  1472.    may contain character constants, extra white space, comments, etc.  */
  1473.  
  1474. #define ASM_APP_ON "#APP\n"
  1475.  
  1476. /* Output to assembler file text saying following lines
  1477.    no longer contain unusual constructs.  */
  1478.  
  1479. #define ASM_APP_OFF "#NO_APP\n"
  1480.  
  1481. /* Output before read-only data.  */
  1482.  
  1483. #define TEXT_SECTION_ASM_OP ".text"
  1484.  
  1485. /* Output before writable data.  */
  1486.  
  1487. #define DATA_SECTION_ASM_OP ".data"
  1488.  
  1489. /* Here are four prefixes that are used by asm_fprintf to
  1490.    facilitate customization for alternate assembler syntaxes.
  1491.    Machines with no likelihood of an alternate syntax need not
  1492.    define these and need not use asm_fprintf.  */
  1493.  
  1494. /* The prefix for register names.  Note that REGISTER_NAMES
  1495.    is supposed to include this prefix.  */
  1496.  
  1497. #define REGISTER_PREFIX ""
  1498.  
  1499. /* The prefix for local labels.  You should be able to define this as
  1500.    an empty string, or any arbitrary string (such as ".", ".L%", etc)
  1501.    without having to make any other changes to account for the specific
  1502.    definition.  Note it is a string literal, not interpreted by printf
  1503.    and friends. */
  1504.  
  1505. #define LOCAL_LABEL_PREFIX ""
  1506.  
  1507. /* The prefix to add to user-visible assembler symbols.  */
  1508.  
  1509. #define USER_LABEL_PREFIX "_"
  1510.  
  1511. /* The prefix for immediate operands.  */
  1512.  
  1513. #define IMMEDIATE_PREFIX "#"
  1514.  
  1515. /* How to refer to registers in assembler output.
  1516.    This sequence is indexed by compiler's hard-register-number (see above).  */
  1517.  
  1518. #ifndef SUPPORT_SUN_FPA
  1519.  
  1520. #define REGISTER_NAMES \
  1521. {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",    \
  1522.  "a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp",    \
  1523.  "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7" }
  1524.  
  1525. #else /* SUPPORTED_SUN_FPA */
  1526.  
  1527. #define REGISTER_NAMES \
  1528. {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",    \
  1529.  "a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp",    \
  1530.  "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", \
  1531.  "fpa0", "fpa1", "fpa2", "fpa3", "fpa4", "fpa5", "fpa6", "fpa7", \
  1532.  "fpa8", "fpa9", "fpa10", "fpa11", "fpa12", "fpa13", "fpa14", "fpa15", \
  1533.  "fpa16", "fpa17", "fpa18", "fpa19", "fpa20", "fpa21", "fpa22", "fpa23", \
  1534.  "fpa24", "fpa25", "fpa26", "fpa27", "fpa28", "fpa29", "fpa30", "fpa31" }
  1535.  
  1536. #endif /* defined SUPPORT_SUN_FPA */
  1537.  
  1538. /* How to renumber registers for dbx and gdb.
  1539.    On the Sun-3, the floating point registers have numbers
  1540.    18 to 25, not 16 to 23 as they do in the compiler.  */
  1541.  
  1542. #define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2)
  1543.  
  1544. /* This is how to output the definition of a user-level label named NAME,
  1545.    such as the label on a static function or variable NAME.  */
  1546.  
  1547. #define ASM_OUTPUT_LABEL(FILE,NAME)    \
  1548.   do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
  1549.  
  1550. /* This is how to output a command to make the user-level label named NAME
  1551.    defined for reference from other files.  */
  1552.  
  1553. #define GLOBAL_ASM_OP ".globl"
  1554. #define ASM_GLOBALIZE_LABEL(FILE,NAME)    \
  1555.   do { fprintf (FILE, "%s ", GLOBAL_ASM_OP);        \
  1556.        assemble_name (FILE, NAME);            \
  1557.        fputs ("\n", FILE);} while (0)
  1558.  
  1559. /* This is how to output a reference to a user-level label named NAME.
  1560.    `assemble_name' uses this.  */
  1561.  
  1562. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  1563.   asm_fprintf (FILE, "%0U%s", NAME)
  1564.  
  1565. /* This is how to output an internal numbered label where
  1566.    PREFIX is the class of label and NUM is the number within the class.  */
  1567.  
  1568. #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)    \
  1569.   asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)
  1570.  
  1571. /* This is how to store into the string LABEL
  1572.    the symbol_ref name of an internal numbered label where
  1573.    PREFIX is the class of label and NUM is the number within the class.
  1574.    This is suitable for output with `assemble_name'.  */
  1575.  
  1576. #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)    \
  1577.   sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM)
  1578.  
  1579. /* This is how to output a `long double' extended real constant. */
  1580.   
  1581. #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE)                  \
  1582. do { long l[3];                                \
  1583.      REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l);            \
  1584.      if (sizeof (int) == sizeof (long))                    \
  1585.        fprintf (FILE, "\t.long 0x%x,0x%x,0x%x\n", l[0], l[1], l[2]);    \
  1586.      else                                \
  1587.        fprintf (FILE, "\t.long 0x%lx,0x%lx,0x%lx\n", l[0], l[1], l[2]);    \
  1588.    } while (0)
  1589.   
  1590. /* This is how to output an assembler line defining a `double' constant.  */
  1591.  
  1592. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                \
  1593.   do { char dstr[30];                        \
  1594.        REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr);        \
  1595.        fprintf (FILE, "\t.double 0r%s\n", dstr);        \
  1596.      } while (0)
  1597.  
  1598. /* This is how to output an assembler line defining a `float' constant.  */
  1599.  
  1600. #define ASM_OUTPUT_FLOAT(FILE,VALUE)            \
  1601. do { long l;                        \
  1602.      REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);        \
  1603.      if (sizeof (int) == sizeof (long))            \
  1604.        fprintf (FILE, "\t.long 0x%x\n", l);        \
  1605.      else                        \
  1606.        fprintf (FILE, "\t.long 0x%lx\n", l);        \
  1607.    } while (0)
  1608.  
  1609. /* This is how to output an assembler line defining an `int' constant.  */
  1610.  
  1611. #define ASM_OUTPUT_INT(FILE,VALUE)  \
  1612. ( fprintf (FILE, "\t.long "),            \
  1613.   output_addr_const (FILE, (VALUE)),        \
  1614.   fprintf (FILE, "\n"))
  1615.  
  1616. /* Likewise for `char' and `short' constants.  */
  1617.  
  1618. #define ASM_OUTPUT_SHORT(FILE,VALUE)  \
  1619. ( fprintf (FILE, "\t.word "),            \
  1620.   output_addr_const (FILE, (VALUE)),        \
  1621.   fprintf (FILE, "\n"))
  1622.  
  1623. #define ASM_OUTPUT_CHAR(FILE,VALUE)  \
  1624. ( fprintf (FILE, "\t.byte "),            \
  1625.   output_addr_const (FILE, (VALUE)),        \
  1626.   fprintf (FILE, "\n"))
  1627.  
  1628. /* This is how to output an assembler line for a numeric constant byte.  */
  1629.  
  1630. #define ASM_OUTPUT_BYTE(FILE,VALUE)  \
  1631.   fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
  1632.  
  1633. /* This is how to output an insn to push a register on the stack.
  1634.    It need not be very fast code.  */
  1635.  
  1636. #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \
  1637.   asm_fprintf (FILE, "\tmovel %s,%Rsp@-\n", reg_names[REGNO])
  1638.  
  1639. /* This is how to output an insn to pop a register from the stack.
  1640.    It need not be very fast code.  */
  1641.  
  1642. #define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
  1643.   asm_fprintf (FILE, "\tmovel %Rsp@+,%s\n", reg_names[REGNO])
  1644.  
  1645. /* This is how to output an element of a case-vector that is absolute.
  1646.    (The 68000 does not use such vectors,
  1647.    but we must define this macro anyway.)  */
  1648.  
  1649. #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
  1650.   asm_fprintf (FILE, "\t.long %LL%d\n", VALUE)
  1651.  
  1652. /* This is how to output an element of a case-vector that is relative.  */
  1653.  
  1654. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
  1655.   asm_fprintf (FILE, "\t.word %LL%d-%LL%d\n", VALUE, REL)
  1656.  
  1657. /* This is how to output an assembler line
  1658.    that says to advance the location counter
  1659.    to a multiple of 2**LOG bytes.  */
  1660.  
  1661. /* We don't have a way to align to more than a two-byte boundary, so do the
  1662.    best we can and don't complain.  */
  1663. #define ASM_OUTPUT_ALIGN(FILE,LOG)    \
  1664.   if ((LOG) >= 1)            \
  1665.     fprintf (FILE, "\t.even\n");
  1666.  
  1667. #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
  1668.   fprintf (FILE, "\t.skip %u\n", (SIZE))
  1669.  
  1670. /* This says how to output an assembler line
  1671.    to define a global common symbol.  */
  1672.  
  1673. #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
  1674. ( fputs (".comm ", (FILE)),            \
  1675.   assemble_name ((FILE), (NAME)),        \
  1676.   fprintf ((FILE), ",%u\n", (ROUNDED)))
  1677.  
  1678. /* This says how to output an assembler line
  1679.    to define a local common symbol.  */
  1680.  
  1681. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
  1682. ( fputs (".lcomm ", (FILE)),            \
  1683.   assemble_name ((FILE), (NAME)),        \
  1684.   fprintf ((FILE), ",%u\n", (ROUNDED)))
  1685.  
  1686. /* Store in OUTPUT a string (made with alloca) containing
  1687.    an assembler-name for a local static variable named NAME.
  1688.    LABELNO is an integer which is different for each call.  */
  1689.  
  1690. #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)    \
  1691. ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),    \
  1692.   sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
  1693.  
  1694. /* Define the parentheses used to group arithmetic operations
  1695.    in assembler code.  */
  1696.  
  1697. #define ASM_OPEN_PAREN "("
  1698. #define ASM_CLOSE_PAREN ")"
  1699.  
  1700. /* Define results of standard character escape sequences.  */
  1701. #define TARGET_BELL 007
  1702. #define TARGET_BS 010
  1703. #define TARGET_TAB 011
  1704. #define TARGET_NEWLINE 012
  1705. #define TARGET_VT 013
  1706. #define TARGET_FF 014
  1707. #define TARGET_CR 015
  1708.  
  1709. /* Output a float value (represented as a C double) as an immediate operand.
  1710.    This macro is a 68k-specific macro.  */
  1711.  
  1712. #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE)        \
  1713.  do {                                \
  1714.       if (CODE == 'f')                        \
  1715.         {                            \
  1716.           char dstr[30];                    \
  1717.           REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr);        \
  1718.           asm_fprintf ((FILE), "%I0r%s", dstr);            \
  1719.         }                            \
  1720.       else                            \
  1721.         {                            \
  1722.           long l;                        \
  1723.           REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);        \
  1724.           if (sizeof (int) == sizeof (long))            \
  1725.             asm_fprintf ((FILE), "%I0x%x", l);            \
  1726.           else                            \
  1727.             asm_fprintf ((FILE), "%I0x%lx", l);            \
  1728.         }                            \
  1729.      } while (0)
  1730.  
  1731. /* Output a double value (represented as a C double) as an immediate operand.
  1732.    This macro is a 68k-specific macro.  */
  1733. #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)                \
  1734.  do { char dstr[30];                            \
  1735.       REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr);            \
  1736.       asm_fprintf (FILE, "%I0r%s", dstr);                \
  1737.     } while (0)
  1738.  
  1739. /* Note, long double immediate operands are not actually
  1740.    generated by m68k.md.  */
  1741. #define ASM_OUTPUT_LONG_DOUBLE_OPERAND(FILE,VALUE)            \
  1742.  do { char dstr[30];                            \
  1743.       REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr);            \
  1744.       asm_fprintf (FILE, "%I0r%s", dstr);                \
  1745.     } while (0)
  1746.  
  1747. /* Print operand X (an rtx) in assembler syntax to file FILE.
  1748.    CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
  1749.    For `%' followed by punctuation, CODE is the punctuation and X is null.
  1750.  
  1751.    On the 68000, we use several CODE characters:
  1752.    '.' for dot needed in Motorola-style opcode names.
  1753.    '-' for an operand pushing on the stack:
  1754.        sp@-, -(sp) or -(%sp) depending on the style of syntax.
  1755.    '+' for an operand pushing on the stack:
  1756.        sp@+, (sp)+ or (%sp)+ depending on the style of syntax.
  1757.    '@' for a reference to the top word on the stack:
  1758.        sp@, (sp) or (%sp) depending on the style of syntax.
  1759.    '#' for an immediate operand prefix (# in MIT and Motorola syntax
  1760.        but & in SGS syntax).
  1761.    '!' for the fpcr register (used in some float-to-fixed conversions).
  1762.    '$' for the letter `s' in an op code, but only on the 68040.
  1763.    '&' for the letter `d' in an op code, but only on the 68040.
  1764.    '/' for register prefix needed by longlong.h.
  1765.  
  1766.    'b' for byte insn (no effect, on the Sun; this is for the ISI).
  1767.    'd' to force memory addressing to be absolute, not relative.
  1768.    'f' for float insn (print a CONST_DOUBLE as a float rather than in hex)
  1769.    'w' for FPA insn (print a CONST_DOUBLE as a SunFPA constant rather
  1770.        than directly).  Second part of 'y' below.
  1771.    'x' for float insn (print a CONST_DOUBLE as a float rather than in hex),
  1772.        or print pair of registers as rx:ry.
  1773.    'y' for a FPA insn (print pair of registers as rx:ry).  This also outputs
  1774.        CONST_DOUBLE's as SunFPA constant RAM registers if
  1775.        possible, so it should not be used except for the SunFPA. */
  1776.  
  1777. #define PRINT_OPERAND_PUNCT_VALID_P(CODE)                \
  1778.   ((CODE) == '.' || (CODE) == '#' || (CODE) == '-'            \
  1779.    || (CODE) == '+' || (CODE) == '@' || (CODE) == '!'            \
  1780.    || (CODE) == '$' || (CODE) == '&' || (CODE) == '/')
  1781.  
  1782. /* A C compound statement to output to stdio stream STREAM the
  1783.    assembler syntax for an instruction operand X.  X is an RTL
  1784.    expression.
  1785.  
  1786.    CODE is a value that can be used to specify one of several ways
  1787.    of printing the operand.  It is used when identical operands
  1788.    must be printed differently depending on the context.  CODE
  1789.    comes from the `%' specification that was used to request
  1790.    printing of the operand.  If the specification was just `%DIGIT'
  1791.    then CODE is 0; if the specification was `%LTR DIGIT' then CODE
  1792.    is the ASCII code for LTR.
  1793.  
  1794.    If X is a register, this macro should print the register's name.
  1795.    The names can be found in an array `reg_names' whose type is
  1796.    `char *[]'.  `reg_names' is initialized from `REGISTER_NAMES'.
  1797.  
  1798.    When the machine description has a specification `%PUNCT' (a `%'
  1799.    followed by a punctuation character), this macro is called with
  1800.    a null pointer for X and the punctuation character for CODE.
  1801.  
  1802.    See m68k.c for the m68k specific codes.  */
  1803.  
  1804. #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
  1805.  
  1806. /* A C compound statement to output to stdio stream STREAM the
  1807.    assembler syntax for an instruction operand that is a memory
  1808.    reference whose address is ADDR.  ADDR is an RTL expression.
  1809.  
  1810.    On some machines, the syntax for a symbolic address depends on
  1811.    the section that the address refers to.  On these machines,
  1812.    define the macro `ENCODE_SECTION_INFO' to store the information
  1813.    into the `symbol_ref', and then check for it here.  */
  1814.  
  1815. #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
  1816.  
  1817.  
  1818. /* Definitions for generating bytecode */
  1819.  
  1820. /* Just so it's known this target is supported by the bytecode generator.
  1821.    If this define isn't found anywhere in the target config files, then
  1822.    dummy stubs are supplied by bytecode.h, and any attempt to use
  1823.    -fbytecode will result in an error message. */
  1824.  
  1825. #define TARGET_SUPPORTS_BYTECODE
  1826.  
  1827. /* Minimal segment alignment within sections is 8 units. */
  1828. #define MACHINE_SEG_ALIGN 3
  1829.  
  1830. /* Integer alignment is two units. */
  1831. #define INT_ALIGN 2
  1832.  
  1833. /* Pointer alignment is eight units. */
  1834. #define PTR_ALIGN 3
  1835.  
  1836. /* Global symbols begin with `_' */
  1837. #define NAMES_HAVE_UNDERSCORES
  1838.  
  1839. /* BC_xxx below are similar to their ASM_xxx counterparts above. */
  1840. #define BC_GLOBALIZE_LABEL(FP, NAME) bc_globalize_label(NAME)
  1841.  
  1842. #define BC_OUTPUT_COMMON(FP, NAME, SIZE, ROUNDED) \
  1843.   do { bc_emit_common(NAME, ROUNDED); bc_globalize_label(NAME); } while (0)
  1844.  
  1845. #define BC_OUTPUT_LOCAL(FP, NAME, SIZE, ROUNDED) \
  1846.   bc_emit_common(NAME, ROUNDED)
  1847.  
  1848. #define BC_OUTPUT_ALIGN(FP, ALIGN) bc_align(ALIGN)
  1849.  
  1850. #define BC_OUTPUT_LABEL(FP, NAME) bc_emit_labeldef(NAME)
  1851.  
  1852. #define BC_OUTPUT_SKIP(FP, SIZE) bc_emit_skip(SIZE)
  1853.  
  1854. #define BC_OUTPUT_LABELREF(FP, NAME)                          \
  1855.   do {                                          \
  1856.     char *foo = (char *) xmalloc(strlen(NAME) + 2);                  \
  1857.     strcpy(foo, "_");                                  \
  1858.     strcat(foo, NAME);                                  \
  1859.     bc_emit_labelref (foo);                              \
  1860.     free (foo);                                      \
  1861.   } while (0)
  1862.  
  1863. #define BC_OUTPUT_FLOAT(FP, VAL)                          \
  1864.   do {                                          \
  1865.     float F = VAL;                                  \
  1866.     bc_emit ((char *) &F, sizeof F);                          \
  1867.   } while (0)
  1868.  
  1869. #define BC_OUTPUT_DOUBLE(FP, VAL)                          \
  1870.   do {                                          \
  1871.     double D = VAL;                                  \
  1872.     bc_emit ((char *) &D, sizeof D);                          \
  1873.   } while (0)
  1874.  
  1875. #define BC_OUTPUT_BYTE(FP, VAL)                          \
  1876.   do {                                          \
  1877.     char C = VAL;                                  \
  1878.     bc_emit (&C, 1);                                  \
  1879.   } while (0)
  1880.  
  1881.  
  1882. #define BC_OUTPUT_FILE ASM_OUTPUT_FILE
  1883. #define BC_OUTPUT_ASCII ASM_OUTPUT_ASCII
  1884. #define BC_OUTPUT_IDENT ASM_OUTPUT_IDENT
  1885.  
  1886. /* Same as XSTR, but for bytecode */
  1887. #define BCXSTR(RTX)  ((RTX)->bc_label)
  1888.  
  1889.  
  1890. /* Flush bytecode buffer onto file */
  1891. #define BC_WRITE_FILE(FP) \
  1892. { \
  1893.   fprintf (FP, ".text\n"); \
  1894.   bc_seg_write (bc_text_seg, FP); \
  1895.   fprintf(FP, "\n.data\n"); \
  1896.   bc_seg_write (bc_data_seg, FP); \
  1897.   bc_sym_write (FP);  /* do .globl, .bss, etc. */ \
  1898. }
  1899.  
  1900. /* Write one symbol */
  1901. #define BC_WRITE_SEGSYM(SEGSYM, FP) \
  1902. { \
  1903.   prsym (FP, (SEGSYM)->sym->name); \
  1904.   fprintf (FP, ":\n"); \
  1905. }
  1906.  
  1907.  
  1908. /* Write one reloc entry */
  1909. #define BC_WRITE_RELOC_ENTRY(SEGRELOC, FP, OFFSET) \
  1910. { \
  1911.   fprintf (FP, "\t.long "); \
  1912.   prsym (FP, (SEGRELOC)->sym->name); \
  1913.   fprintf (FP, " + %d\n", OFFSET); \
  1914. }
  1915.  
  1916. /* Start new line of bytecodes */
  1917. #define BC_START_BYTECODE_LINE(FP) \
  1918. { \
  1919.   fprintf (FP, "\t.byte"); \
  1920. }
  1921.  
  1922. /* Write one bytecode */
  1923. #define BC_WRITE_BYTECODE(SEP, VAL, FP) \
  1924. { \
  1925.   fprintf (FP, "%c0x%02X", (SEP), (VAL) & 0xff); \
  1926. }
  1927.  
  1928. /* Write one bytecode RTL entry */
  1929. #define BC_WRITE_RTL(R, FP) \
  1930. { \
  1931.   fprintf (FP, "%s+%d/0x%08X\n", (R)->label, (R)->offset, (R)->bc_label); \
  1932. }
  1933.  
  1934.  
  1935. /* Emit function entry trampoline */
  1936. #define BC_EMIT_TRAMPOLINE(TRAMPSEG, CALLINFO) \
  1937. { \
  1938.   short insn; \
  1939.  \
  1940.   /* Push a reference to the callinfo structure.  */ \
  1941.   insn = 0x4879;        /* pea xxx.L */ \
  1942.   seg_data (TRAMPSEG, (char *) &insn, sizeof insn); \
  1943.   seg_refsym (TRAMPSEG, CALLINFO, 0); \
  1944.  \
  1945.   /* Call __interp, pop arguments, and return.  */ \
  1946.   insn = 0x4eb9;        /* jsr xxx.L  */ \
  1947.   seg_data (TRAMPSEG, (char *) &insn, sizeof insn); \
  1948.   seg_refsym (TRAMPSEG, "__callint", 0); \
  1949.   insn = 0x588f;        /* addql #4, sp */ \
  1950.   seg_data (TRAMPSEG, (char *) &insn, sizeof insn); \
  1951.   insn = 0x4e75;        /* rts */ \
  1952.   seg_data (TRAMPSEG, (char *) &insn, sizeof insn); \
  1953. }
  1954.  
  1955.  
  1956.  
  1957. #if 0
  1958. #define VALIDATE_STACK()  if (stack_depth < 0) abort ();
  1959. #else
  1960. #if 0
  1961. #define VALIDATE_STACK() \
  1962.   fprintf (stderr, " %%%d%%", stack_depth);
  1963. #endif
  1964. #endif
  1965.  
  1966. /* Define functions defined in aux-output.c and used in templates.  */
  1967.  
  1968. extern char *output_move_double ();
  1969. extern char *output_move_const_single ();
  1970. extern char *output_move_const_double ();
  1971. extern char *output_btst ();
  1972.  
  1973. /*
  1974. Local variables:
  1975. version-control: t
  1976. End:
  1977. */
  1978.