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