* expr.c (do_tablejump): Let CASE_VECTOR_PC_RELATIVE be an
[official-gcc.git] / gcc / config / i370 / i370.h
blob28279b24dfaf3105b5febd58a337d2a0c3b681f1
1 /* Definitions of target machine for GNU compiler. System/370 version.
2 Copyright (C) 1989, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
3 Contributed by Jan Stein (jan@cd.chalmers.se).
4 Modified for C/370 MVS by Dave Pitts (dpitts@nyx.cs.du.edu)
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #define TARGET_VERSION printf (" (370/MVS)");
25 /* Options for the preprocessor for this target machine. */
27 #define CPP_SPEC "-trigraphs"
29 /* Names to predefine in the preprocessor for this target machine. */
31 #define CPP_PREDEFINES "-DGCC -Dgcc -DMVS -Dmvs -Asystem(mvs) -Acpu(i370) -Amachine(i370)"
33 /* Run-time compilation parameters selecting different hardware subsets. */
35 extern int target_flags;
37 /* The sizes of the code and literals on the current page. */
39 extern int mvs_page_code, mvs_page_lit;
41 /* The current page number and the base page number for the function. */
43 extern int mvs_page_num, function_base_page;
45 /* True if a label has been emitted. */
47 extern int mvs_label_emitted;
49 /* The name of the current function. */
51 extern char *mvs_function_name;
53 /* The length of the function name malloc'd area. */
55 extern int mvs_function_name_length;
57 /* The amount of space used for outgoing arguments. */
59 extern int current_function_outgoing_args_size;
61 /* Compile using char instructions (mvc, nc, oc, xc). On 4341 use this since
62 these are more than twice as fast as load-op-store.
63 On 3090 don't use this since load-op-store is much faster. */
65 #define TARGET_CHAR_INSTRUCTIONS (target_flags & 1)
67 /* Default target switches */
69 #define TARGET_DEFAULT 1
71 /* Macro to define tables used to set the flags. This is a list in braces
72 of pairs in braces, each pair being { "NAME", VALUE }
73 where VALUE is the bits to set or minus the bits to clear.
74 An empty string NAME is used to identify the default VALUE. */
76 #define TARGET_SWITCHES \
77 { { "char-instructions", 1}, \
78 { "no-char-instructions", -1}, \
79 { "", TARGET_DEFAULT} }
81 /* To use IBM supplied macro function prologue and epilogue, define the
82 following to 1. Should only be needed if IBM changes the definition
83 of their prologue and epilogue. */
85 #define MACROPROLOGUE 0
86 #define MACROEPILOGUE 0
88 /* Target machine storage layout */
90 /* Define this if most significant bit is lowest numbered in instructions
91 that operate on numbered bit-fields. */
93 #define BITS_BIG_ENDIAN 1
95 /* Define this if most significant byte of a word is the lowest numbered. */
97 #define BYTES_BIG_ENDIAN 1
99 /* Define this if MS word of a multiword is the lowest numbered. */
101 #define WORDS_BIG_ENDIAN 1
103 /* Number of bits in an addressable storage unit. */
105 #define BITS_PER_UNIT 8
107 /* Width in bits of a "word", which is the contents of a machine register. */
109 #define BITS_PER_WORD 32
111 /* Width of a word, in units (bytes). */
113 #define UNITS_PER_WORD 4
115 /* Width in bits of a pointer. See also the macro `Pmode' defined below. */
117 #define POINTER_SIZE 32
119 /* Allocation boundary (in *bits*) for storing pointers in memory. */
121 #define POINTER_BOUNDARY 32
123 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
125 #define PARM_BOUNDARY 32
127 /* Boundary (in *bits*) on which stack pointer should be aligned. */
129 #define STACK_BOUNDARY 32
131 /* Allocation boundary (in *bits*) for the code of a function. */
133 #define FUNCTION_BOUNDARY 32
135 /* There is no point aligning anything to a rounder boundary than this. */
137 #define BIGGEST_ALIGNMENT 64
139 /* Alignment of field after `int : 0' in a structure. */
141 #define EMPTY_FIELD_BOUNDARY 32
143 /* Define this if move instructions will actually fail to work when given
144 unaligned data. */
146 #define STRICT_ALIGNMENT 0
148 /* Define target floating point format. */
150 #define TARGET_FLOAT_FORMAT IBM_FLOAT_FORMAT
152 /* Define character mapping for cross-compiling. */
154 #define TARGET_EBCDIC 1
156 #ifdef HOST_EBCDIC
157 #define MAP_CHARACTER(c) ((char)(c))
158 #else
159 #define MAP_CHARACTER(c) ((char)mvs_map_char (c))
160 #endif
162 /* Define maximum length of page minus page escape overhead. */
164 #define MAX_MVS_PAGE_LENGTH 4080
166 /* Define if special allocation order desired. */
168 #define REG_ALLOC_ORDER \
169 { 0, 1, 2, 3, 14, 15, 12, 10, 9, 8, 7, 6, 5, 4, 16, 17, 18, 19, 11, 13 }
171 /* Standard register usage. */
173 /* Number of actual hardware registers. The hardware registers are
174 assigned numbers for the compiler from 0 to just below
175 FIRST_PSEUDO_REGISTER.
176 All registers that the compiler knows about must be given numbers,
177 even those that are not normally considered general registers.
178 For the 370, we give the data registers numbers 0-15,
179 and the floating point registers numbers 16-19. */
181 #define FIRST_PSEUDO_REGISTER 20
183 /* Define base and page registers. */
185 #define BASE_REGISTER 3
186 #define PAGE_REGISTER 4
188 /* 1 for registers that have pervasive standard uses and are not available
189 for the register allocator. On the 370 under C/370, R13 is stack (DSA)
190 pointer, R12 is the TCA pointer, R3 is the base register, R4 is the page
191 origin table pointer and R11 is the arg pointer. */
193 #define FIXED_REGISTERS \
194 { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0 }
195 /*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19*/
197 /* 1 for registers not available across function calls. These must include
198 the FIXED_REGISTERS and also any registers that can be used without being
199 saved.
200 The latter must include the registers where values are returned
201 and the register where structure-value addresses are passed.
202 NOTE: all floating registers are undefined across calls. */
204 #define CALL_USED_REGISTERS \
205 { 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
206 /*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19*/
208 /* Return number of consecutive hard regs needed starting at reg REGNO
209 to hold something of mode MODE.
210 This is ordinarily the length in words of a value of mode MODE
211 but can be less for certain modes in special long registers. */
213 #define HARD_REGNO_NREGS(REGNO, MODE) \
214 ((REGNO) > 15 ? 1 : (GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD)
216 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
217 On the 370, the cpu registers can hold QI, HI, SI, SF and DF. The
218 even registers can hold DI. The floating point registers can hold
219 either SF or DF. */
221 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
222 ((REGNO) < 16 ? ((REGNO) & 1) == 0 || (MODE) != DImode \
223 : (MODE) == SFmode || (MODE) == DFmode)
225 /* Value is 1 if it is a good idea to tie two pseudo registers when one has
226 mode MODE1 and one has mode MODE2.
227 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
228 for any hard reg, then this must be 0 for correct output. */
230 #define MODES_TIEABLE_P(MODE1, MODE2) \
231 (((MODE1) == SFmode || (MODE1) == DFmode) \
232 == ((MODE2) == SFmode || (MODE2) == DFmode))
234 /* Mark external references. */
236 #define ENCODE_SECTION_INFO(decl) \
237 if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)) \
238 SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
240 /* Specify the registers used for certain standard purposes.
241 The values of these macros are register numbers. */
243 /* 370 PC isn't overloaded on a register. */
245 /* #define PC_REGNUM */
247 /* Register to use for pushing function arguments. */
249 #define STACK_POINTER_REGNUM 13
251 /* Base register for access to local variables of the function. */
253 #define FRAME_POINTER_REGNUM 13
255 /* Value should be nonzero if functions must have frame pointers.
256 Zero means the frame pointer need not be set up (and parms may be
257 accessed via the stack pointer) in functions that seem suitable.
258 This is computed in `reload', in reload1.c. */
260 #define FRAME_POINTER_REQUIRED 1
262 /* Base register for access to arguments of the function. */
264 #define ARG_POINTER_REGNUM 11
266 /* Register in which static-chain is passed to a function. */
268 #define STATIC_CHAIN_REGNUM 10
270 /* Register in which address to store a structure value is passed to
271 a function. */
273 #define STRUCT_VALUE_REGNUM 1
275 /* Define the classes of registers for register constraints in the
276 machine description. Also define ranges of constants.
278 One of the classes must always be named ALL_REGS and include all hard regs.
279 If there is more than one class, another class must be named NO_REGS
280 and contain no registers.
282 The name GENERAL_REGS must be the name of a class (or an alias for
283 another name such as ALL_REGS). This is the class of registers
284 that is allowed by "g" or "r" in a register constraint.
285 Also, registers outside this class are allocated only when
286 instructions express preferences for them.
288 The classes must be numbered in nondecreasing order; that is,
289 a larger-numbered class must never be contained completely
290 in a smaller-numbered class.
292 For any two classes, it is very desirable that there be another
293 class that represents their union. */
295 enum reg_class
297 NO_REGS, ADDR_REGS, DATA_REGS,
298 FP_REGS, ALL_REGS, LIM_REG_CLASSES
301 #define GENERAL_REGS DATA_REGS
302 #define N_REG_CLASSES (int) LIM_REG_CLASSES
304 /* Give names of register classes as strings for dump file. */
306 #define REG_CLASS_NAMES \
307 { "NO_REGS", "ADDR_REGS", "DATA_REGS", "FP_REGS", "ALL_REGS" }
309 /* Define which registers fit in which classes. This is an initializer for
310 a vector of HARD_REG_SET of length N_REG_CLASSES. */
312 #define REG_CLASS_CONTENTS {0, 0x0fffe, 0x0ffff, 0xf0000, 0xfffff}
314 /* The same information, inverted:
315 Return the class number of the smallest class containing
316 reg number REGNO. This could be a conditional expression
317 or could index an array. */
319 #define REGNO_REG_CLASS(REGNO) \
320 ((REGNO) >= 16 ? FP_REGS : (REGNO) != 0 ? ADDR_REGS : DATA_REGS)
322 /* The class value for index registers, and the one for base regs. */
324 #define INDEX_REG_CLASS ADDR_REGS
325 #define BASE_REG_CLASS ADDR_REGS
327 /* Get reg_class from a letter such as appears in the machine description. */
329 #define REG_CLASS_FROM_LETTER(C) \
330 ((C) == 'a' ? ADDR_REGS : \
331 ((C) == 'd' ? DATA_REGS : \
332 ((C) == 'f' ? FP_REGS : NO_REGS)))
334 /* The letters I, J, K, L and M in a register constraint string can be used
335 to stand for particular ranges of immediate operands.
336 This macro defines what the ranges are.
337 C is the letter, and VALUE is a constant value.
338 Return 1 if VALUE is in the range specified by C. */
340 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
341 ((C) == 'I' ? (unsigned) (VALUE) < 256 : \
342 (C) == 'J' ? (unsigned) (VALUE) < 4096 : \
343 (C) == 'K' ? (VALUE) >= -32768 && (VALUE) < 32768 : 0)
345 /* Similar, but for floating constants, and defining letters G and H.
346 Here VALUE is the CONST_DOUBLE rtx itself. */
348 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
350 /* Given an rtx X being reloaded into a reg required to be in class CLASS,
351 return the class of reg to actually use. In general this is just CLASS;
352 but on some machines in some cases it is preferable to use a more
353 restrictive class. */
355 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
356 (GET_CODE(X) == CONST_DOUBLE ? FP_REGS : \
357 GET_CODE(X) == CONST_INT ? DATA_REGS : \
358 GET_CODE(X) == LABEL_REF || \
359 GET_CODE(X) == SYMBOL_REF || \
360 GET_CODE(X) == CONST ? ADDR_REGS : (CLASS))
362 /* Return the maximum number of consecutive registers needed to represent
363 mode MODE in a register of class CLASS. */
365 #define CLASS_MAX_NREGS(CLASS, MODE) \
366 ((CLASS) == FP_REGS ? 1 : \
367 (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
369 /* Stack layout; function entry, exit and calling. */
371 /* Define this if pushing a word on the stack makes the stack pointer a
372 smaller address. */
374 /* #define STACK_GROWS_DOWNWARD */
376 /* Define this if the nominal address of the stack frame is at the
377 high-address end of the local variables; that is, each additional local
378 variable allocated goes at a more negative offset in the frame. */
380 /* #define FRAME_GROWS_DOWNWARD */
382 /* Offset within stack frame to start allocating local variables at.
383 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
384 first local allocated. Otherwise, it is the offset to the BEGINNING
385 of the first local allocated. */
387 #define STARTING_FRAME_OFFSET \
388 (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
390 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = STARTING_FRAME_OFFSET
392 /* If we generate an insn to push BYTES bytes, this says how many the stack
393 pointer really advances by. On the 370, we have no push instruction. */
395 /* #define PUSH_ROUNDING(BYTES) */
397 /* Accumulate the outgoing argument count so we can request the right
398 DSA size and determine stack offset. */
400 #define ACCUMULATE_OUTGOING_ARGS
402 /* Define offset from stack pointer, to location where a parm can be
403 pushed. */
405 #define STACK_POINTER_OFFSET 148
407 /* Offset of first parameter from the argument pointer register value. */
409 #define FIRST_PARM_OFFSET(FNDECL) 0
411 /* 1 if N is a possible register number for function argument passing.
412 On the 370, no registers are used in this way. */
414 #define FUNCTION_ARG_REGNO_P(N) 0
416 /* Define a data type for recording info about an argument list during
417 the scan of that argument list. This data type should hold all
418 necessary information about the function itself and about the args
419 processed so far, enough to enable macros such as FUNCTION_ARG to
420 determine where the next arg should go. */
422 #define CUMULATIVE_ARGS int
424 /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to
425 a function whose data type is FNTYPE.
426 For a library call, FNTYPE is 0. */
428 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) ((CUM) = 0)
430 /* Update the data in CUM to advance over an argument of mode MODE and
431 data type TYPE. (TYPE is null for libcalls where that information
432 may not be available.) */
434 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
435 ((CUM) += ((MODE) == DFmode || (MODE) == SFmode \
436 ? 256 \
437 : (MODE) != BLKmode \
438 ? (GET_MODE_SIZE (MODE) + 3) / 4 \
439 : (int_size_in_bytes (TYPE) + 3) / 4))
441 /* Define where to put the arguments to a function. Value is zero to push
442 the argument on the stack, or a hard register in which to store the
443 argument. */
445 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
447 /* For an arg passed partly in registers and partly in memory, this is the
448 number of registers used. For args passed entirely in registers or
449 entirely in memory, zero. */
451 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
453 /* Define if returning from a function call automatically pops the
454 arguments described by the number-of-args field in the call. */
456 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
458 /* Define how to find the value returned by a function. VALTYPE is the
459 data type of the value (as a tree).
460 If the precise function being called is known, FUNC is its FUNCTION_DECL;
461 otherwise, FUNC is 15. */
463 #define RET_REG(MODE) ((MODE) == DFmode || (MODE) == SFmode ? 16 : 15)
465 /* On the 370 the return value is in R15 or R16. */
467 #define FUNCTION_VALUE(VALTYPE, FUNC) \
468 gen_rtx(REG, TYPE_MODE (VALTYPE), RET_REG(TYPE_MODE(VALTYPE)))
470 /* Define how to find the value returned by a library function assuming
471 the value has mode MODE. */
473 #define LIBCALL_VALUE(MODE) gen_rtx(REG, MODE, RET_REG(MODE))
475 /* 1 if N is a possible register number for a function value.
476 On the 370 under C/370, R15 and R16 are thus used. */
478 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 15 || (N) == 16)
480 /* This macro definition sets up a default value for `main' to return. */
482 #define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
484 /* This macro generates the assembly code for function entry.
485 All of the C/370 environment is preserved. */
486 #define FUNCTION_PROLOGUE(FILE, LSIZE) i370_function_prolog ((FILE), (LSIZE));
488 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
490 if (strlen (NAME) * 2 > mvs_function_name_length) \
492 if (mvs_function_name) \
493 free (mvs_function_name); \
494 mvs_function_name = 0; \
496 if (!mvs_function_name) \
498 mvs_function_name_length = strlen (NAME) * 2; \
499 mvs_function_name = (char *) malloc (mvs_function_name_length); \
500 if (mvs_function_name == 0) \
502 fatal ("virtual memory exceeded"); \
503 abort (); \
506 if (!strcmp (NAME, "main")) \
507 strcpy (mvs_function_name, "gccmain"); \
508 else \
509 strcpy (mvs_function_name, NAME); \
512 /* This macro generates the assembly code for function exit, on machines
513 that need it. If FUNCTION_EPILOGUE is not defined then individual
514 return instructions are generated for each return statement. Args are
515 same as for FUNCTION_PROLOGUE.
517 The function epilogue should not depend on the current stack pointer!
518 It should use the frame pointer only. This is mandatory because
519 of alloca; we also take advantage of it to omit stack adjustments
520 before returning. */
522 #if MACROEPILOGUE == 1
523 #define FUNCTION_EPILOGUE(FILE, LSIZE) \
525 int i; \
526 check_label_emit(); \
527 mvs_check_page (FILE,14,0); \
528 fprintf (FILE, "\tEDCEPIL\n"); \
529 mvs_page_num++; \
530 fprintf (FILE, "\tDS\t0F\n" ); \
531 fprintf (FILE, "\tLTORG\n"); \
532 fprintf (FILE, "\tDS\t0F\n"); \
533 fprintf (FILE, "PGT%d\tEQU\t*\n", function_base_page); \
534 mvs_free_label(); \
535 for ( i = function_base_page; i < mvs_page_num; i++ ) \
536 fprintf (FILE, "\tDC\tA(PG%d)\n", i); \
538 #else /* MACROEPILOGUE != 1 */
539 #define FUNCTION_EPILOGUE(FILE, LSIZE) \
541 int i; \
542 check_label_emit(); \
543 mvs_check_page (FILE,14,0); \
544 fprintf (FILE, "\tL\t13,4(,13)\n"); \
545 fprintf (FILE, "\tL\t14,12(,13)\n"); \
546 fprintf (FILE, "\tLM\t2,12,28(13)\n"); \
547 fprintf (FILE, "\tBALR\t1,14\n"); \
548 fprintf (FILE, "\tDC\tA("); \
549 mvs_page_num++; \
550 assemble_name (FILE, mvs_function_name); \
551 fprintf (FILE, ")\n" ); \
552 fprintf (FILE, "\tDS\t0F\n" ); \
553 fprintf (FILE, "\tLTORG\n"); \
554 fprintf (FILE, "\tDS\t0F\n"); \
555 fprintf (FILE, "PGT%d\tEQU\t*\n", function_base_page); \
556 mvs_free_label(); \
557 for ( i = function_base_page; i < mvs_page_num; i++ ) \
558 fprintf (FILE, "\tDC\tA(PG%d)\n", i); \
560 #endif /* MACROEPILOGUE */
563 /* Output assembler code for a block containing the constant parts of a
564 trampoline, leaving space for the variable parts.
566 On the 370, the trampoline contains these instructions:
568 BALR 14,0
569 USING *,14
570 L STATIC_CHAIN_REGISTER,X
571 L 15,Y
572 BR 15
573 X DS 0F
574 Y DS 0F */
576 #define TRAMPOLINE_TEMPLATE(FILE) \
578 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x05E0)); \
579 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x5800 | \
580 STATIC_CHAIN_REGNUM << 4)); \
581 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xE00A)); \
582 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x58F0)); \
583 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0xE00E)); \
584 ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x07FF)); \
585 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
586 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
587 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
588 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
591 /* Length in units of the trampoline for entering a nested function. */
593 #define TRAMPOLINE_SIZE 20
595 /* Emit RTL insns to initialize the variable parts of a trampoline. */
597 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
599 emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 12)), CXT); \
600 emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 16)), FNADDR); \
603 /* Output assembler code to FILE to increment profiler label # LABELNO
604 for profiling a function entry. */
606 #define FUNCTION_PROFILER(FILE, LABELNO) \
607 fprintf (FILE, "Error: No profiling available.\n")
609 /* Define EXIT_IGNORE_STACK if, when returning from a function, the stack
610 pointer does not matter (provided there is a frame pointer). */
612 #define EXIT_IGNORE_STACK 1
614 /* Addressing modes, and classification of registers for them. */
616 /* #define HAVE_POST_INCREMENT */
617 /* #define HAVE_POST_DECREMENT */
619 /* #define HAVE_PRE_DECREMENT */
620 /* #define HAVE_PRE_INCREMENT */
622 /* These assume that REGNO is a hard or pseudo reg number. They give
623 nonzero only if REGNO is a hard reg of the suitable class or a pseudo
624 reg currently allocated to a suitable hard reg.
625 These definitions are NOT overridden anywhere. */
627 #define REGNO_OK_FOR_INDEX_P(REGNO) \
628 (((REGNO) > 0 && (REGNO) < 16) \
629 || (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16))
631 #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P(REGNO)
633 #define REGNO_OK_FOR_DATA_P(REGNO) \
634 ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)
636 #define REGNO_OK_FOR_FP_P(REGNO) \
637 ((unsigned) ((REGNO) - 16) < 4 || (unsigned) (reg_renumber[REGNO] - 16) < 4)
639 /* Now macros that check whether X is a register and also,
640 strictly, whether it is in a specified class. */
642 /* 1 if X is a data register. */
644 #define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))
646 /* 1 if X is an fp register. */
648 #define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))
650 /* 1 if X is an address register. */
652 #define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))
654 /* Maximum number of registers that can appear in a valid memory address. */
656 #define MAX_REGS_PER_ADDRESS 2
658 /* Recognize any constant value that is a valid address. */
660 #define CONSTANT_ADDRESS_P(X) \
661 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
662 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
663 || (GET_CODE (X) == CONST \
664 && GET_CODE (XEXP (XEXP (X, 0), 0)) == LABEL_REF) \
665 || (GET_CODE (X) == CONST \
666 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \
667 && !SYMBOL_REF_FLAG (XEXP (XEXP (X, 0), 0))))
669 /* Nonzero if the constant value X is a legitimate general operand.
670 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
672 #define LEGITIMATE_CONSTANT_P(X) 1
674 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check
675 its validity for a certain class. We have two alternate definitions
676 for each of them. The usual definition accepts all pseudo regs; the
677 other rejects them all. The symbol REG_OK_STRICT causes the latter
678 definition to be used.
680 Most source files want to accept pseudo regs in the hope that they will
681 get allocated to the class that the insn wants them to be in.
682 Some source files that are used after register allocation
683 need to be strict. */
685 #ifndef REG_OK_STRICT
687 /* Nonzero if X is a hard reg that can be used as an index or if it is
688 a pseudo reg. */
690 #define REG_OK_FOR_INDEX_P(X) \
691 ((REGNO(X) > 0 && REGNO(X) < 16) || REGNO(X) >= 20)
693 /* Nonzero if X is a hard reg that can be used as a base reg or if it is
694 a pseudo reg. */
696 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_INDEX_P(X)
698 #else /* REG_OK_STRICT */
700 /* Nonzero if X is a hard reg that can be used as an index. */
702 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P(REGNO(X))
704 /* Nonzero if X is a hard reg that can be used as a base reg. */
706 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P(REGNO(X))
708 #endif /* REG_OK_STRICT */
710 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
711 valid memory address for an instruction.
712 The MODE argument is the machine mode for the MEM expression
713 that wants to use this address.
715 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
716 except for CONSTANT_ADDRESS_P which is actually machine-independent. */
718 #define COUNT_REGS(X, REGS, FAIL) \
719 if (REG_P (X) && REG_OK_FOR_BASE_P (X)) \
720 REGS += 1; \
721 else if (GET_CODE (X) != CONST_INT || (unsigned) INTVAL (X) >= 4096) \
722 goto FAIL;
724 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
726 if (REG_P (X) && REG_OK_FOR_BASE_P (X)) \
727 goto ADDR; \
728 if (GET_CODE (X) == PLUS) \
730 int regs = 0; \
731 rtx x0 = XEXP (X, 0); \
732 rtx x1 = XEXP (X, 1); \
733 if (GET_CODE (x0) == PLUS) \
735 COUNT_REGS (XEXP (x0, 0), regs, FAIL); \
736 COUNT_REGS (XEXP (x0, 1), regs, FAIL); \
737 COUNT_REGS (x1, regs, FAIL); \
738 if (regs == 2) \
739 goto ADDR; \
741 else if (GET_CODE (x1) == PLUS) \
743 COUNT_REGS (x0, regs, FAIL); \
744 COUNT_REGS (XEXP (x1, 0), regs, FAIL); \
745 COUNT_REGS (XEXP (x1, 1), regs, FAIL); \
746 if (regs == 2) \
747 goto ADDR; \
749 else \
751 COUNT_REGS (x0, regs, FAIL); \
752 COUNT_REGS (x1, regs, FAIL); \
753 if (regs != 0) \
754 goto ADDR; \
757 FAIL: ; \
760 /* The 370 has no mode dependent addresses. */
762 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
764 /* Try machine-dependent ways of modifying an illegitimate address
765 to be legitimate. If we find one, return the new, valid address.
766 This macro is used in only one place: `memory_address' in explow.c. */
768 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
770 if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
771 (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \
772 copy_to_mode_reg (SImode, XEXP (X, 1))); \
773 if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \
774 (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \
775 copy_to_mode_reg (SImode, XEXP (X, 0))); \
776 if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \
777 (X) = gen_rtx (PLUS, SImode, XEXP (X, 1), \
778 force_operand (XEXP (X, 0), 0)); \
779 if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \
780 (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \
781 force_operand (XEXP (X, 1), 0)); \
782 if (memory_address_p (MODE, X)) \
783 goto WIN; \
786 /* Specify the machine mode that this machine uses for the index in the
787 tablejump instruction. */
789 #define CASE_VECTOR_MODE SImode
791 /* Define as C expression which evaluates to nonzero if the tablejump
792 instruction expects the table to contain offsets from the address of the
793 table.
794 Do not define this if the table should contain absolute addresses. */
795 /* #define CASE_VECTOR_PC_RELATIVE 1 */
797 /* Specify the tree operation to be used to convert reals to integers. */
799 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
801 /* Define this if fixuns_trunc is the same as fix_trunc. */
803 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
805 /* We use "unsigned char" as default. */
807 #define DEFAULT_SIGNED_CHAR 0
809 /* This is the kind of divide that is easiest to do in the general case. */
811 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
813 /* Max number of bytes we can move from memory to memory in one reasonably
814 fast instruction. */
816 #define MOVE_MAX 256
818 /* Define this if zero-extension is slow (more than one real instruction). */
820 #define SLOW_ZERO_EXTEND
822 /* Nonzero if access to memory by bytes is slow and undesirable. */
824 #define SLOW_BYTE_ACCESS 1
826 /* Define if shifts truncate the shift count which implies one can omit
827 a sign-extension or zero-extension of a shift count. */
829 /* #define SHIFT_COUNT_TRUNCATED */
831 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
832 is done just by pretending it is already truncated. */
834 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) (OUTPREC != 16)
836 /* We assume that the store-condition-codes instructions store 0 for false
837 and some other value for true. This is the value stored for true. */
839 /* #define STORE_FLAG_VALUE -1 */
841 /* When a prototype says `char' or `short', really pass an `int'. */
843 #define PROMOTE_PROTOTYPES
845 /* Don't perform CSE on function addresses. */
847 #define NO_FUNCTION_CSE
849 /* Specify the machine mode that pointers have.
850 After generation of rtl, the compiler makes no further distinction
851 between pointers and any other objects of this machine mode. */
853 #define Pmode SImode
855 /* A function address in a call instruction is a byte address (for
856 indexing purposes) so give the MEM rtx a byte's mode. */
858 #define FUNCTION_MODE QImode
860 /* Compute the cost of computing a constant rtl expression RTX whose
861 rtx-code is CODE. The body of this macro is a portion of a switch
862 statement. If the code is computed here, return it with a return
863 statement. Otherwise, break from the switch. */
865 #define CONST_COSTS(RTX, CODE, OUTERCODE) \
866 case CONST_INT: \
867 if ((unsigned) INTVAL (RTX) < 0xfff) return 1; \
868 case CONST: \
869 case LABEL_REF: \
870 case SYMBOL_REF: \
871 return 2; \
872 case CONST_DOUBLE: \
873 return 4;
875 /* Tell final.c how to eliminate redundant test instructions. */
877 /* Here we define machine-dependent flags and fields in cc_status
878 (see `conditions.h'). */
880 /* Store in cc_status the expressions that the condition codes will
881 describe after execution of an instruction whose pattern is EXP.
882 Do not alter them if the instruction would not alter the cc's.
884 On the 370, load insns do not alter the cc's. However, in some
885 cases these instructions can make it possibly invalid to use the
886 saved cc's. In those cases we clear out some or all of the saved
887 cc's so they won't be used. */
889 #define NOTICE_UPDATE_CC(EXP, INSN) \
891 rtx exp = (EXP); \
892 if (GET_CODE (exp) == PARALLEL) /* Check this */ \
893 exp = XVECEXP (exp, 0, 0); \
894 if (GET_CODE (exp) != SET) \
895 CC_STATUS_INIT; \
896 else \
898 if (XEXP (exp, 0) == cc0_rtx) \
900 cc_status.value1 = XEXP (exp, 0); \
901 cc_status.value2 = XEXP (exp, 1); \
902 cc_status.flags = 0; \
904 else \
906 if (cc_status.value1 \
907 && reg_mentioned_p (XEXP (exp, 0), cc_status.value1)) \
908 cc_status.value1 = 0; \
909 if (cc_status.value2 \
910 && reg_mentioned_p (XEXP (exp, 0), cc_status.value2)) \
911 cc_status.value2 = 0; \
912 switch (GET_CODE (XEXP (exp, 1))) \
914 case PLUS: case MINUS: case MULT: /* case UMULT: */ \
915 case DIV: case UDIV: case NEG: case ASHIFT: \
916 case ASHIFTRT: case AND: case IOR: case XOR: \
917 case ABS: case NOT: \
918 CC_STATUS_SET (XEXP (exp, 0), XEXP (exp, 1)); \
925 #define CC_STATUS_SET(V1, V2) \
927 cc_status.flags = 0; \
928 cc_status.value1 = (V1); \
929 cc_status.value2 = (V2); \
930 if (cc_status.value1 \
931 && reg_mentioned_p (cc_status.value1, cc_status.value2)) \
932 cc_status.value2 = 0; \
935 #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \
936 { if (cc_status.flags & CC_NO_OVERFLOW) return NO_OV; return NORMAL; }
938 /* Control the assembler format that we output. */
940 #define TEXT_SECTION_ASM_OP "* Program text area"
941 #define DATA_SECTION_ASM_OP "* Program data area"
942 #define INIT_SECTION_ASM_OP "* Program initialization area"
943 #define CTOR_LIST_BEGIN /* NO OP */
944 #define CTOR_LIST_END /* NO OP */
946 /* How to refer to registers in assembler output. This sequence is
947 indexed by compiler's hard-register-number (see above). */
949 #define REGISTER_NAMES \
950 { "0", "1", "2", "3", "4", "5", "6", "7", \
951 "8", "9", "10", "11", "12", "13", "14", "15", \
952 "0", "2", "4", "6" \
955 /* How to renumber registers for dbx and gdb. */
957 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
959 #define ASM_FILE_START(FILE) fputs ("\tCSECT\n", FILE);
960 #define ASM_FILE_END(FILE) fputs ("\tEND\n", FILE);
961 #define ASM_IDENTIFY_GCC(FILE)
962 #define ASM_COMMENT_START "*"
963 #define ASM_APP_OFF ""
964 #define ASM_APP_ON ""
966 #define ASM_OUTPUT_LABEL(FILE, NAME) \
967 { assemble_name (FILE, NAME); fputs ("\tEQU\t*\n", FILE); }
969 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) /* NO OP */
971 #define ASM_GLOBALIZE_LABEL(FILE, NAME) \
972 { fputs ("\tENTRY\t", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE); }
974 /* MVS externals are limited to 8 characters, upper case only.
975 The '_' is mapped to '@', except for MVS functions, then '#'. */
977 #define MAX_MVS_LABEL_SIZE 8
979 #define ASM_OUTPUT_LABELREF(FILE, NAME) \
981 char *bp, ch, temp[MAX_MVS_LABEL_SIZE + 1]; \
982 if (strlen (NAME) > MAX_MVS_LABEL_SIZE) \
984 strncpy (temp, NAME, MAX_MVS_LABEL_SIZE); \
985 temp[MAX_MVS_LABEL_SIZE] = '\0'; \
987 else \
988 strcpy (temp,NAME); \
989 if (!strcmp (temp,"main")) \
990 strcpy (temp,"gccmain"); \
991 if (mvs_function_check (temp)) \
992 ch = '#'; \
993 else \
994 ch = '@'; \
995 for (bp = temp; *bp; bp++) \
997 if (islower (*bp)) *bp = toupper (*bp); \
998 if (*bp == '_') *bp = ch; \
1000 fprintf (FILE, "%s", temp); \
1003 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
1004 sprintf (LABEL, "*%s%d", PREFIX, NUM)
1006 /* Generate internal label. Since we can branch here from off page, we
1007 must reload the base register. */
1009 #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
1011 if (!strcmp (PREFIX,"L")) \
1013 mvs_add_label(NUM); \
1014 mvs_label_emitted = 1; \
1016 fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM); \
1019 /* Generate case label. */
1021 #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
1022 fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM)
1024 /* This is how to output an element of a case-vector that is absolute. */
1026 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1027 mvs_check_page (FILE, 4, 0); \
1028 fprintf (FILE, "\tDC\tA(L%d)\n", VALUE)
1030 /* This is how to output an element of a case-vector that is relative. */
1032 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
1033 mvs_check_page (FILE, 4, 0); \
1034 fprintf (FILE, "\tDC\tA(L%d-L%d)\n", VALUE, REL)
1036 /* This is how to output an insn to push a register on the stack.
1037 It need not be very fast code. */
1039 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \
1040 mvs_check_page (FILE, 8, 4); \
1041 fprintf (FILE, "\tS\t13,=F'4'\n\tST\t%s,%d(13)\n", \
1042 reg_names[REGNO], STACK_POINTER_OFFSET)
1044 /* This is how to output an insn to pop a register from the stack.
1045 It need not be very fast code. */
1047 #define ASM_OUTPUT_REG_POP(FILE, REGNO) \
1048 mvs_check_page (FILE, 8, 0); \
1049 fprintf (FILE, "\tL\t%s,%d(13)\n\tLA\t13,4(13)\n", \
1050 reg_names[REGNO], STACK_POINTER_OFFSET)
1052 /* This is how to output an assembler line defining a `double' constant. */
1054 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
1055 fprintf (FILE, "\tDC\tD'%.18G'\n", (VALUE))
1057 /* This is how to output an assembler line defining a `float' constant. */
1059 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
1060 fprintf (FILE, "\tDC\tE'%.9G'\n", (VALUE))
1062 /* This outputs an integer, if not a CONST_INT must be address constant. */
1064 #define ASM_OUTPUT_INT(FILE, EXP) \
1066 if (GET_CODE (EXP) == CONST_INT) \
1068 fprintf (FILE, "\tDC\tF'"); \
1069 output_addr_const (FILE, EXP); \
1070 fprintf (FILE, "'\n"); \
1072 else \
1074 fprintf (FILE, "\tDC\tA("); \
1075 output_addr_const (FILE, EXP); \
1076 fprintf (FILE, ")\n"); \
1080 /* This outputs a short integer. */
1082 #define ASM_OUTPUT_SHORT(FILE, EXP) \
1084 fprintf (FILE, "\tDC\tX'%04X'\n", INTVAL(EXP) & 0xFFFF); \
1087 /* This outputs a byte sized integer. */
1089 #define ASM_OUTPUT_CHAR(FILE, EXP) \
1090 fprintf (FILE, "\tDC\tX'%02X'\n", INTVAL (EXP) )
1092 #define ASM_OUTPUT_BYTE(FILE, VALUE) \
1093 fprintf (FILE, "\tDC\tX'%02X'\n", VALUE)
1095 /* This outputs a text string. The string are chopped up to fit into
1096 an 80 byte record. Also, control and special characters, interpreted
1097 by the IBM assembler, are output numerically. */
1099 #define MVS_ASCII_TEXT_LENGTH 48
1101 #define ASM_OUTPUT_ASCII(FILE, PTR, LEN) \
1103 int i, j; \
1104 int c; \
1105 for (j = 0, i = 0; i < LEN; j++, i++) \
1107 c = PTR[i]; \
1108 if (iscntrl (c) || c == '&') \
1110 if (j % MVS_ASCII_TEXT_LENGTH != 0 ) \
1111 fprintf (FILE, "'\n"); \
1112 j = -1; \
1113 if (c == '&') c = MAP_CHARACTER (c); \
1114 fprintf (FILE, "\tDC\tX'%X'\n", c ); \
1116 else \
1118 if (j % MVS_ASCII_TEXT_LENGTH == 0) \
1119 fprintf (FILE, "\tDC\tC'"); \
1120 if ( c == '\'' ) \
1121 fprintf (FILE, "%c%c", c, c); \
1122 else \
1123 fprintf (FILE, "%c", c); \
1124 if (j % MVS_ASCII_TEXT_LENGTH == MVS_ASCII_TEXT_LENGTH - 1) \
1125 fprintf (FILE, "'\n" ); \
1128 if (j % MVS_ASCII_TEXT_LENGTH != 0) \
1129 fprintf (FILE, "'\n"); \
1132 /* This is how to output an assembler line that says to advance the
1133 location counter to a multiple of 2**LOG bytes. */
1135 #define ASM_OUTPUT_ALIGN(FILE, LOG) \
1136 if (LOG) \
1138 if ((LOG) == 1) \
1139 fprintf (FILE, "\tDS\t0H\n" ); \
1140 else \
1141 fprintf (FILE, "\tDS\t0F\n" ); \
1144 /* The maximum length of memory that the IBM assembler will allow in one
1145 DS operation. */
1147 #define MAX_CHUNK 32767
1149 /* A C statement to output to the stdio stream FILE an assembler
1150 instruction to advance the location counter by SIZE bytes. Those
1151 bytes should be zero when loaded. */
1153 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
1155 int s, k; \
1156 for (s = (SIZE); s > 0; s -= MAX_CHUNK) \
1158 if (s > MAX_CHUNK) \
1159 k = MAX_CHUNK; \
1160 else \
1161 k = s; \
1162 fprintf (FILE, "\tDS\tXL%d\n", k); \
1166 /* A C statement (sans semicolon) to output to the stdio stream
1167 FILE the assembler definition of a common-label named NAME whose
1168 size is SIZE bytes. The variable ROUNDED is the size rounded up
1169 to whatever alignment the caller wants. */
1171 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1173 fputs ("\tENTRY\t", FILE); \
1174 assemble_name (FILE, NAME); \
1175 fputs ("\n", FILE); \
1176 fprintf (FILE, "\tDS\t0F\n"); \
1177 ASM_OUTPUT_LABEL (FILE,NAME); \
1178 ASM_OUTPUT_SKIP (FILE,SIZE); \
1181 /* A C statement (sans semicolon) to output to the stdio stream
1182 FILE the assembler definition of a local-common-label named NAME
1183 whose size is SIZE bytes. The variable ROUNDED is the size
1184 rounded up to whatever alignment the caller wants. */
1186 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1188 fprintf (FILE, "\tDS\t0F\n"); \
1189 ASM_OUTPUT_LABEL (FILE,NAME); \
1190 ASM_OUTPUT_SKIP (FILE,SIZE); \
1193 /* Store in OUTPUT a string (made with alloca) containing an
1194 assembler-name for a local static variable named NAME.
1195 LABELNO is an integer which is different for each call. */
1197 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1199 (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10); \
1200 sprintf ((OUTPUT), "%s%d", (NAME), (LABELNO)); \
1203 /* Define the parentheses used to group arithmetic operations
1204 in assembler code. */
1206 #define ASM_OPEN_PAREN "("
1207 #define ASM_CLOSE_PAREN ")"
1209 /* Define results of standard character escape sequences. */
1211 #define TARGET_BELL 47
1212 #define TARGET_BS 22
1213 #define TARGET_TAB 5
1214 #define TARGET_NEWLINE 21
1215 #define TARGET_VT 11
1216 #define TARGET_FF 12
1217 #define TARGET_CR 13
1219 /* Print operand X (an rtx) in assembler syntax to file FILE.
1220 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1221 For `%' followed by punctuation, CODE is the punctuation and X is null. */
1223 #define PRINT_OPERAND(FILE, X, CODE) \
1225 switch (GET_CODE (X)) \
1227 static char curreg[4]; \
1228 case REG: \
1229 if (CODE == 'N') \
1230 strcpy (curreg, reg_names[REGNO (X) + 1]); \
1231 else \
1232 strcpy (curreg, reg_names[REGNO (X)]); \
1233 fprintf (FILE, "%s", curreg); \
1234 break; \
1235 case MEM: \
1237 rtx addr = XEXP (X, 0); \
1238 if (CODE == 'O') \
1240 if (GET_CODE (addr) == PLUS) \
1241 fprintf (FILE, "%d", INTVAL (XEXP (addr, 1))); \
1242 else \
1243 fprintf (FILE, "0"); \
1245 else if (CODE == 'R') \
1247 if (GET_CODE (addr) == PLUS) \
1248 fprintf (FILE, "%s", reg_names[REGNO (XEXP (addr, 0))]);\
1249 else \
1250 fprintf (FILE, "%s", reg_names[REGNO (addr)]); \
1252 else \
1253 output_address (XEXP (X, 0)); \
1255 break; \
1256 case SYMBOL_REF: \
1257 case LABEL_REF: \
1258 mvs_page_lit += 4; \
1259 if (SYMBOL_REF_FLAG (X)) fprintf (FILE, "=V("); \
1260 else fprintf (FILE, "=A("); \
1261 output_addr_const (FILE, X); \
1262 fprintf (FILE, ")"); \
1263 break; \
1264 case CONST_INT: \
1265 if (CODE == 'B') \
1266 fprintf (FILE, "%d", INTVAL (X) & 0xff); \
1267 else if (CODE == 'X') \
1268 fprintf (FILE, "%02X", INTVAL (X) & 0xff); \
1269 else if (CODE == 'h') \
1270 fprintf (FILE, "%d", (INTVAL (X) << 16) >> 16); \
1271 else if (CODE == 'H') \
1273 mvs_page_lit += 2; \
1274 fprintf (FILE, "=H'%d'", (INTVAL (X) << 16) >> 16); \
1276 else \
1278 mvs_page_lit += 4; \
1279 fprintf (FILE, "=F'%d'", INTVAL (X)); \
1281 break; \
1282 case CONST_DOUBLE: \
1283 if (GET_MODE (X) == DImode) \
1285 if (CODE == 'M') \
1287 mvs_page_lit += 4; \
1288 fprintf (FILE, "=XL4'%08X'", CONST_DOUBLE_LOW (X)); \
1290 else if (CODE == 'L') \
1292 mvs_page_lit += 4; \
1293 fprintf (FILE, "=XL4'%08X'", CONST_DOUBLE_HIGH (X)); \
1295 else \
1297 mvs_page_lit += 8; \
1298 fprintf (FILE, "=XL8'%08X%08X'", CONST_DOUBLE_LOW (X), \
1299 CONST_DOUBLE_HIGH (X)); \
1302 else \
1304 union { double d; int i[2]; } u; \
1305 u.i[0] = CONST_DOUBLE_LOW (X); \
1306 u.i[1] = CONST_DOUBLE_HIGH (X); \
1307 if (GET_MODE (X) == SFmode) \
1309 mvs_page_lit += 4; \
1310 fprintf (FILE, "=E'%.9G'", u.d); \
1312 else \
1314 mvs_page_lit += 8; \
1315 fprintf (FILE, "=D'%.18G'", u.d); \
1318 break; \
1319 case CONST: \
1320 if (GET_CODE (XEXP (X, 0)) == PLUS \
1321 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
1323 mvs_page_lit += 4; \
1324 if (SYMBOL_REF_FLAG (XEXP (XEXP (X, 0), 0))) \
1326 fprintf (FILE, "=V("); \
1327 ASM_OUTPUT_LABELREF (FILE, \
1328 XSTR (XEXP (XEXP (X, 0), 0), 0)); \
1329 fprintf (FILE, ")\n\tA\t%s,=F'%d'", curreg, \
1330 INTVAL (XEXP (XEXP (X, 0), 1))); \
1332 else \
1334 fprintf (FILE, "=A("); \
1335 output_addr_const (FILE, X); \
1336 fprintf (FILE, ")"); \
1339 else \
1341 mvs_page_lit += 4; \
1342 fprintf (FILE, "=F'"); \
1343 output_addr_const (FILE, X); \
1344 fprintf (FILE, "'"); \
1346 break; \
1347 default: \
1348 abort(); \
1352 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1354 rtx breg, xreg, offset, plus; \
1356 switch (GET_CODE (ADDR)) \
1358 case REG: \
1359 fprintf (FILE, "0(%s)", reg_names[REGNO (ADDR)]); \
1360 break; \
1361 case PLUS: \
1362 breg = 0; \
1363 xreg = 0; \
1364 offset = 0; \
1365 if (GET_CODE (XEXP (ADDR, 0)) == PLUS) \
1367 if (GET_CODE (XEXP (ADDR, 1)) == REG) \
1368 breg = XEXP (ADDR, 1); \
1369 else \
1370 offset = XEXP (ADDR, 1); \
1371 plus = XEXP (ADDR, 0); \
1373 else \
1375 if (GET_CODE (XEXP (ADDR, 0)) == REG) \
1376 breg = XEXP (ADDR, 0); \
1377 else \
1378 offset = XEXP (ADDR, 0); \
1379 plus = XEXP (ADDR, 1); \
1381 if (GET_CODE (plus) == PLUS) \
1383 if (GET_CODE (XEXP (plus, 0)) == REG) \
1385 if (breg) \
1386 xreg = XEXP (plus, 0); \
1387 else \
1388 breg = XEXP (plus, 0); \
1390 else \
1392 offset = XEXP (plus, 0); \
1394 if (GET_CODE (XEXP (plus, 1)) == REG) \
1396 if (breg) \
1397 xreg = XEXP (plus, 1); \
1398 else \
1399 breg = XEXP (plus, 1); \
1401 else \
1403 offset = XEXP (plus, 1); \
1406 else if (GET_CODE (plus) == REG) \
1408 if (breg) \
1409 xreg = plus; \
1410 else \
1411 breg = plus; \
1413 else \
1415 offset = plus; \
1417 if (offset) \
1419 if (GET_CODE (offset) == LABEL_REF) \
1420 fprintf (FILE, "L%d", \
1421 CODE_LABEL_NUMBER (XEXP (offset, 0))); \
1422 else \
1423 output_addr_const (FILE, offset); \
1425 else \
1426 fprintf (FILE, "0"); \
1427 if (xreg) \
1428 fprintf (FILE, "(%s,%s)", \
1429 reg_names[REGNO (xreg)], reg_names[REGNO (breg)]); \
1430 else \
1431 fprintf (FILE, "(%s)", reg_names[REGNO (breg)]); \
1432 break; \
1433 default: \
1434 mvs_page_lit += 4; \
1435 if (SYMBOL_REF_FLAG (ADDR)) fprintf (FILE, "=V("); \
1436 else fprintf (FILE, "=A("); \
1437 output_addr_const (FILE, ADDR); \
1438 fprintf (FILE, ")"); \
1439 break; \