|
|
1.1 root 1: /* Definitions of target machine for GNU compiler.
2: Motorola m88100 in an 88open OCS/BCS environment.
3: Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
4: Contributed by Michael Tiemann ([email protected])
5: Enhanced by Michael Meissner ([email protected])
6: Currently supported by Tom Wood ([email protected])
7:
8: This file is part of GNU CC.
9:
10: GNU CC is free software; you can redistribute it and/or modify
11: it under the terms of the GNU General Public License as published by
12: the Free Software Foundation; either version 2, or (at your option)
13: any later version.
14:
15: GNU CC is distributed in the hope that it will be useful,
16: but WITHOUT ANY WARRANTY; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: GNU General Public License for more details.
19:
20: You should have received a copy of the GNU General Public License
21: along with GNU CC; see the file COPYING. If not, write to
22: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
23:
24: /* The m88100 port of GNU CC adheres to the various standards from 88open.
25: These documents are available by writing:
26:
27: 88open Consortium Ltd.
28: 100 Homeland Court, Suite 800
29: San Jose, CA 95112
30: (408) 436-6600
31:
32: In brief, the current standards are:
33:
34: Binary Compatibility Standard, Release 1.1A, May 1991
35: This provides for portability of application-level software at the
36: executable level for AT&T System V Release 3.2.
37:
38: Object Compatibility Standard, Release 1.1A, May 1991
39: This provides for portability of application-level software at the
40: object file and library level for C, Fortran, and Cobol, and again,
41: largely for SVR3.
42:
43: Under development are standards for AT&T System V Release 4, based on the
44: [generic] System V Application Binary Interface from AT&T. These include:
45:
46: System V Application Binary Interface, Motorola 88000 Processor Supplement
47: Another document from AT&T for SVR4 specific to the m88100.
48: Available from Prentice Hall.
49:
50: System V Application Binary Interface, Motorola 88000 Processor Supplement,
51: Release 1.1, Draft H, May 6, 1991
52: A proposed update to the AT&T document from 88open.
53:
54: System V ABI Implementation Guide for the M88000 Processor,
55: Release 1.0, January 1991
56: A companion ABI document from 88open. */
57:
58: /* Other m88k*.h files include this one and override certain items.
59: At present, these are m88kv3.h, m88kv4.h, m88kdgux.h, and m88kluna.h.
60: Additionally, m88kv4.h and m88kdgux.h include svr4.h first. All other
61: m88k targets except m88kluna.h are based on svr3.h. */
62:
63: /* Choose SVR3 as the default. */
64: #if !defined(DBX_DEBUGGING_INFO) && !defined(DWARF_DEBUGGING_INFO)
65: #include "svr3.h"
66: #endif
67:
68: /* External types used. */
69:
70: /* What instructions are needed to manufacture an integer constant. */
71: enum m88k_instruction {
72: m88k_zero,
73: m88k_or,
74: m88k_subu,
75: m88k_or_lo16,
76: m88k_or_lo8,
77: m88k_set,
78: m88k_oru_hi16,
79: m88k_oru_or
80: };
81:
82: /* External variables/functions defined in m88k.c. */
83:
84: extern char *m88k_pound_sign;
85: extern char *m88k_short_data;
86:
87: extern int m88k_gp_threshold;
88: extern int m88k_prologue_done;
89: extern int m88k_function_number;
90: extern int m88k_fp_offset;
91: extern int m88k_stack_size;
92: extern int m88k_case_index;
93:
94: extern struct rtx_def *m88k_compare_reg;
95: extern struct rtx_def *m88k_compare_op0;
96: extern struct rtx_def *m88k_compare_op1;
97:
98: extern int null_epilogue ();
99: extern int integer_ok_for_set ();
100: extern int m88k_debugger_offset ();
101: extern void m88k_handle_pragma_token ();
102:
103: extern void emit_bcnd ();
104: extern void expand_block_move ();
105: extern void check_float_value ();
106: extern void m88k_layout_frame ();
107: extern void m88k_output_prologue ();
108: extern void m88k_output_epilogue ();
109: extern void output_function_profiler ();
110: extern void output_function_block_profiler ();
111: extern void output_block_profiler ();
112: extern void output_file_start ();
113: extern void output_ascii ();
114: extern void output_label ();
115: extern void print_operand ();
116: extern void print_operand_address ();
117:
118: extern char *output_load_const_int ();
119: extern char *output_load_const_float ();
120: extern char *output_load_const_double ();
121: extern char *output_load_const_dimode ();
122: extern char *output_and ();
123: extern char *output_ior ();
124: extern char *output_xor ();
125: extern char *output_call ();
126:
127: extern struct rtx_def *emit_test ();
128: extern struct rtx_def *legitimize_address ();
129: extern struct rtx_def *legitimize_operand ();
130: extern struct rtx_def *m88k_function_arg ();
131: extern struct rtx_def *m88k_builtin_saveregs ();
132:
133: extern enum m88k_instruction classify_integer ();
134:
135: /* external variables defined elsewhere in the compiler */
136:
137: extern int target_flags; /* -m compiler switches */
138: extern int frame_pointer_needed; /* current function has a FP */
139: extern int current_function_pretend_args_size; /* args size without ... */
140: extern int flag_delayed_branch; /* -fdelayed-branch */
141: extern int flag_pic; /* -fpic */
142: extern char * reg_names[];
143:
144: /* Specify the default monitors. The meaning of these values can
145: be obtained by doing "grep MONITOR_GCC *m88k*". Generally, the
146: values downward from 0x8000 are tests that will soon go away.
147: values upward from 0x1 are generally useful tests that will remain. */
148:
149: #ifndef MONITOR_GCC
150: #define MONITOR_GCC 0
151: #endif
152:
153: /*** Controlling the Compilation Driver, `gcc' ***/
154:
155: /* Some machines may desire to change what optimizations are performed for
156: various optimization levels. This macro, if defined, is executed once
157: just after the optimization level is determined and before the remainder
158: of the command options have been parsed. Values set in this macro are
159: used as the default values for the other command line options.
160:
161: LEVEL is the optimization level specified; 2 if -O2 is specified,
162: 1 if -O is specified, and 0 if neither is specified. */
163:
164: /* This macro used to store 0 in flag_signed_bitfields.
165: Not only is that misuse of this macro; the whole idea is wrong.
166:
167: The GNU C dialect makes bitfields signed by default,
168: regardless of machine type. Making any machine inconsistent in this
169: regard is bad for portability.
170:
171: I chose to make bitfields signed by default because this is consistent
172: with the way ordinary variables are handled: `int' equals `signed int'.
173: If there is a good reason to prefer making bitfields unsigned by default,
174: it cannot have anything to do with the choice of machine.
175: If the reason is good enough, we should change the convention for all machines.
176:
177: -- rms, 20 July 1991. */
178:
179: #define OPTIMIZATION_OPTIONS(LEVEL) \
180: do { \
181: if (LEVEL) \
182: { \
183: flag_omit_frame_pointer = 1; \
184: } \
185: } while (0)
186:
187: /* LIB_SPEC, LINK_SPEC, and STARTFILE_SPEC defined in svr3.h.
188: ASM_SPEC, ASM_FINAL_SPEC, LIB_SPEC, LINK_SPEC, and STARTFILE_SPEC redefined
189: in svr4.h.
190: CPP_SPEC, ASM_SPEC, ASM_FINAL_SPEC, LIB_SPEC, LINK_SPEC, and
191: STARTFILE_SPEC redefined in m88kdgux.h. */
192:
193: /*** Run-time Target Specification ***/
194:
195: /* Names to predefine in the preprocessor for this target machine.
196: Redefined in m88kv3.h, m88kv4.h, m88kdgux.h, and m88kluna.h. */
197: #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -D__CLASSIFY_TYPE__=2"
198:
199: #define TARGET_VERSION fprintf (stderr, " (%s%s)", \
200: VERSION_INFO1, VERSION_INFO2)
201:
202: /* Print subsidiary information on the compiler version in use.
203: Redefined in m88kv4.h, and m88kluna.h. */
204: #define VERSION_INFO1 "88open OCS/BCS, "
205: #define VERSION_INFO2 "12 Feb 1992"
206: #define VERSION_STRING version_string
207: #define TM_SCCS_ID "@(#)m88k.h 1.96.5.5 12 Feb 1992 12:59:25"
208:
209: /* Run-time compilation parameters selecting different hardware subsets. */
210:
211: /* Macro to define tables used to set the flags.
212: This is a list in braces of pairs in braces,
213: each pair being { "NAME", VALUE }
214: where VALUE is the bits to set or minus the bits to clear.
215: An empty string NAME is used to identify the default VALUE. */
216:
217: #define MASK_88100 0x00000001 /* Target m88100 */
218: #define MASK_88110 0x00000002 /* Target m88110 */
219: #define MASK_OCS_DEBUG_INFO 0x00000004 /* Emit .tdesc info */
220: #define MASK_OCS_FRAME_POSITION 0x00000008 /* Debug frame = CFA, not r30 */
221: #define MASK_SVR4 0x00000010 /* Target is AT&T System V.4 */
222: #define MASK_VERSION_0300 0x00000020 /* Use version 03.00 syntax */
223: #define MASK_NO_UNDERSCORES 0x00000040 /* Don't emit a leading `_' */
224: #define MASK_BIG_PIC 0x00000080 /* PIC with large got-rel's -fPIC */
225: #define MASK_TRAP_LARGE_SHIFT 0x00000100 /* Trap if shift not <= 31 */
226: #define MASK_HANDLE_LARGE_SHIFT 0x00000200 /* Handle shift count >= 32 */
227: #define MASK_CHECK_ZERO_DIV 0x00000400 /* Check for int div. by 0 */
228: #define MASK_USE_DIV 0x00000800 /* No signed div. checks */
229: #define MASK_IDENTIFY_REVISION 0x00001000 /* Emit ident, with GCC rev */
230: #define MASK_WARN_PASS_STRUCT 0x00002000 /* Warn about passed structs */
231: #define MASK_OPTIMIZE_ARG_AREA 0x00004000 /* Save stack space */
232:
233: #define MASK_88000 (MASK_88100 | MASK_88110)
234: #define MASK_EITHER_LARGE_SHIFT (MASK_TRAP_LARGE_SHIFT | \
235: MASK_HANDLE_LARGE_SHIFT)
236:
237: #define TARGET_88100 ((target_flags & MASK_88000) == MASK_88100)
238: #define TARGET_88110 ((target_flags & MASK_88000) == MASK_88110)
239: #define TARGET_88000 ((target_flags & MASK_88000) == MASK_88000)
240:
241: #define TARGET_OCS_DEBUG_INFO (target_flags & MASK_OCS_DEBUG_INFO)
242: #define TARGET_OCS_FRAME_POSITION (target_flags & MASK_OCS_FRAME_POSITION)
243: #define TARGET_SVR4 (target_flags & MASK_SVR4)
244: #define TARGET_VERSION_0300 (target_flags & MASK_VERSION_0300)
245: #define TARGET_NO_UNDERSCORES (target_flags & MASK_NO_UNDERSCORES)
246: #define TARGET_BIG_PIC (target_flags & MASK_BIG_PIC)
247: #define TARGET_TRAP_LARGE_SHIFT (target_flags & MASK_TRAP_LARGE_SHIFT)
248: #define TARGET_HANDLE_LARGE_SHIFT (target_flags & MASK_HANDLE_LARGE_SHIFT)
249: #define TARGET_CHECK_ZERO_DIV (target_flags & MASK_CHECK_ZERO_DIV)
250: #define TARGET_USE_DIV (target_flags & MASK_USE_DIV)
251: #define TARGET_IDENTIFY_REVISION (target_flags & MASK_IDENTIFY_REVISION)
252: #define TARGET_WARN_PASS_STRUCT (target_flags & MASK_WARN_PASS_STRUCT)
253: #define TARGET_OPTIMIZE_ARG_AREA (target_flags & MASK_OPTIMIZE_ARG_AREA)
254:
255: #define TARGET_EITHER_LARGE_SHIFT (target_flags & MASK_EITHER_LARGE_SHIFT)
256:
257: /* Redefined in m88kv3.h,m88kv4.h, and m88kdgux.h. */
258: #define TARGET_DEFAULT (MASK_CHECK_ZERO_DIV)
259: #define CPU_DEFAULT MASK_88100
260:
261: #define TARGET_SWITCHES \
262: { \
263: { "88110", MASK_88110 }, \
264: { "88100", MASK_88100 }, \
265: { "88000", MASK_88000 }, \
266: { "ocs-debug-info", MASK_OCS_DEBUG_INFO }, \
267: { "no-ocs-debug-info", -MASK_OCS_DEBUG_INFO }, \
268: { "ocs-frame-position", MASK_OCS_FRAME_POSITION }, \
269: { "no-ocs-frame-position", -MASK_OCS_FRAME_POSITION }, \
270: { "svr4", MASK_SVR4 }, \
271: { "svr3", -MASK_SVR4 }, \
272: { "version-03.00", MASK_VERSION_0300 }, \
273: { "no-underscores", MASK_NO_UNDERSCORES }, \
274: { "big-pic", MASK_BIG_PIC }, \
275: { "trap-large-shift", MASK_TRAP_LARGE_SHIFT }, \
276: { "handle-large-shift", MASK_HANDLE_LARGE_SHIFT }, \
277: { "check-zero-division", MASK_CHECK_ZERO_DIV }, \
278: { "no-check-zero-division", -MASK_CHECK_ZERO_DIV }, \
279: { "use-div-instruction", MASK_USE_DIV }, \
280: { "identify-revision", MASK_IDENTIFY_REVISION }, \
281: { "warn-passed-structs", MASK_WARN_PASS_STRUCT }, \
282: { "optimize-arg-area", MASK_OPTIMIZE_ARG_AREA }, \
283: { "no-optimize-arg-area", -MASK_OPTIMIZE_ARG_AREA }, \
284: SUBTARGET_SWITCHES \
285: /* Default switches */ \
286: { "", TARGET_DEFAULT }, \
287: }
288:
289: /* Redefined in m88kdgux.h. */
290: #define SUBTARGET_SWITCHES
291:
292: /* Macro to define table for command options with values. */
293:
294: #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }
295:
296: /* Do any checking or such that is needed after processing the -m switches. */
297:
298: #define OVERRIDE_OPTIONS \
299: do { \
300: register int i; \
301: \
302: if ((target_flags & MASK_88000) == 0) \
303: target_flags |= CPU_DEFAULT; \
304: \
305: if (TARGET_BIG_PIC) \
306: flag_pic = 2; \
307: \
308: if ((target_flags & MASK_EITHER_LARGE_SHIFT) == MASK_EITHER_LARGE_SHIFT) \
309: error ("-mtrap-large-shift and -mhandle-large-shift are incompatible");\
310: \
311: if (VERSION_0300_SYNTAX) \
312: { \
313: for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \
314: reg_names[i]--; \
315: m88k_pound_sign = "#"; \
316: } \
317: \
318: if (m88k_short_data) \
319: { \
320: char *p = m88k_short_data; \
321: while (*p) \
322: if (*p >= '0' && *p <= '9') \
323: p++; \
324: else \
325: { \
326: error ("Invalid option `-mshort-data-%s'", m88k_short_data); \
327: break; \
328: } \
329: m88k_gp_threshold = atoi (m88k_short_data); \
330: if (flag_pic) \
331: error ("-mshort-data-%s and PIC are incompatible", m88k_short_data); \
332: } \
333: } while (0)
334:
335: /*** Storage Layout ***/
336:
337: /* Sizes in bits of the various types. */
338: #define CHAR_TYPE_SIZE 8
339: #define SHORT_TYPE_SIZE 16
340: #define INT_TYPE_SIZE 32
341: #define LONG_TYPE_SIZE 32
342: #define LONG_LONG_TYPE_SIZE 64
343: #define FLOAT_TYPE_SIZE 32
344: #define DOUBLE_TYPE_SIZE 64
345: #define LONG_DOUBLE_TYPE_SIZE 64
346:
347: /* Define this if most significant bit is lowest numbered
348: in instructions that operate on numbered bit-fields.
349: Somewhat arbitrary. It matches the bit field patterns. */
350: #define BITS_BIG_ENDIAN 1
351:
352: /* Define this if most significant byte of a word is the lowest numbered.
353: That is true on the m88000. */
354: #define BYTES_BIG_ENDIAN 1
355:
356: /* Define this if most significant word of a multiword number is the lowest
357: numbered.
358: For the m88000 we can decide arbitrarily since there are no machine
359: instructions for them. */
360: #define WORDS_BIG_ENDIAN 1
361:
362: /* Number of bits in an addressible storage unit */
363: #define BITS_PER_UNIT 8
364:
365: /* Width in bits of a "word", which is the contents of a machine register.
366: Note that this is not necessarily the width of data type `int';
367: if using 16-bit ints on a 68000, this would still be 32.
368: But on a machine with 16-bit registers, this would be 16. */
369: #define BITS_PER_WORD 32
370:
371: /* Width of a word, in units (bytes). */
372: #define UNITS_PER_WORD 4
373:
374: /* Width in bits of a pointer.
375: See also the macro `Pmode' defined below. */
376: #define POINTER_SIZE 32
377:
378: /* Allocation boundary (in *bits*) for storing arguments in argument list. */
379: #define PARM_BOUNDARY 32
380:
381: /* Largest alignment for stack parameters (if greater than PARM_BOUNDARY). */
382: #define MAX_PARM_BOUNDARY 64
383:
384: /* Boundary (in *bits*) on which stack pointer should be aligned. */
385: #define STACK_BOUNDARY 128
386:
387: /* Allocation boundary (in *bits*) for the code of a function.
388: Pack code tightly when compiling crtstuff.c. */
389: #define FUNCTION_BOUNDARY (flag_inhibit_size_directive ? 32 : 128)
390:
391: /* No data type wants to be aligned rounder than this. */
392: #define BIGGEST_ALIGNMENT 64
393:
394: /* Make strings word-aligned so strcpy from constants will be faster. */
395: #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
396: (TREE_CODE (EXP) == STRING_CST \
397: && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
398:
399: /* Make arrays of chars word-aligned for the same reasons. */
400: #define DATA_ALIGNMENT(TYPE, ALIGN) \
401: (TREE_CODE (TYPE) == ARRAY_TYPE \
402: && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
403: && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
404:
405: /* Alignment of field after `int : 0' in a structure.
406: Ignored with PCC_BITFIELD_TYPE_MATTERS. */
407: /* #define EMPTY_FIELD_BOUNDARY 8 */
408:
409: /* Every structure's size must be a multiple of this. */
410: #define STRUCTURE_SIZE_BOUNDARY 8
411:
412: /* Define this if move instructions will actually fail to work
413: when given unaligned data. */
414: #define STRICT_ALIGNMENT
415:
416: /* A bitfield declared as `int' forces `int' alignment for the struct. */
417: #define PCC_BITFIELD_TYPE_MATTERS 1
418:
419: /* Maximum size (in bits) to use for the largest integral type that
420: replaces a BLKmode type. */
421: /* #define MAX_FIXED_MODE_SIZE 0 */
422:
423: /* Report errors on floating point, if we are given NaN's, or such. Leave
424: the number as is, though, since we output the number in hex, and the
425: assemble won't choak on it. */
426: #define CHECK_FLOAT_VALUE(MODE,VALUE) check_float_value (MODE, VALUE)
427:
428: /* A code distinguishing the floating point format of the target machine. */
429: /* #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT */
430:
431: /*** Register Usage ***/
432:
433: /* Number of actual hardware registers.
434: The hardware registers are assigned numbers for the compiler
435: from 0 to just below FIRST_PSEUDO_REGISTER.
436: All registers that the compiler knows about must be given numbers,
437: even those that are not normally considered general registers.
438:
439: The m88100 has 32 fullword registers.
440:
441: The pseudo argument pointer is said to be register 0. This prohibits
442: the use of r0 as a general register and causes no trouble.
443: Using register 0 is useful, in that it keeps the number of
444: registers down to 32, and GNU can use a long as a bitmask
445: for the registers. */
446: #define FIRST_PSEUDO_REGISTER 32
447:
448: /* 1 for registers that have pervasive standard uses
449: and are not available for the register allocator.
450: Registers 14-25 are expected to be preserved across
451: function calls.
452:
453: On the 88000, these are:
454: Reg 0 = Pseudo argument pointer (hardware fixed to 0).
455: Reg 1 = Subroutine return pointer (hardware).
456: Reg 2-9 = Parameter registers (OCS).
457: Reg 10 = OCS reserved temporary.
458: Reg 11 = Static link if needed [OCS reserved temporary].
459: Reg 12 = Address of structure return (OCS).
460: Reg 13 = OCS reserved temporary.
461: Reg 14-25 = Preserved register set.
462: Reg 26-29 = Reserved by OCS and ABI.
463: Reg 30 = Frame pointer (Common use).
464: Reg 31 = Stack pointer. */
465:
466: #define FIXED_REGISTERS \
467: {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
468: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1}
469:
470: /* 1 for registers not available across function calls.
471: These must include the FIXED_REGISTERS and also any
472: registers that can be used without being saved.
473: The latter must include the registers where values are returned
474: and the register where structure-value addresses are passed.
475: Aside from that, you can include as many other registers as you like. */
476:
477: #define CALL_USED_REGISTERS \
478: {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \
479: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1}
480:
481: /* Macro to conditionally modify fixed_regs/call_used_regs. */
482: #define CONDITIONAL_REGISTER_USAGE \
483: { \
484: if (flag_pic) \
485: { \
486: fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
487: call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
488: global_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
489: } \
490: }
491:
492: /* These interfaces that don't apply to the m88000. */
493: /* OVERLAPPING_REGNO_P(REGNO) 0 */
494: /* INSN_CLOBBERS_REGNO_P(INSN, REGNO) 0 */
495: /* PRESERVE_DEATH_INFO_REGNO_P(REGNO) 0 */
496:
497: /* Return number of consecutive hard regs needed starting at reg REGNO
498: to hold something of mode MODE.
499: This is ordinarily the length in words of a value of mode MODE
500: but can be less for certain modes in special long registers.
501:
502: On the m88000, ordinary registers hold 32 bits worth;
503: a single floating point register is always enough for
504: anything that can be stored in them at all. */
505: #define HARD_REGNO_NREGS(REGNO, MODE) \
506: ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
507:
508: /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
509:
510: For double integers, we never put the value into an odd register so that
511: the operators don't run into the situation where the high part of one of
512: the inputs is the low part of the result register (it's ok if the output
513: registers are the same as the input registers. */
514: #define HARD_REGNO_MODE_OK(REGNO, MODE) \
515: (((MODE) != DImode && (MODE) != DFmode && (MODE) != DCmode) || \
516: ((REGNO) & 1) == 0)
517:
518: /* Value is 1 if it is a good idea to tie two pseudo registers
519: when one has mode MODE1 and one has mode MODE2.
520: If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
521: for any hard reg, then this must be 0 for correct output. */
522: #define MODES_TIEABLE_P(MODE1, MODE2) \
523: (((MODE1) == DFmode || (MODE1) == DCmode || (MODE1) == DImode) \
524: == ((MODE2) == DFmode || (MODE2) == DCmode || (MODE2) == DImode))
525:
526: /* Specify the registers used for certain standard purposes.
527: The values of these macros are register numbers. */
528:
529: /* the m88000 pc isn't overloaded on a register that the compiler knows about. */
530: /* #define PC_REGNUM */
531:
532: /* Register to use for pushing function arguments. */
533: #define STACK_POINTER_REGNUM 31
534:
535: /* Base register for access to local variables of the function. */
536: #define FRAME_POINTER_REGNUM 30
537:
538: /* Base register for access to arguments of the function. */
539: #define ARG_POINTER_REGNUM 0
540:
541: /* Register used in cases where a temporary is known to be safe to use. */
542: #define TEMP_REGNUM 10
543:
544: /* Register in which static-chain is passed to a function. */
545: #define STATIC_CHAIN_REGNUM 11
546:
547: /* Register in which address to store a structure value
548: is passed to a function. */
549: #define STRUCT_VALUE_REGNUM 12
550:
551: /* Register to hold the addressing base for position independent
552: code access to data items. */
553: #define PIC_OFFSET_TABLE_REGNUM 25
554:
555: /* Order in which registers are preferred (most to least). Use temp
556: registers, then param registers top down. Preserve registers are
557: top down to maximize use of double memory ops for register save.
558: The 88open reserved registers (26-29) may commonly be used in most
559: environments with the -fcall-used- or -fcall-saved- options. */
560: #define REG_ALLOC_ORDER \
561: {13, 12, 11, 10, 29, 28, 27, 26, \
562: 1, 9, 8, 7, 6, 5, 4, 3, \
563: 2, 25, 24, 23, 22, 21, 20, 19, \
564: 18, 17, 16, 15, 14, 30, 31, 0}
565:
566: /*** Register Classes ***/
567:
568: /* Define the classes of registers for register constraints in the
569: machine description. Also define ranges of constants.
570:
571: One of the classes must always be named ALL_REGS and include all hard regs.
572: If there is more than one class, another class must be named NO_REGS
573: and contain no registers.
574:
575: The name GENERAL_REGS must be the name of a class (or an alias for
576: another name such as ALL_REGS). This is the class of registers
577: that is allowed by "g" or "r" in a register constraint.
578: Also, registers outside this class are allocated only when
579: instructions express preferences for them.
580:
581: The classes must be numbered in nondecreasing order; that is,
582: a larger-numbered class must never be contained completely
583: in a smaller-numbered class.
584:
585: For any two classes, it is very desirable that there be another
586: class that represents their union. */
587:
588: /* The m88100 hardware has one kind of register. However, we denote
589: the arg pointer as a separate class. */
590:
591: enum reg_class { NO_REGS, AP_REG, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES };
592:
593: #define N_REG_CLASSES (int) LIM_REG_CLASSES
594:
595: /* Give names of register classes as strings for dump file. */
596: #define REG_CLASS_NAMES {"NO_REGS", "AP_REG", "GENERAL_REGS", "ALL_REGS" }
597:
598: /* Define which registers fit in which classes.
599: This is an initializer for a vector of HARD_REG_SET
600: of length N_REG_CLASSES. */
601: #define REG_CLASS_CONTENTS {0, 1, -2, -1}
602:
603: /* The same information, inverted:
604: Return the class number of the smallest class containing
605: reg number REGNO. This could be a conditional expression
606: or could index an array. */
607: #define REGNO_REG_CLASS(REGNO) ((REGNO) ? GENERAL_REGS : AP_REG)
608:
609: /* The class value for index registers, and the one for base regs. */
610: #define BASE_REG_CLASS ALL_REGS
611: #define INDEX_REG_CLASS GENERAL_REGS
612:
613: /* Get reg_class from a letter such as appears in the machine description. */
614:
615: #define REG_CLASS_FROM_LETTER(C) NO_REGS
616:
617: /* Macros to check register numbers against specific register classes.
618: These assume that REGNO is a hard or pseudo reg number.
619: They give nonzero only if REGNO is a hard reg of the suitable class
620: or a pseudo reg currently allocated to a suitable hard reg.
621: Since they use reg_renumber, they are safe only once reg_renumber
622: has been allocated, which happens in local-alloc.c. */
623: #define REGNO_OK_FOR_BASE_P(REGNO) \
624: ((REGNO) < FIRST_PSEUDO_REGISTER || \
625: (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
626: #define REGNO_OK_FOR_INDEX_P(REGNO) \
627: (((REGNO) && (REGNO) < FIRST_PSEUDO_REGISTER) || \
628: (unsigned) reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER)
629:
630: /* Given an rtx X being reloaded into a reg required to be
631: in class CLASS, return the class of reg to actually use.
632: In general this is just CLASS; but on some machines
633: in some cases it is preferable to use a more restrictive class.
634: Double constants should be in a register iff they can be made cheaply. */
635: #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
636:
637: /* Return the maximum number of consecutive registers
638: needed to represent mode MODE in a register of class CLASS. */
639: #define CLASS_MAX_NREGS(CLASS, MODE) \
640: ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
641:
642: /* Letters in the range `I' through `P' in a register constraint string can
643: be used to stand for particular ranges of immediate operands. The C
644: expression is true iff C is a known letter and VALUE is appropriate for
645: that letter.
646:
647: For the m88000, the following contraints are used:
648: `I' requires a non-negative 16-bit value.
649: `J' requires a non-positive 16-bit value.
650: `K' is unused.
651: `L' requires a constant with only the upper 16-bits set.
652: `M' requires constant values that can be formed with `set'.
653: `N' requires a negative value.
654: `O' requires zero.
655: `P' requires a non-negative value. */
656:
657: /* Quick tests for certain values. */
658: #define SMALL_INT(X) (SMALL_INTVAL (INTVAL (X)))
659: #define SMALL_INTVAL(I) ((unsigned) (I) < 0x10000)
660: #define ADD_INT(X) (ADD_INTVAL (INTVAL (X)))
661: #define ADD_INTVAL(I) ((unsigned) (I) + 0xffff < 0x1ffff)
662: #define POWER_OF_2(I) ((I) && POWER_OF_2_or_0(I))
663: #define POWER_OF_2_or_0(I) (((I) & ((unsigned)(I) - 1)) == 0)
664:
665: #define CONST_OK_FOR_LETTER_P(VALUE, C) \
666: ((C) == 'I' ? SMALL_INTVAL (VALUE) \
667: : (C) == 'J' ? SMALL_INTVAL (-(VALUE)) \
668: : (C) == 'L' ? ((VALUE) & 0xffff) == 0 \
669: : (C) == 'M' ? integer_ok_for_set (VALUE) \
670: : (C) == 'N' ? (VALUE) < 0 \
671: : (C) == 'O' ? (VALUE) == 0 \
672: : (C) == 'P' ? (VALUE) >= 0 \
673: : 0)
674:
675: /* Similar, but for floating constants, and defining letters G and H.
676: Here VALUE is the CONST_DOUBLE rtx itself. For the m88000, the
677: constraints are: `G' requires zero, and `H' requires one or two. */
678: #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
679: ((C) == 'G' ? (CONST_DOUBLE_HIGH (VALUE) == 0 \
680: && CONST_DOUBLE_LOW (VALUE) == 0) \
681: : 0)
682:
683: /* Letters in the range `Q' through `U' in a register constraint string
684: may be defined in a machine-dependent fashion to stand for arbitrary
685: operand types.
686:
687: For the m88k, `Q' handles addresses in a call context. */
688:
689: #define EXTRA_CONSTRAINT(OP, C) \
690: ((C) == 'Q' ? symbolic_address_p (OP) : 0)
691:
692: /*** Describing Stack Layout ***/
693:
694: /* Define this if pushing a word on the stack moves the stack pointer
695: to a smaller address. */
696: #define STACK_GROWS_DOWNWARD
697:
698: /* Define this if the addresses of local variable slots are at negative
699: offsets from the frame pointer. */
700: /* #define FRAME_GROWS_DOWNWARD */
701:
702: /* Offset from the frame pointer to the first local variable slot to be
703: allocated. For the m88k, the debugger wants the return address (r1)
704: stored at location r30+4, and the previous frame pointer stored at
705: location r30. */
706: #define STARTING_FRAME_OFFSET 8
707:
708: /* If we generate an insn to push BYTES bytes, this says how many the
709: stack pointer really advances by. The m88k has no push instruction. */
710: /* #define PUSH_ROUNDING(BYTES) */
711:
712: /* If defined, the maximum amount of space required for outgoing arguments
713: will be computed and placed into the variable
714: `current_function_outgoing_args_size'. No space will be pushed
715: onto the stack for each call; instead, the function prologue should
716: increase the stack frame size by this amount. */
717: #define ACCUMULATE_OUTGOING_ARGS
718:
719: /* Offset from the stack pointer register to the first location at which
720: outgoing arguments are placed. Use the default value zero. */
721: /* #define STACK_POINTER_OFFSET 0 */
722:
723: /* Offset of first parameter from the argument pointer register value.
724: Using an argument pointer, this is 0 for the m88k. GCC knows
725: how to eliminate the argument pointer references if necessary. */
726: #define FIRST_PARM_OFFSET(FNDECL) 0
727:
728: /* Define this if functions should assume that stack space has been
729: allocated for arguments even when their values are passed in
730: registers.
731:
732: The value of this macro is the size, in bytes, of the area reserved for
733: arguments passed in registers.
734:
735: This space can either be allocated by the caller or be a part of the
736: machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE'
737: says which. */
738: #define REG_PARM_STACK_SPACE(FNDECL) 32
739:
740: /* Define this macro if REG_PARM_STACK_SPACE is defined but stack
741: parameters don't skip the area specified by REG_PARM_STACK_SPACE.
742: Normally, when a parameter is not passed in registers, it is placed on
743: the stack beyond the REG_PARM_STACK_SPACE area. Defining this macro
744: suppresses this behavior and causes the parameter to be passed on the
745: stack in its natural location. */
746: #define STACK_PARMS_IN_REG_PARM_AREA
747:
748: /* Define this if it is the responsibility of the caller to allocate the
749: area reserved for arguments passed in registers. If
750: `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect of this
751: macro is to determine whether the space is included in
752: `current_function_outgoing_args_size'. */
753: /* #define OUTGOING_REG_PARM_STACK_SPACE */
754:
755: /* Offset from the stack pointer register to an item dynamically allocated
756: on the stack, e.g., by `alloca'.
757:
758: The default value for this macro is `STACK_POINTER_OFFSET' plus the
759: length of the outgoing arguments. The default is correct for most
760: machines. See `function.c' for details. */
761: /* #define STACK_DYNAMIC_OFFSET(FUNDECL) ... */
762:
763: /* Value is the number of bytes of arguments automatically
764: popped when returning from a subroutine call.
765: FUNTYPE is the data type of the function (as a tree),
766: or for a library call it is an identifier node for the subroutine name.
767: SIZE is the number of bytes of arguments passed on the stack. */
768: #define RETURN_POPS_ARGS(FUNTYPE,SIZE) 0
769:
770: /* Define how to find the value returned by a function.
771: VALTYPE is the data type of the value (as a tree).
772: If the precise function being called is known, FUNC is its FUNCTION_DECL;
773: otherwise, FUNC is 0. */
774: #define FUNCTION_VALUE(VALTYPE, FUNC) \
775: gen_rtx (REG, \
776: TYPE_MODE (VALTYPE) == BLKmode ? SImode : TYPE_MODE (VALTYPE), \
777: 2)
778:
779: /* Define this if it differs from FUNCTION_VALUE. */
780: /* #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) ... */
781:
782: /* Disable the promotion of some structures and unions to registers. */
783: #define RETURN_IN_MEMORY(TYPE) \
784: ((TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE(TYPE) == UNION_TYPE) \
785: && !(TYPE_MODE (TYPE) == SImode \
786: || (TYPE_MODE (TYPE) == BLKmode \
787: && TYPE_ALIGN (TYPE) == BITS_PER_WORD \
788: && int_size_in_bytes (TYPE) == UNITS_PER_WORD)))
789:
790: /* Define how to find the value returned by a library function
791: assuming the value has mode MODE. */
792: #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 2)
793:
794: /* True if N is a possible register number for a function value
795: as seen by the caller. */
796: #define FUNCTION_VALUE_REGNO_P(N) ((N) == 2)
797:
798: /* Determine whether a function argument is passed in a register, and
799: which register. See m88k.c. */
800: #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
801: m88k_function_arg (CUM, MODE, TYPE, NAMED)
802:
803: /* Define this if it differs from FUNCTION_ARG. */
804: /* #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) ... */
805:
806: /* A C expression for the number of words, at the beginning of an
807: argument, must be put in registers. The value must be zero for
808: arguments that are passed entirely in registers or that are entirely
809: pushed on the stack. */
810: #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (0)
811:
812: /* A C expression that indicates when an argument must be passed by
813: reference. If nonzero for an argument, a copy of that argument is
814: made in memory and a pointer to the argument is passed instead of the
815: argument itself. The pointer is passed in whatever way is appropriate
816: for passing a pointer to that type. */
817: #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) (0)
818:
819: /* A C type for declaring a variable that is used as the first argument
820: of `FUNCTION_ARG' and other related values. It suffices to count
821: the number of words of argument so far. */
822: #define CUMULATIVE_ARGS int
823:
824: /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a
825: function whose data type is FNTYPE. For a library call, FNTYPE is 0. */
826: #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) ((CUM) = 0)
827:
828: /* A C statement (sans semicolon) to update the summarizer variable
829: CUM to advance past an argument in the argument list. The values
830: MODE, TYPE and NAMED describe that argument. Once this is done,
831: the variable CUM is suitable for analyzing the *following* argument
832: with `FUNCTION_ARG', etc. (TYPE is null for libcalls where that
833: information may not be available.) */
834: #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
835: do { \
836: enum machine_mode __mode = (TYPE) ? TYPE_MODE (TYPE) : (MODE); \
837: if ((CUM & 1) \
838: && (__mode == DImode || __mode == DFmode \
839: || ((TYPE) && TYPE_ALIGN (TYPE) > BITS_PER_WORD))) \
840: CUM++; \
841: CUM += (((__mode != BLKmode) \
842: ? GET_MODE_SIZE (MODE) : int_size_in_bytes (TYPE)) \
843: + 3) / 4; \
844: } while (0)
845:
846: /* True if N is a possible register number for function argument passing.
847: On the m88000, these are registers 2 through 9. */
848: #define FUNCTION_ARG_REGNO_P(N) ((N) <= 9 && (N) >= 2)
849:
850: /* A C expression which determines whether, and in which direction,
851: to pad out an argument with extra space. The value should be of
852: type `enum direction': either `upward' to pad above the argument,
853: `downward' to pad below, or `none' to inhibit padding.
854:
855: This macro does not control the *amount* of padding; that is always
856: just enough to reach the next multiple of `FUNCTION_ARG_BOUNDARY'. */
857: #define FUNCTION_ARG_PADDING(MODE, TYPE) \
858: ((MODE) == BLKmode \
859: || ((TYPE) && (TREE_CODE (TYPE) == RECORD_TYPE \
860: || TREE_CODE (TYPE) == UNION_TYPE)) \
861: ? upward : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY ? downward : none)
862:
863: /* If defined, a C expression that gives the alignment boundary, in bits,
864: of an argument with the specified mode and type. If it is not defined,
865: `PARM_BOUNDARY' is used for all arguments. */
866: #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
867: (((TYPE) ? TYPE_ALIGN (TYPE) : GET_MODE_SIZE (MODE)) <= PARM_BOUNDARY \
868: ? PARM_BOUNDARY : 2 * PARM_BOUNDARY)
869:
870: /* Generate necessary RTL for __builtin_saveregs().
871: ARGLIST is the argument list; see expr.c. */
872: #define EXPAND_BUILTIN_SAVEREGS(ARGLIST) m88k_builtin_saveregs (ARGLIST)
873:
874: /* Generate the assembly code for function entry. */
875: #define FUNCTION_PROLOGUE(FILE, SIZE) m88k_output_prologue(FILE, SIZE)
876:
877: /* Output assembler code to FILE to increment profiler label # LABELNO
878: for profiling a function entry. Redefined in m88kv3.h, m88kv4.h and
879: m88kdgux.h. */
880: #define FUNCTION_PROFILER(FILE, LABELNO) \
881: output_function_profiler (FILE, LABELNO, "mcount", 1)
882:
883: /* Output assembler code to FILE to initialize basic-block profiling for
884: the current module. LABELNO is unique to each instance. */
885: #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
886: output_function_block_profiler (FILE, LABELNO)
887:
888: /* Output assembler code to FILE to increment the count associated with
889: the basic block number BLOCKNO. */
890: #define BLOCK_PROFILER(FILE, BLOCKNO) output_block_profiler (FILE, BLOCKNO)
891:
892: /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
893: the stack pointer does not matter. The value is tested only in
894: functions that have frame pointers.
895: No definition is equivalent to always zero. */
896: #define EXIT_IGNORE_STACK (1)
897:
898: /* Generate the assembly code for function exit. */
899: #define FUNCTION_EPILOGUE(FILE, SIZE) m88k_output_epilogue(FILE, SIZE)
900:
901: /* Define the number of delay slots needed for the function epilogue.
902: These are used for scheduling the function epilogue and depend on
903: what the epilogue looks like. */
904: #define DELAY_SLOTS_FOR_EPILOGUE delay_slots_for_epilogue ()
905:
906: /* Define whether INSN can be placed in delay slot N for the epilogue. */
907: #define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN,N) \
908: eligible_for_epilogue_delay (INSN)
909:
910: /* Value should be nonzero if functions must have frame pointers.
911: Zero means the frame pointer need not be set up (and parms
912: may be accessed via the stack pointer) in functions that seem suitable.
913: This is computed in `reload', in reload1.c. */
914: #define FRAME_POINTER_REQUIRED \
915: (frame_pointer_needed \
916: || (write_symbols != NO_DEBUG && !TARGET_OCS_FRAME_POSITION))
917:
918: /* Definitions for register eliminations.
919:
920: We have two registers that can be eliminated on the m88k. First, the
921: frame pointer register can often be eliminated in favor of the stack
922: pointer register. Secondly, the argument pointer register can always be
923: eliminated; it is replaced with either the stack or frame pointer. */
924:
925: /* This is an array of structures. Each structure initializes one pair
926: of eliminable registers. The "from" register number is given first,
927: followed by "to". Eliminations of the same "from" register are listed
928: in order of preference. */
929: #define ELIMINABLE_REGS \
930: {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
931: { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
932: { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
933:
934: /* Given FROM and TO register numbers, say whether this elimination
935: is allowed. */
936: #define CAN_ELIMINATE(FROM, TO) \
937: (!((FROM) == FRAME_POINTER_REGNUM && FRAME_POINTER_REQUIRED))
938:
939: /* Define the offset between two registers, one to be eliminated, and the other
940: its replacement, at the start of a routine. */
941: #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
942: { m88k_layout_frame (); \
943: if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
944: (OFFSET) = m88k_fp_offset; \
945: else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
946: (OFFSET) = m88k_stack_size - m88k_fp_offset; \
947: else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
948: (OFFSET) = m88k_stack_size; \
949: else \
950: abort (); \
951: }
952:
953: /*** Trampolines for Nested Functions ***/
954:
955: /* Output assembler code for a block containing the constant parts
956: of a trampoline, leaving space for the variable parts.
957:
958: This block is placed on the stack and filled in. It is aligned
959: 0 mod 128 and those portions that are executed are constant.
960: This should work for instruction caches that have cache lines up
961: to the aligned amount (128 is arbitrary), provided no other code
962: producer is attempting to play the same game. This of course is
963: in violation of any number of 88open standards. */
964:
965: #define TRAMPOLINE_TEMPLATE(FILE) \
966: { \
967: /* Save the return address (r1) in the static chain reg (r11). */ \
968: fprintf (FILE, "\tor\t %s,%s,0\n", reg_names[11], reg_names[1]); \
969: /* Locate this block; transfer to the next instruction. */ \
970: fprintf (FILE, "\tbsr\t 1\n"); \
971: /* Save r10; use it as the relative pointer; restore r1. */ \
972: fprintf (FILE, "\tst\t %s,%s,24\n", reg_names[10], reg_names[1]); \
973: fprintf (FILE, "\tor\t %s,%s,0\n", reg_names[10], reg_names[1]); \
974: fprintf (FILE, "\tor\t %s,%s,0\n", reg_names[1], reg_names[11]); \
975: /* Load the function's address and go there. */ \
976: fprintf (FILE, "\tld\t %s,%s,32\n", reg_names[11], reg_names[10]); \
977: fprintf (FILE, "\tjmp.n\t %s\n", reg_names[11]); \
978: /* Restore r10 and load the static chain register. */ \
979: fprintf (FILE, "\tld.d\t %s,%s,24\n", reg_names[10], reg_names[10]); \
980: /* Storage: r10 save area, static chain, function address. */ \
981: ASM_OUTPUT_INT (FILE, const0_rtx); \
982: ASM_OUTPUT_INT (FILE, const0_rtx); \
983: ASM_OUTPUT_INT (FILE, const0_rtx); \
984: }
985:
986: /* Length in units of the trampoline for entering a nested function.
987: This is really two components. The first 32 bytes are fixed and
988: must be copied; the last 12 bytes are just storage that's filled
989: in later. So for allocation purposes, it's 32+12 bytes, but for
990: initializaiton purposes, it's 32 bytes. */
991:
992: #define TRAMPOLINE_SIZE (32+12)
993:
994: /* Alignment required for a trampoline. 128 is used to find the
995: beginning of a line in the instruction cache and to allow for
996: instruction cache lines of up to 128 bytes. */
997:
998: #define TRAMPOLINE_ALIGNMENT 128
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, 40)), FNADDR); \
1007: emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 36)), CXT); \
1008: }
1009:
1010: /*** Library Subroutine Names ***/
1011:
1012: /* Define this macro if GNU CC should generate calls to the System V
1013: (and ANSI C) library functions `memcpy' and `memset' rather than
1014: the BSD functions `bcopy' and `bzero'. */
1015: #define TARGET_MEM_FUNCTIONS
1016:
1017: /*** Addressing Modes ***/
1018:
1019: /* #define HAVE_POST_INCREMENT */
1020: /* #define HAVE_POST_DECREMENT */
1021:
1022: /* #define HAVE_PRE_DECREMENT */
1023: /* #define HAVE_PRE_INCREMENT */
1024:
1025: /* Recognize any constant value that is a valid address. */
1026: #define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X))
1027:
1028: /* Maximum number of registers that can appear in a valid memory address. */
1029: #define MAX_REGS_PER_ADDRESS 2
1030:
1031: /* The condition for memory shift insns. */
1032: #define SCALED_ADDRESS_P(ADDR) \
1033: (GET_CODE (ADDR) == PLUS \
1034: && (GET_CODE (XEXP (ADDR, 0)) == MULT \
1035: || GET_CODE (XEXP (ADDR, 1)) == MULT))
1036:
1037: /* Can the reference to X be made short? */
1038: #define SHORT_ADDRESS_P(X,TEMP) \
1039: ((TEMP) = (GET_CODE (X) == CONST ? get_related_value (X) : X), \
1040: ((TEMP) && GET_CODE (TEMP) == SYMBOL_REF && SYMBOL_REF_FLAG (TEMP)))
1041:
1042: /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
1043: that is a valid memory address for an instruction.
1044: The MODE argument is the machine mode for the MEM expression
1045: that wants to use this address.
1046:
1047: On the m88000, a legitimate address has the form REG, REG+REG,
1048: REG+SMALLINT, REG+(REG*modesize) (REG[REG]), or SMALLINT.
1049:
1050: The register elimination process should deal with the argument
1051: pointer and frame pointer changing to REG+SMALLINT. */
1052:
1053: #define LEGITIMATE_INDEX_P(X, MODE) \
1054: ((GET_CODE (X) == CONST_INT \
1055: && SMALL_INT (X)) \
1056: || (REG_P (X) \
1057: && REG_OK_FOR_INDEX_P (X)) \
1058: || (GET_CODE (X) == MULT \
1059: && REG_P (XEXP (X, 0)) \
1060: && REG_OK_FOR_INDEX_P (XEXP (X, 0)) \
1061: && GET_CODE (XEXP (X, 1)) == CONST_INT \
1062: && INTVAL (XEXP (X, 1)) == GET_MODE_SIZE (MODE)))
1063:
1064: #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
1065: { \
1066: register rtx _x; \
1067: if (REG_P (X)) \
1068: { \
1069: if (REG_OK_FOR_BASE_P (X)) \
1070: goto ADDR; \
1071: } \
1072: else if (GET_CODE (X) == PLUS) \
1073: { \
1074: register rtx _x0 = XEXP (X, 0); \
1075: register rtx _x1 = XEXP (X, 1); \
1076: if ((flag_pic \
1077: && _x0 == pic_offset_table_rtx \
1078: && (flag_pic == 2 \
1079: ? REG_P (_x1) \
1080: : (GET_CODE (_x1) == SYMBOL_REF \
1081: || GET_CODE (_x1) == LABEL_REF))) \
1082: || (REG_P (_x0) \
1083: && (REG_OK_FOR_BASE_P (_x0) \
1084: && LEGITIMATE_INDEX_P (_x1, MODE))) \
1085: || (REG_P (_x1) \
1086: && (REG_OK_FOR_BASE_P (_x1) \
1087: && LEGITIMATE_INDEX_P (_x0, MODE)))) \
1088: goto ADDR; \
1089: } \
1090: else if (GET_CODE (X) == LO_SUM) \
1091: { \
1092: register rtx _x0 = XEXP (X, 0); \
1093: register rtx _x1 = XEXP (X, 1); \
1094: if (((REG_P (_x0) \
1095: && REG_OK_FOR_BASE_P (_x0)) \
1096: || (GET_CODE (_x0) == SUBREG \
1097: && REG_P (SUBREG_REG (_x0)) \
1098: && REG_OK_FOR_BASE_P (SUBREG_REG (_x0)))) \
1099: && CONSTANT_P (_x1)) \
1100: goto ADDR; \
1101: } \
1102: else if (GET_CODE (X) == CONST_INT \
1103: && SMALL_INT (X)) \
1104: goto ADDR; \
1105: else if (SHORT_ADDRESS_P (X, _x)) \
1106: goto ADDR; \
1107: }
1108:
1109: /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
1110: and check its validity for a certain class.
1111: We have two alternate definitions for each of them.
1112: The usual definition accepts all pseudo regs; the other rejects
1113: them unless they have been allocated suitable hard regs.
1114: The symbol REG_OK_STRICT causes the latter definition to be used.
1115:
1116: Most source files want to accept pseudo regs in the hope that
1117: they will get allocated to the class that the insn wants them to be in.
1118: Source files for reload pass need to be strict.
1119: After reload, it makes no difference, since pseudo regs have
1120: been eliminated by then. */
1121:
1122: #ifndef REG_OK_STRICT
1123:
1124: /* Nonzero if X is a hard reg that can be used as an index
1125: or if it is a pseudo reg. Not the argument pointer. */
1126: #define REG_OK_FOR_INDEX_P(X) (X)
1127: /* Nonzero if X is a hard reg that can be used as a base reg
1128: or if it is a pseudo reg. */
1129: #define REG_OK_FOR_BASE_P(X) (1)
1130:
1131: #else
1132:
1133: /* Nonzero if X is a hard reg that can be used as an index. */
1134: #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
1135: /* Nonzero if X is a hard reg that can be used as a base reg. */
1136: #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1137:
1138: #endif
1139:
1140: /* Try machine-dependent ways of modifying an illegitimate address
1141: to be legitimate. If we find one, return the new, valid address.
1142: This macro is used in only one place: `memory_address' in explow.c.
1143:
1144: OLDX is the address as it was before break_out_memory_refs was called.
1145: In some cases it is useful to look at this to decide what needs to be done.
1146:
1147: MODE and WIN are passed so that this macro can use
1148: GO_IF_LEGITIMATE_ADDRESS.
1149:
1150: It is always safe for this macro to do nothing. It exists to recognize
1151: opportunities to optimize the output. */
1152:
1153: /* On the m88000, change REG+N into REG+REG, and REG+(X*Y) into REG+REG. */
1154:
1155: #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
1156: { \
1157: if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
1158: (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \
1159: copy_to_mode_reg (SImode, XEXP (X, 1))); \
1160: if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \
1161: (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \
1162: copy_to_mode_reg (SImode, XEXP (X, 0))); \
1163: if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \
1164: (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \
1165: force_operand (XEXP (X, 0), 0)); \
1166: if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \
1167: (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \
1168: force_operand (XEXP (X, 1), 0)); \
1169: if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \
1170: || GET_CODE (X) == LABEL_REF) \
1171: (X) = legitimize_address (flag_pic, X, gen_reg_rtx (Pmode)); \
1172: if (memory_address_p (MODE, X)) \
1173: goto WIN; }
1174:
1175: /* Go to LABEL if ADDR (a legitimate address expression)
1176: has an effect that depends on the machine mode it is used for.
1177: On the the m88000 this is never true. */
1178:
1179: #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
1180:
1181: /* Nonzero if the constant value X is a legitimate general operand.
1182: It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
1183: #define LEGITIMATE_CONSTANT_P(X) (1)
1184:
1185: /*** Condition Code Information ***/
1186:
1187: /* C code for a data type which is used for declaring the `mdep'
1188: component of `cc_status'. It defaults to `int'. */
1189: /* #define CC_STATUS_MDEP int */
1190:
1191: /* A C expression to initialize the `mdep' field to "empty". */
1192: /* #define CC_STATUS_MDEP_INIT (cc_status.mdep = 0) */
1193:
1194: /* Macro to zap the normal portions of CC_STATUS, but leave the
1195: machine dependent parts (ie, literal synthesis) alone. */
1196: /* #define CC_STATUS_INIT_NO_MDEP \
1197: (cc_status.flags = 0, cc_status.value1 = 0, cc_status.value2 = 0) */
1198:
1199: /* When using a register to hold the condition codes, the cc_status
1200: mechanism cannot be used. */
1201: #define NOTICE_UPDATE_CC(EXP, INSN) (0)
1202:
1203: /*** Miscellaneous Parameters ***/
1204:
1205: /* Define the codes that are matched by predicates in m88k.c. */
1206: #define PREDICATE_CODES \
1207: {"move_operand", {SUBREG, REG, CONST_INT, LO_SUM, MEM}}, \
1208: {"call_address_operand", {SUBREG, REG, SYMBOL_REF, LABEL_REF, CONST}}, \
1209: {"arith_operand", {SUBREG, REG, CONST_INT}}, \
1210: {"arith5_operand", {SUBREG, REG, CONST_INT}}, \
1211: {"arith32_operand", {SUBREG, REG, CONST_INT}}, \
1212: {"arith64_operand", {SUBREG, REG, CONST_INT}}, \
1213: {"int5_operand", {CONST_INT}}, \
1214: {"int32_operand", {CONST_INT}}, \
1215: {"add_operand", {SUBREG, REG, CONST_INT}}, \
1216: {"reg_or_bbx_mask_operand", {SUBREG, REG, CONST_INT}}, \
1217: {"real_or_0_operand", {SUBREG, REG, CONST_DOUBLE}}, \
1218: {"relop", {EQ, NE, LT, LE, GE, GT, LTU, LEU, GEU, GTU}}, \
1219: {"relop_no_unsigned", {EQ, NE, LT, LE, GE, GT}}, \
1220: {"equality_op", {EQ, NE}}, \
1221: {"pc_or_label_ref", {PC, LABEL_REF}},
1222:
1223: /* An alias for a machine mode name. This is the machine mode that
1224: elements of a jump-table should have. */
1225: #define CASE_VECTOR_MODE SImode
1226:
1227: /* Define this macro if jump-tables should contain relative addresses. */
1228: #define CASE_VECTOR_PC_RELATIVE
1229:
1230: /* Define this if control falls through a `case' insn when the index
1231: value is out of range. This means the specified default-label is
1232: actually ignored by the `case' insn proper. */
1233: /* #define CASE_DROPS_THROUGH */
1234:
1235: /* Specify the tree operation to be used to convert reals to integers. */
1236: #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1237:
1238: /* This is the kind of divide that is easiest to do in the general case. */
1239: #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1240:
1241: /* Define this as 1 if `char' should by default be signed; else as 0. */
1242: #define DEFAULT_SIGNED_CHAR 1
1243:
1244: /* The 88open ABI says size_t is unsigned int. */
1245: #define SIZE_TYPE "unsigned int"
1246:
1247: /* Allow and ignore #sccs directives */
1248: #define SCCS_DIRECTIVE
1249:
1250: /* Code to handle #pragma directives. The interface is a bit messy,
1251: but there's no simpler way to do this while still using yylex. */
1252: #define HANDLE_PRAGMA(FILE) \
1253: do { \
1254: while (c == ' ' || c == '\t') \
1255: c = getc (FILE); \
1256: if (c == '\n' || c == EOF) \
1257: { \
1258: m88k_handle_pragma_token (0, 0); \
1259: return c; \
1260: } \
1261: ungetc (c, FILE); \
1262: switch (yylex ()) \
1263: { \
1264: case IDENTIFIER: \
1265: case TYPENAME: \
1266: case STRING: \
1267: case CONSTANT: \
1268: m88k_handle_pragma_token (token_buffer, yylval.ttype); \
1269: break; \
1270: default: \
1271: m88k_handle_pragma_token (token_buffer, 0); \
1272: } \
1273: if (nextchar >= 0) \
1274: c = nextchar, nextchar = -1; \
1275: else \
1276: c = getc (FILE); \
1277: } while (1)
1278:
1279: /* Tell when to handle #pragma weak. This is only done for V.4. */
1280: #define HANDLE_PRAGMA_WEAK TARGET_SVR4
1281:
1282: /* Max number of bytes we can move from memory to memory
1283: in one reasonably fast instruction. */
1284: #define MOVE_MAX 64
1285:
1286: /* Define if normal loads of shorter-than-word items from memory clears
1287: the rest of the bigs in the register. */
1288: #define BYTE_LOADS_ZERO_EXTEND
1289:
1290: /* Zero if access to memory by bytes is faster. */
1291: #define SLOW_BYTE_ACCESS 1
1292:
1293: /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1294: is done just by pretending it is already truncated. */
1295: #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1296:
1297: /* Define this if addresses of constant functions
1298: shouldn't be put through pseudo regs where they can be cse'd.
1299: Desirable on machines where ordinary constants are expensive
1300: but a CALL with constant address is cheap. */
1301: #define NO_FUNCTION_CSE
1302:
1303: /* Define this macro if an argument declared as `char' or
1304: `short' in a prototype should actually be passed as an
1305: `int'. In addition to avoiding errors in certain cases of
1306: mismatch, it also makes for better code on certain machines. */
1307: #define PROMOTE_PROTOTYPES
1308:
1309: /* Define this macro if a float function always returns float
1310: (even in traditional mode). Redefined in m88kluna.h. */
1311: #define TRADITIONAL_RETURN_FLOAT
1312:
1313: /* We assume that the store-condition-codes instructions store 0 for false
1314: and some other value for true. This is the value stored for true. */
1315: #define STORE_FLAG_VALUE -1
1316:
1317: /* Specify the machine mode that pointers have.
1318: After generation of rtl, the compiler makes no further distinction
1319: between pointers and any other objects of this machine mode. */
1320: #define Pmode SImode
1321:
1322: /* A function address in a call instruction
1323: is a word address (for indexing purposes)
1324: so give the MEM rtx word mode. */
1325: #define FUNCTION_MODE SImode
1326:
1327: /* Compute the cost of computing a constant rtl expression RTX
1328: whose rtx-code is CODE. The body of this macro is a portion
1329: of a switch statement. If the code is computed here,
1330: return it with a return statement. Otherwise, break from the switch.
1331:
1332: We assume that any 16 bit integer can easily be recreated, so we
1333: indicate 0 cost, in an attempt to get GCC not to optimize things
1334: like comparison against a constant.
1335:
1336: The cost of CONST_DOUBLE is zero (if it can be placed in an insn, it
1337: is as good as a register; since it can't be placed in any insn, it
1338: won't do anything in cse, but it will cause expand_binop to pass the
1339: constant to the define_expands). */
1340: #define CONST_COSTS(RTX,CODE) \
1341: case CONST_INT: \
1342: if (SMALL_INT (RTX)) \
1343: return 0; \
1344: else if (SMALL_INTVAL (- INTVAL (RTX))) \
1345: return 2; \
1346: else if (classify_integer (SImode, INTVAL (RTX)) != m88k_oru_or) \
1347: return 4; \
1348: return 7; \
1349: case HIGH: \
1350: return 2; \
1351: case CONST: \
1352: case LABEL_REF: \
1353: case SYMBOL_REF: \
1354: if (flag_pic) \
1355: return (flag_pic == 2) ? 11 : 8; \
1356: return 5; \
1357: case CONST_DOUBLE: \
1358: return 0;
1359:
1360: /* Provide the costs of an addressing mode that contains ADDR.
1361: If ADDR is not a valid address, it's cost is irrelavent.
1362: REG+REG is made slightly more expensive because it might keep
1363: a register live for longer than we might like. */
1364: #define ADDRESS_COST(ADDR) \
1365: (GET_CODE (ADDR) == REG ? 1 : \
1366: GET_CODE (ADDR) == LO_SUM ? 1 : \
1367: GET_CODE (ADDR) == HIGH ? 2 : \
1368: GET_CODE (ADDR) == MULT ? 1 : \
1369: GET_CODE (ADDR) != PLUS ? 4 : \
1370: (REG_P (XEXP (ADDR, 0)) && REG_P (XEXP (ADDR, 1))) ? 2 : 1)
1371:
1372: /* Provide the costs of a rtl expression. This is in the body of a
1373: switch on CODE. */
1374: #define RTX_COSTS(X,CODE) \
1375: case MEM: \
1376: return COSTS_N_INSNS (2); \
1377: case MULT: \
1378: return COSTS_N_INSNS (3); \
1379: case DIV: \
1380: case UDIV: \
1381: case MOD: \
1382: case UMOD: \
1383: return COSTS_N_INSNS (38);
1384:
1385: /* A C expressions returning the cost of moving data of MODE from a register
1386: to or from memory. This is more costly than between registers. */
1387: #define MEMORY_MOVE_COST(MODE) 4
1388:
1389: /* Provide the cost of a branch. Exact meaning under development. */
1390: #define BRANCH_COST (TARGET_88100 ? 1 : 2)
1391:
1392: /* Define this to be nonzero if the character `$' should be allowed
1393: by default in identifier names. */
1394: #define DOLLARS_IN_IDENTIFIERS 1
1395:
1396: /* Do not break .stabs pseudos into continuations. */
1397: #define DBX_CONTIN_LENGTH 0
1398:
1399: /*** Output of Assembler Code ***/
1400:
1401: /* Control the assembler format that we output. */
1402:
1403: /* Which assembler syntax. Redefined in m88kdgux.h. */
1404: #define VERSION_0300_SYNTAX TARGET_SVR4
1405:
1406: /* Allow pseudo-ops to be overridden. Override these in svr[34].h. */
1407: #undef INT_ASM_OP
1408: #undef ASCII_DATA_ASM_OP
1409: #undef INIT_SECTION_ASM_OP
1410: #undef CONST_SECTION_ASM_OP
1411: #undef CTORS_SECTION_ASM_OP
1412: #undef DTORS_SECTION_ASM_OP
1413: #undef INIT_SECTION_ASM_OP
1414: #undef FINI_SECTION_ASM_OP
1415: #undef TYPE_ASM_OP
1416: #undef SIZE_ASM_OP
1417:
1418: /* These are used in varasm.c as well. */
1419: #define TEXT_SECTION_ASM_OP "\ttext"
1420: #define DATA_SECTION_ASM_OP "\tdata"
1421:
1422: /* Other sections. */
1423: #define CONST_SECTION_ASM_OP (VERSION_0300_SYNTAX \
1424: ? "\tsection\t .rodata,\"a\"\n" \
1425: : "\tsection\t .rodata,\"x\"\n")
1426: #define TDESC_SECTION_ASM_OP (VERSION_0300_SYNTAX \
1427: ? "\tsection\t .tdesc,\"a\"" \
1428: : "\tsection\t .tdesc,\"x\"")
1429:
1430: /* These must be constant strings for crtstuff.c. */
1431: #define CTORS_SECTION_ASM_OP "\tsection\t .ctors,\"d\"\n"
1432: #define DTORS_SECTION_ASM_OP "\tsection\t .dtors,\"d\"\n"
1433: #define INIT_SECTION_ASM_OP "\tsection\t .init,\"x\""
1434: #define FINI_SECTION_ASM_OP "\tsection\t .fini,\"x\""
1435:
1436: /* These are pretty much common to all assemblers. */
1437: #define IDENT_ASM_OP "\tident"
1438: #define FILE_ASM_OP "\tfile"
1439: #define SECTION_ASM_OP "\tsection"
1440: #define DEF_ASM_OP "\tdef"
1441: #define GLOBAL_ASM_OP "\tglobal"
1442: #define ALIGN_ASM_OP "\talign"
1443: #define SKIP_ASM_OP "\tzero"
1444: #define COMMON_ASM_OP "\tcomm"
1445: #define LOCAL_ASM_OP "\tbss"
1446: #define FLOAT_ASM_OP "\tfloat"
1447: #define DOUBLE_ASM_OP "\tdouble"
1448: #define INT_ASM_OP "\tword"
1449: #define ASM_LONG INT_ASM_OP
1450: #define SHORT_ASM_OP "\thalf"
1451: #define CHAR_ASM_OP "\tbyte"
1452: #define ASCII_DATA_ASM_OP "\tstring"
1453:
1454: /* These are particular to the global pool optimization. */
1455: #define SBSS_ASM_OP "\tsbss"
1456: #define SCOMM_ASM_OP "\tscomm"
1457: #define SDATA_SECTION_ASM_OP "\tsdata"
1458:
1459: /* These are specific to PIC. */
1460: #define TYPE_ASM_OP "\ttype"
1461: #define SIZE_ASM_OP "\tsize"
1462: #define WEAK_ASM_OP "\tweak"
1463: #ifndef AS_BUG_POUND_TYPE /* Faulty assemblers require @ rather than #. */
1464: #undef TYPE_OPERAND_FMT
1465: #define TYPE_OPERAND_FMT "#%s"
1466: #endif
1467:
1468: /* These are specific to version 03.00 assembler syntax. */
1469: #define INTERNAL_ASM_OP "\tlocal"
1470: #define VERSION_ASM_OP "\tversion"
1471: #define ASM_DWARF_POP_SECTION(FILE) fputs ("\tprevious\n", FILE)
1472: #define UNALIGNED_SHORT_ASM_OP "\tuahalf"
1473: #define UNALIGNED_INT_ASM_OP "\tuaword"
1474:
1475: /* Output any initial stuff to the assembly file. Always put out
1476: a file directive, even if not debugging.
1477:
1478: Immediately after putting out the file, put out a "sem.<value>"
1479: declaration. This should be harmless on other systems, and
1480: is used in DG/UX by the debuggers to suppliment COFF. The
1481: fields in the integer value are as follows:
1482:
1483: Bits Value Meaning
1484: ---- ----- -------
1485: 0-1 0 No information about stack locations
1486: 1 Auto/param locations are based on r30
1487: 2 Auto/param locations are based on CFA
1488:
1489: 3-2 0 No information on dimension order
1490: 1 Array dims in sym table matches source language
1491: 2 Array dims in sym table is in reverse order
1492:
1493: 5-4 0 No information about the case of global names
1494: 1 Global names appear in the symbol table as in the source
1495: 2 Global names have been converted to lower case
1496: 3 Global names have been converted to upper case. */
1497:
1498: #ifdef SDB_DEBUGGING_INFO
1499: #define ASM_COFFSEM(FILE) \
1500: if (write_symbols == SDB_DEBUG) \
1501: { \
1502: fprintf (FILE, "\nsem.%x:\t\t; %s\n", \
1503: (((TARGET_OCS_FRAME_POSITION) ? 2 : 1) << 0) + (1 << 2) + (1 << 4),\
1504: (TARGET_OCS_FRAME_POSITION) \
1505: ? "frame is CFA, normal array dims, case unchanged" \
1506: : "frame is r30, normal array dims, case unchanged"); \
1507: }
1508: #else
1509: #define ASM_COFFSEM(FILE)
1510: #endif
1511:
1512: /* Output the first line of the assembly file. Redefined in m88kdgux.h. */
1513:
1514: #define ASM_FIRST_LINE(FILE) \
1515: do { \
1516: if (VERSION_0300_SYNTAX) \
1517: fprintf (FILE, "%s\t \"03.00\"\n", VERSION_ASM_OP); \
1518: } while (0)
1519:
1520: /* Override svr[34].h. */
1521: #undef ASM_FILE_START
1522: #define ASM_FILE_START(FILE) \
1523: output_file_start (FILE, f_options, sizeof f_options / sizeof f_options[0], \
1524: W_options, sizeof W_options / sizeof W_options[0])
1525:
1526: #undef ASM_FILE_END
1527:
1528: #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) \
1529: fprintf (FILE, "%s\t \"%s\"\n", FILE_ASM_OP, NAME)
1530:
1531: #ifdef SDB_DEBUGGING_INFO
1532: #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
1533: if (m88k_prologue_done) \
1534: fprintf (FILE, "\n\tln\t %d\t\t\t\t; Real source line %d\n",\
1535: LINE - sdb_begin_function_line, LINE)
1536: #endif
1537:
1538: /* Code to handle #ident directives. Override svr[34].h definition. */
1539: #undef ASM_OUTPUT_IDENT
1540: #ifdef DBX_DEBUGGING_INFO
1541: #define ASM_OUTPUT_IDENT(FILE, NAME)
1542: #else
1543: #define ASM_OUTPUT_IDENT(FILE, NAME) \
1544: fprintf(FILE, "%s\t \"%s\"\n", IDENT_ASM_OP, NAME)
1545: #endif
1546:
1547: /* Output to assembler file text saying following lines
1548: may contain character constants, extra white space, comments, etc. */
1549: #define ASM_APP_ON ""
1550:
1551: /* Output to assembler file text saying following lines
1552: no longer contain unusual constructs. */
1553: #define ASM_APP_OFF ""
1554:
1555: /* Format the assembly opcode so that the arguments are all aligned.
1556: The maximum instruction size is 8 characters (fxxx.xxx), so a tab and a
1557: space will do to align the output. Abandon the output if a `%' is
1558: encountered. */
1559: #define ASM_OUTPUT_OPCODE(STREAM, PTR) \
1560: { \
1561: int ch; \
1562: char *orig_ptr; \
1563: \
1564: for (orig_ptr = (PTR); \
1565: (ch = *(PTR)) && ch != ' ' && ch != '\t' && ch != '\n' && ch != '%'; \
1566: (PTR)++) \
1567: putc (ch, STREAM); \
1568: \
1569: if (ch == ' ' && orig_ptr != (PTR) && (PTR) - orig_ptr < 8) \
1570: putc ('\t', STREAM); \
1571: }
1572:
1573: /* How to refer to registers in assembler output.
1574: This sequence is indexed by compiler's hard-register-number.
1575: Updated by OVERRIDE_OPTIONS to include the # for version 03.00 syntax. */
1576:
1577: #define REGISTER_NAMES \
1578: {"#r0"+1, "#r1"+1, "#r2"+1, "#r3"+1, "#r4"+1, "#r5"+1, "#r6"+1, "#r7"+1, \
1579: "#r8"+1, "#r9"+1, "#r10"+1,"#r11"+1,"#r12"+1,"#r13"+1,"#r14"+1,"#r15"+1,\
1580: "#r16"+1,"#r17"+1,"#r18"+1,"#r19"+1,"#r20"+1,"#r21"+1,"#r22"+1,"#r23"+1,\
1581: "#r24"+1,"#r25"+1,"#r26"+1,"#r27"+1,"#r28"+1,"#r29"+1,"#r30"+1,"#r31"+1}
1582:
1583: /* How to renumber registers for dbx and gdb. */
1584: #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1585:
1586: /* Tell when to declare ASM names. Override svr4.h to provide this hook. */
1587: #undef DECLARE_ASM_NAME
1588: #define DECLARE_ASM_NAME TARGET_SVR4
1589:
1590: /* Write the extra assembler code needed to declare a function properly. */
1591: #undef ASM_DECLARE_FUNCTION_NAME
1592: #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
1593: do { \
1594: if (DECLARE_ASM_NAME) \
1595: { \
1596: fprintf (FILE, "%s\t ", TYPE_ASM_OP); \
1597: assemble_name (FILE, NAME); \
1598: putc (',', FILE); \
1599: fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
1600: putc ('\n', FILE); \
1601: } \
1602: ASM_OUTPUT_LABEL(FILE, NAME); \
1603: } while (0)
1604:
1605: /* Write the extra assembler code needed to declare an object properly. */
1606: #undef ASM_DECLARE_OBJECT_NAME
1607: #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
1608: do { \
1609: if (DECLARE_ASM_NAME) \
1610: { \
1611: fprintf (FILE, "%s\t ", TYPE_ASM_OP); \
1612: assemble_name (FILE, NAME); \
1613: putc (',', FILE); \
1614: fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
1615: putc ('\n', FILE); \
1616: if (!flag_inhibit_size_directive) \
1617: { \
1618: fprintf (FILE, "%s\t ", SIZE_ASM_OP); \
1619: assemble_name (FILE, NAME); \
1620: fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (decl))); \
1621: } \
1622: } \
1623: ASM_OUTPUT_LABEL(FILE, NAME); \
1624: } while (0)
1625:
1626: /* This is how to declare the size of a function. */
1627: #undef ASM_DECLARE_FUNCTION_SIZE
1628: #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
1629: do { \
1630: if (DECLARE_ASM_NAME) \
1631: { \
1632: if (!flag_inhibit_size_directive) \
1633: { \
1634: char label[256]; \
1635: static int labelno; \
1636: labelno++; \
1637: ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
1638: ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
1639: fprintf (FILE, "%s\t ", SIZE_ASM_OP); \
1640: assemble_name (FILE, (FNAME)); \
1641: fprintf (FILE, ",%s-", &label[1]); \
1642: assemble_name (FILE, (FNAME)); \
1643: putc ('\n', FILE); \
1644: } \
1645: } \
1646: } while (0)
1647:
1648: /* This is how to output the definition of a user-level label named NAME,
1649: such as the label on a static function or variable NAME. */
1650: #define ASM_OUTPUT_LABEL(FILE,NAME) \
1651: do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
1652:
1653: /* This is how to output a command to make the user-level label named NAME
1654: defined for reference from other files. */
1655: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
1656: do { \
1657: fprintf (FILE, "%s\t ", GLOBAL_ASM_OP); \
1658: assemble_name (FILE, NAME); \
1659: putc ('\n', FILE); \
1660: } while (0)
1661:
1662: /* This is how to output a reference to a user-level label named NAME.
1663: Override svr[34].h. */
1664: #undef ASM_OUTPUT_LABELREF
1665: #define ASM_OUTPUT_LABELREF(FILE,NAME) \
1666: { \
1667: if (! TARGET_NO_UNDERSCORES && ! VERSION_0300_SYNTAX) \
1668: fputc ('_', FILE); \
1669: fputs (NAME, FILE); \
1670: }
1671:
1672: /* This is how to output an internal numbered label where
1673: PREFIX is the class of label and NUM is the number within the class.
1674: For V.4, labels use `.' rather than `@'. */
1675:
1676: #ifdef AS_BUG_DOT_LABELS /* The assembler requires a declaration of local. */
1677: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1678: fprintf (FILE, VERSION_0300_SYNTAX ? ".%s%d:\n%s\t .%s%d\n" : "@%s%d:\n", \
1679: PREFIX, NUM, INTERNAL_ASM_OP, PREFIX, NUM)
1680: #else
1681: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1682: fprintf (FILE, VERSION_0300_SYNTAX ? ".%s%d:\n" : "@%s%d:\n", PREFIX, NUM)
1683: #endif /* AS_BUG_DOT_LABELS */
1684:
1685: /* This is how to store into the string LABEL
1686: the symbol_ref name of an internal numbered label where
1687: PREFIX is the class of label and NUM is the number within the class.
1688: This is suitable for output with `assemble_name'. This must agree
1689: with ASM_OUTPUT_INTERNAL_LABEL above, except for being prefixed
1690: with an `*'. */
1691:
1692: #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
1693: sprintf (LABEL, VERSION_0300_SYNTAX ? "*.%s%d" : "*@%s%d", PREFIX, NUM)
1694:
1695: /* Internal macro to get a single precision floating point value into
1696: an int, so we can print it's value in hex. */
1697: #define FLOAT_TO_INT_INTERNAL( FVALUE, IVALUE ) \
1698: { union { \
1699: REAL_VALUE_TYPE d; \
1700: struct { \
1701: unsigned sign : 1; \
1702: unsigned exponent1 : 1; \
1703: unsigned exponent2 : 3; \
1704: unsigned exponent3 : 7; \
1705: unsigned mantissa1 : 20; \
1706: unsigned mantissa2 : 3; \
1707: unsigned mantissa3 : 29; \
1708: } s; \
1709: } _u; \
1710: \
1711: union { \
1712: int i; \
1713: struct { \
1714: unsigned sign : 1; \
1715: unsigned exponent1 : 1; \
1716: unsigned exponent3 : 7; \
1717: unsigned mantissa1 : 20; \
1718: unsigned mantissa2 : 3; \
1719: } s; \
1720: } _u2; \
1721: \
1722: _u.d = REAL_VALUE_TRUNCATE (SFmode, FVALUE); \
1723: _u2.s.sign = _u.s.sign; \
1724: _u2.s.exponent1 = _u.s.exponent1; \
1725: _u2.s.exponent3 = _u.s.exponent3; \
1726: _u2.s.mantissa1 = _u.s.mantissa1; \
1727: _u2.s.mantissa2 = _u.s.mantissa2; \
1728: IVALUE = _u2.i; \
1729: }
1730:
1731: /* This is how to output an assembler line defining a `double' constant.
1732: Use "word" pseudos to avoid printing NaNs, infinity, etc. */
1733: #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
1734: do { \
1735: union { REAL_VALUE_TYPE d; long l[2]; } x; \
1736: x.d = (VALUE); \
1737: fprintf (FILE, "%s\t 0x%.8x, 0x%.8x\n", INT_ASM_OP, \
1738: x.l[0], x.l[1]); \
1739: } while (0)
1740:
1741: /* This is how to output an assembler line defining a `float' constant. */
1742: #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
1743: do { \
1744: int i; \
1745: FLOAT_TO_INT_INTERNAL (VALUE, i); \
1746: fprintf (FILE, "%s\t 0x%.8x\n", INT_ASM_OP, i); \
1747: } while (0)
1748:
1749: /* Likewise for `int', `short', and `char' constants. */
1750: #define ASM_OUTPUT_INT(FILE,VALUE) \
1751: ( fprintf (FILE, "%s\t ", INT_ASM_OP), \
1752: output_addr_const (FILE, (VALUE)), \
1753: fprintf (FILE, "\n"))
1754:
1755: #define ASM_OUTPUT_SHORT(FILE,VALUE) \
1756: ( fprintf (FILE, "%s\t ", SHORT_ASM_OP), \
1757: output_addr_const (FILE, (VALUE)), \
1758: fprintf (FILE, "\n"))
1759:
1760: #define ASM_OUTPUT_CHAR(FILE,VALUE) \
1761: ( fprintf (FILE, "%s\t ", CHAR_ASM_OP), \
1762: output_addr_const (FILE, (VALUE)), \
1763: fprintf (FILE, "\n"))
1764:
1765: /* This is how to output an assembler line for a numeric constant byte. */
1766: #define ASM_OUTPUT_BYTE(FILE,VALUE) \
1767: fprintf (FILE, "%s\t 0x%x\n", CHAR_ASM_OP, (VALUE))
1768:
1769: /* The singl-byte pseudo-op is the default. Override svr[34].h. */
1770: #undef ASM_BYTE_OP
1771: #define ASM_BYTE_OP "\tbyte"
1772: #undef ASM_OUTPUT_ASCII
1773: #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
1774: output_ascii ((FILE), (P), (SIZE))
1775:
1776: /* Epilogue for case labels. This jump instruction is called by casesi
1777: to transfer to the appropriate branch instruction within the table.
1778: The label `@L<n>e' is coined to mark the end of the table. */
1779: #define ASM_OUTPUT_CASE_END(FILE, NUM, TABLE) \
1780: do { \
1781: char label[256]; \
1782: ASM_GENERATE_INTERNAL_LABEL (label, "L", NUM); \
1783: fprintf (FILE, "%se:\n", &label[1]); \
1784: if (! flag_delayed_branch) \
1785: fprintf (FILE, "\tlda\t %s,%s[%s]\n", reg_names[1], reg_names[1], \
1786: reg_names[m88k_case_index]); \
1787: fprintf (FILE, "\tjmp\t %s\n", reg_names[1]); \
1788: } while (0)
1789:
1790: /* This is how to output an element of a case-vector that is absolute. */
1791: #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1792: do { \
1793: char buffer[256]; \
1794: ASM_GENERATE_INTERNAL_LABEL (buffer, "L", VALUE); \
1795: fprintf (FILE, "\tbr\t %s\n", &buffer[1]); \
1796: } while (0)
1797:
1798: /* This is how to output an element of a case-vector that is relative. */
1799: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
1800: ASM_OUTPUT_ADDR_VEC_ELT (FILE, VALUE)
1801:
1802: /* This is how to output an assembler line
1803: that says to advance the location counter
1804: to a multiple of 2**LOG bytes. */
1805: #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1806: if ((LOG) != 0) \
1807: fprintf (FILE, "%s\t %d\n", ALIGN_ASM_OP, 1<<(LOG))
1808:
1809: /* Align the text address to half a cache boundary when it can only be
1810: reached by jumping. Pack code tightly when compiling crtstuff.c. */
1811: #define ASM_OUTPUT_ALIGN_CODE(FILE) \
1812: ASM_OUTPUT_ALIGN (FILE, (flag_inhibit_size_directive ? 2 : 3))
1813:
1814: /* Override svr[34].h. */
1815: #undef ASM_OUTPUT_SKIP
1816: #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1817: fprintf (FILE, "%s\t %u\n", SKIP_ASM_OP, (SIZE))
1818:
1819: /* Override svr4.h. */
1820: #undef ASM_OUTPUT_EXTERNAL_LIBCALL
1821:
1822: /* This says how to output an assembler line to define a global common
1823: symbol. Size can be zero for the unusual case of a `struct { int : 0; }'.
1824: Override svr[34].h. */
1825: #undef ASM_OUTPUT_COMMON
1826: #undef ASM_OUTPUT_ALIGNED_COMMON
1827: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1828: ( fprintf ((FILE), "%s\t ", \
1829: (ROUNDED) <= m88k_gp_threshold ? SCOMM_ASM_OP : COMMON_ASM_OP), \
1830: assemble_name ((FILE), (NAME)), \
1831: fprintf ((FILE), ",%u\n", (SIZE) ? (SIZE) : 1))
1832:
1833: /* This says how to output an assember line to define a local common
1834: symbol. Override svr[34].h. */
1835: #undef ASM_OUTPUT_LOCAL
1836: #undef ASM_OUTPUT_ALIGNED_LOCAL
1837: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1838: ( fprintf ((FILE), "%s\t ", \
1839: (ROUNDED) <= m88k_gp_threshold ? SBSS_ASM_OP : LOCAL_ASM_OP), \
1840: assemble_name ((FILE), (NAME)), \
1841: fprintf ((FILE), ",%u,%d\n", (SIZE) ? (SIZE) : 1, (SIZE) <= 4 ? 4 : 8))
1842:
1843: /* Store in OUTPUT a string (made with alloca) containing
1844: an assembler-name for a local static variable named NAME.
1845: LABELNO is an integer which is different for each call. */
1846: #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1847: ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1848: sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1849:
1850: /* This is how to output an insn to push a register on the stack.
1851: It need not be very fast code. */
1852: #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
1853: fprintf (FILE, "\tsubu\t %s,%s,%d\n\tst\t %s,%s,0\n", \
1854: reg_names[STACK_POINTER_REGNUM], \
1855: reg_names[STACK_POINTER_REGNUM], \
1856: (STACK_BOUNDARY / BITS_PER_UNIT), \
1857: reg_names[REGNO], \
1858: reg_names[STACK_POINTER_REGNUM])
1859:
1860: /* This is how to output an insn to pop a register from the stack. */
1861: #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
1862: fprintf (FILE, "\tld\t %s,%s,0\n\taddu\t %s,%s,%d\n", \
1863: reg_names[REGNO], \
1864: reg_names[STACK_POINTER_REGNUM], \
1865: reg_names[STACK_POINTER_REGNUM], \
1866: reg_names[STACK_POINTER_REGNUM], \
1867: (STACK_BOUNDARY / BITS_PER_UNIT))
1868:
1869: /* Define the parentheses used to group arithmetic operations
1870: in assembler code. */
1871: #define ASM_OPEN_PAREN "("
1872: #define ASM_CLOSE_PAREN ")"
1873:
1874: /* Define results of standard character escape sequences. */
1875: #define TARGET_BELL 007
1876: #define TARGET_BS 010
1877: #define TARGET_TAB 011
1878: #define TARGET_NEWLINE 012
1879: #define TARGET_VT 013
1880: #define TARGET_FF 014
1881: #define TARGET_CR 015
1882:
1883: /* Macros to deal with OCS debug information */
1884:
1885: #define OCS_START_PREFIX "Ltb"
1886: #define OCS_END_PREFIX "Lte"
1887:
1888: #define PUT_OCS_FUNCTION_START(FILE) \
1889: { ASM_OUTPUT_INTERNAL_LABEL (FILE, OCS_START_PREFIX, m88k_function_number); }
1890:
1891: #define PUT_OCS_FUNCTION_END(FILE) \
1892: { ASM_OUTPUT_INTERNAL_LABEL (FILE, OCS_END_PREFIX, m88k_function_number); }
1893:
1894: /* Macros for debug information */
1895: #define DEBUGGER_AUTO_OFFSET(X) \
1896: (m88k_debugger_offset (X, 0) \
1897: + (TARGET_OCS_FRAME_POSITION ? 0 : m88k_stack_size - m88k_fp_offset))
1898:
1899: #define DEBUGGER_ARG_OFFSET(OFFSET, X) \
1900: (m88k_debugger_offset (X, OFFSET) \
1901: + (TARGET_OCS_FRAME_POSITION ? 0 : m88k_stack_size - m88k_fp_offset))
1902:
1903: /* Macros to deal with SDB debug information */
1904: #ifdef SDB_DEBUGGING_INFO
1905:
1906: /* Output structure tag names even when it causes a forward reference. */
1907: #define SDB_ALLOW_FORWARD_REFERENCES
1908:
1909: /* Print out extra debug information in the assembler file */
1910: #define PUT_SDB_SCL(a) \
1911: do { \
1912: register int s = (a); \
1913: register char *scl; \
1914: switch (s) \
1915: { \
1916: case C_EFCN: scl = "end of function"; break; \
1917: case C_NULL: scl = "NULL storage class"; break; \
1918: case C_AUTO: scl = "automatic"; break; \
1919: case C_EXT: scl = "external"; break; \
1920: case C_STAT: scl = "static"; break; \
1921: case C_REG: scl = "register"; break; \
1922: case C_EXTDEF: scl = "external definition"; break; \
1923: case C_LABEL: scl = "label"; break; \
1924: case C_ULABEL: scl = "undefined label"; break; \
1925: case C_MOS: scl = "structure member"; break; \
1926: case C_ARG: scl = "argument"; break; \
1927: case C_STRTAG: scl = "structure tag"; break; \
1928: case C_MOU: scl = "union member"; break; \
1929: case C_UNTAG: scl = "union tag"; break; \
1930: case C_TPDEF: scl = "typedef"; break; \
1931: case C_USTATIC: scl = "uninitialized static"; break; \
1932: case C_ENTAG: scl = "enumeration tag"; break; \
1933: case C_MOE: scl = "member of enumeration"; break; \
1934: case C_REGPARM: scl = "register parameter"; break; \
1935: case C_FIELD: scl = "bit field"; break; \
1936: case C_BLOCK: scl = "block start/end"; break; \
1937: case C_FCN: scl = "function start/end"; break; \
1938: case C_EOS: scl = "end of structure"; break; \
1939: case C_FILE: scl = "filename"; break; \
1940: case C_LINE: scl = "line"; break; \
1941: case C_ALIAS: scl = "duplicated tag"; break; \
1942: case C_HIDDEN: scl = "hidden"; break; \
1943: default: scl = "unknown"; break; \
1944: } \
1945: \
1946: fprintf(asm_out_file, "\tscl\t %d\t\t\t\t; %s\n", s, scl); \
1947: } while (0)
1948:
1949: #define PUT_SDB_TYPE(a) \
1950: do { \
1951: register int t = (a); \
1952: static char buffer[100]; \
1953: register char *p = buffer, *q; \
1954: register int typ = t; \
1955: register int i,d; \
1956: \
1957: for (i = 0; i <= 5; i++) \
1958: { \
1959: switch ((typ >> ((i*N_TSHIFT) + N_BTSHFT)) & 03) \
1960: { \
1961: case DT_PTR: \
1962: strcpy (p, "ptr to "); \
1963: p += sizeof("ptr to"); \
1964: break; \
1965: \
1966: case DT_ARY: \
1967: strcpy (p, "array of "); \
1968: p += sizeof("array of"); \
1969: break; \
1970: \
1971: case DT_FCN: \
1972: strcpy (p, "func ret "); \
1973: p += sizeof("func ret"); \
1974: break; \
1975: } \
1976: } \
1977: \
1978: switch (typ & N_BTMASK) \
1979: { \
1980: case T_NULL: q = "<no type>"; break; \
1981: case T_CHAR: q = "char"; break; \
1982: case T_SHORT: q = "short"; break; \
1983: case T_INT: q = "int"; break; \
1984: case T_LONG: q = "long"; break; \
1985: case T_FLOAT: q = "float"; break; \
1986: case T_DOUBLE: q = "double"; break; \
1987: case T_STRUCT: q = "struct"; break; \
1988: case T_UNION: q = "union"; break; \
1989: case T_ENUM: q = "enum"; break; \
1990: case T_MOE: q = "enum member"; break; \
1991: case T_UCHAR: q = "unsigned char"; break; \
1992: case T_USHORT: q = "unsigned short"; break; \
1993: case T_UINT: q = "unsigned int"; break; \
1994: case T_ULONG: q = "unsigned long"; break; \
1995: default: q = "void"; break; \
1996: } \
1997: \
1998: strcpy (p, q); \
1999: fprintf(asm_out_file, "\ttype\t %d\t\t\t\t; %s\n", \
2000: t, buffer); \
2001: } while (0)
2002:
2003: #define PUT_SDB_INT_VAL(a) \
2004: fprintf (asm_out_file, "\tval\t %d\n", (a))
2005:
2006: #define PUT_SDB_VAL(a) \
2007: ( fprintf (asm_out_file, "\tval\t "), \
2008: output_addr_const (asm_out_file, (a)), \
2009: fputc ('\n', asm_out_file))
2010:
2011: #define PUT_SDB_DEF(a) \
2012: do { fprintf (asm_out_file, "\tsdef\t "); \
2013: ASM_OUTPUT_LABELREF (asm_out_file, a); \
2014: fputc ('\n', asm_out_file); \
2015: } while (0)
2016:
2017: #define PUT_SDB_PLAIN_DEF(a) \
2018: fprintf(asm_out_file,"\tsdef\t .%s\n", a)
2019:
2020: /* Simply and endef now. */
2021: #define PUT_SDB_ENDEF \
2022: fputs("\tendef\n\n", asm_out_file)
2023:
2024: #define PUT_SDB_SIZE(a) \
2025: fprintf (asm_out_file, "\tsize\t %d\n", (a))
2026:
2027: /* Max dimensions to store for debug information (limited by COFF). */
2028: #define SDB_MAX_DIM 6
2029:
2030: /* New method for dim operations. */
2031: #define PUT_SDB_START_DIM \
2032: fputs("\tdim\t ", asm_out_file)
2033:
2034: /* How to end the DIM sequence. */
2035: #define PUT_SDB_LAST_DIM(a) \
2036: fprintf(asm_out_file, "%d\n", a)
2037:
2038: #define PUT_SDB_TAG(a) \
2039: do { \
2040: fprintf (asm_out_file, "\ttag\t "); \
2041: ASM_OUTPUT_LABELREF (asm_out_file, a); \
2042: fputc ('\n', asm_out_file); \
2043: } while( 0 )
2044:
2045: #define PUT_SDB_BLOCK_OR_FUNCTION(NAME, SCL, LINE) \
2046: do { \
2047: fprintf (asm_out_file, "\n\tsdef\t %s\n\tval\t .\n", \
2048: NAME); \
2049: PUT_SDB_SCL( SCL ); \
2050: fprintf (asm_out_file, "\tline\t %d\n\tendef\n\n", \
2051: (LINE)); \
2052: } while (0)
2053:
2054: #define PUT_SDB_BLOCK_START(LINE) \
2055: PUT_SDB_BLOCK_OR_FUNCTION (".bb", C_BLOCK, (LINE))
2056:
2057: #define PUT_SDB_BLOCK_END(LINE) \
2058: PUT_SDB_BLOCK_OR_FUNCTION (".eb", C_BLOCK, (LINE))
2059:
2060: #define PUT_SDB_FUNCTION_START(LINE) \
2061: do { \
2062: fprintf (asm_out_file, "\tln\t 1\n"); \
2063: PUT_SDB_BLOCK_OR_FUNCTION (".bf", C_FCN, (LINE)); \
2064: } while (0)
2065:
2066: #define PUT_SDB_FUNCTION_END(LINE) \
2067: do { \
2068: PUT_SDB_BLOCK_OR_FUNCTION (".ef", C_FCN, (LINE)); \
2069: } while (0)
2070:
2071: #define PUT_SDB_EPILOGUE_END(NAME) \
2072: do { \
2073: text_section (); \
2074: fprintf (asm_out_file, "\n\tsdef\t "); \
2075: ASM_OUTPUT_LABELREF(asm_out_file, (NAME)); \
2076: fputc('\n', asm_out_file); \
2077: PUT_SDB_SCL( C_EFCN ); \
2078: fprintf (asm_out_file, "\tendef\n\n"); \
2079: } while (0)
2080:
2081: #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
2082: sprintf ((BUFFER), ".%dfake", (NUMBER));
2083:
2084: #endif /* SDB_DEBUGGING_INFO */
2085:
2086: /* Support const and tdesc sections. Generally, a const section will
2087: be distinct from the text section whenever we do V.4-like things
2088: and so follows DECLARE_ASM_NAME. Note that strings go in text
2089: rather than const. Override svr[34].h. */
2090:
2091: #undef USE_CONST_SECTION
2092: #undef EXTRA_SECTIONS
2093:
2094: #define USE_CONST_SECTION DECLARE_ASM_NAME
2095:
2096: #if defined(CTORS_SECTION_FUNCTION) /* SVR4 */
2097:
2098: #define EXTRA_SECTIONS in_const, in_tdesc, in_sdata, in_ctors, in_dtors
2099: #define INIT_SECTION_FUNCTION
2100: #define FINI_SECTION_FUNCTION
2101:
2102: #elif defined(FINI_SECTION_FUNCTION) /* SVR3 */
2103:
2104: #define EXTRA_SECTIONS in_const, in_tdesc, in_sdata, in_init, in_fini
2105: #define CTORS_SECTION_FUNCTION
2106: #define DTORS_SECTION_FUNCTION
2107:
2108: #else /* m88kluna or other not based on svr[34].h. */
2109:
2110: #define EXTRA_SECTIONS in_const, in_tdesc, in_sdata
2111: #define CONST_SECTION_FUNCTION \
2112: void \
2113: const_section () \
2114: { \
2115: text_section(); \
2116: }
2117: #define CTORS_SECTION_FUNCTION
2118: #define DTORS_SECTION_FUNCTION
2119: #define INIT_SECTION_FUNCTION
2120: #define FINI_SECTION_FUNCTION
2121:
2122: #endif /* CTORS_SECTION_FUNCTION */
2123:
2124: #undef EXTRA_SECTION_FUNCTIONS
2125: #define EXTRA_SECTION_FUNCTIONS \
2126: CONST_SECTION_FUNCTION \
2127: \
2128: void \
2129: tdesc_section () \
2130: { \
2131: if (in_section != in_tdesc) \
2132: { \
2133: fprintf (asm_out_file, "%s\n", TDESC_SECTION_ASM_OP); \
2134: in_section = in_tdesc; \
2135: } \
2136: } \
2137: \
2138: void \
2139: sdata_section () \
2140: { \
2141: if (in_section != in_sdata) \
2142: { \
2143: fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
2144: in_section = in_sdata; \
2145: } \
2146: } \
2147: \
2148: CTORS_SECTION_FUNCTION \
2149: DTORS_SECTION_FUNCTION \
2150: INIT_SECTION_FUNCTION \
2151: FINI_SECTION_FUNCTION
2152:
2153: #undef READONLY_DATA_SECTION
2154:
2155: /* A C statement or statements to switch to the appropriate
2156: section for output of DECL. DECL is either a `VAR_DECL' node
2157: or a constant of some sort. RELOC indicates whether forming
2158: the initial value of DECL requires link-time relocations.
2159:
2160: For strings, the section is selected before the segment info is encoded. */
2161: #undef SELECT_SECTION
2162: #define SELECT_SECTION(DECL,RELOC) \
2163: { \
2164: if (TREE_CODE (DECL) == STRING_CST) \
2165: { \
2166: if (! flag_writable_strings) \
2167: const_section (); \
2168: else if (m88k_gp_threshold > 0 \
2169: && TREE_STRING_LENGTH (DECL) <= m88k_gp_threshold) \
2170: sdata_section (); \
2171: else \
2172: data_section (); \
2173: } \
2174: else if (TREE_CODE (DECL) == VAR_DECL) \
2175: { \
2176: if (SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0))) \
2177: sdata_section (); \
2178: else if ((flag_pic && RELOC) \
2179: || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \
2180: data_section (); \
2181: else \
2182: const_section (); \
2183: } \
2184: else \
2185: const_section (); \
2186: }
2187:
2188: /* Define this macro if references to a symbol must be treated differently
2189: depending on something about the variable or function named by the
2190: symbol (such as what section it is in).
2191:
2192: The macro definition, if any, is executed immediately after the rtl for
2193: DECL has been created and stored in `DECL_RTL (DECL)'. The value of the
2194: rtl will be a `mem' whose address is a `symbol_ref'.
2195:
2196: For the m88k, determine if the item should go in the global pool. */
2197: #define ENCODE_SECTION_INFO(DECL) \
2198: do { \
2199: if (m88k_gp_threshold > 0) \
2200: if (TREE_CODE (DECL) == VAR_DECL) \
2201: { \
2202: if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \
2203: { \
2204: int size = int_size_in_bytes (TREE_TYPE (DECL)); \
2205: \
2206: if (size > 0 && size <= m88k_gp_threshold) \
2207: SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
2208: } \
2209: } \
2210: else if (TREE_CODE (DECL) == STRING_CST \
2211: && flag_writable_strings \
2212: && TREE_STRING_LENGTH (DECL) <= m88k_gp_threshold) \
2213: SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (DECL), 0)) = 1; \
2214: } while (0)
2215:
2216: /* Print operand X (an rtx) in assembler syntax to file FILE.
2217: CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
2218: For `%' followed by punctuation, CODE is the punctuation and X is null. */
2219: #define PRINT_OPERAND_PUNCT_VALID_P(c) \
2220: ((c) == '#' || (c) == '.' || (c) == '!' || (c) == '*' || (c) == ';')
2221:
2222: #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
2223:
2224: /* Print a memory address as an operand to reference that memory location. */
2225: #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.