1 /* Definitions of target machine for GNU compiler. System/370 version.
2 Copyright (C) 1989, 1993, 1995, 1996, 1997, 1998, 1999, 2000
3 Free Software Foundation, Inc.
4 Contributed by Jan Stein (jan@cd.chalmers.se).
5 Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
6 Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org)
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, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
27 /* Run-time compilation parameters selecting different hardware subsets. */
29 extern int target_flags
;
31 /* The sizes of the code and literals on the current page. */
33 extern int mvs_page_code
, mvs_page_lit
;
35 /* The current page number and the base page number for the function. */
37 extern int mvs_page_num
, function_base_page
;
39 /* The name of the current function. */
41 extern char *mvs_function_name
;
43 /* The length of the function name malloc'd area. */
45 extern int mvs_function_name_length
;
47 /* Compile using char instructions (mvc, nc, oc, xc). On 4341 use this since
48 these are more than twice as fast as load-op-store.
49 On 3090 don't use this since load-op-store is much faster. */
51 #define TARGET_CHAR_INSTRUCTIONS (target_flags & 1)
53 /* Default target switches */
55 #define TARGET_DEFAULT 1
57 /* Macro to define tables used to set the flags. This is a list in braces
58 of pairs in braces, each pair being { "NAME", VALUE }
59 where VALUE is the bits to set or minus the bits to clear.
60 An empty string NAME is used to identify the default VALUE. */
62 #define TARGET_SWITCHES \
63 { { "char-instructions", 1, "Generate char instructions"}, \
64 { "no-char-instructions", -1, "Do not generate char instructions"}, \
65 { "", TARGET_DEFAULT, 0} }
67 /* To use IBM supplied macro function prologue and epilogue, define the
68 following to 1. Should only be needed if IBM changes the definition
69 of their prologue and epilogue. */
71 #define MACROPROLOGUE 0
72 #define MACROEPILOGUE 0
74 /* Target machine storage layout */
76 /* Define this if most significant bit is lowest numbered in instructions
77 that operate on numbered bit-fields. */
79 #define BITS_BIG_ENDIAN 1
81 /* Define this if most significant byte of a word is the lowest numbered. */
83 #define BYTES_BIG_ENDIAN 1
85 /* Define this if MS word of a multiword is the lowest numbered. */
87 #define WORDS_BIG_ENDIAN 1
89 /* Number of bits in an addressable storage unit. */
91 #define BITS_PER_UNIT 8
93 /* Width in bits of a "word", which is the contents of a machine register. */
95 #define BITS_PER_WORD 32
97 /* Width of a word, in units (bytes). */
99 #define UNITS_PER_WORD 4
101 /* Width in bits of a pointer. See also the macro `Pmode' defined below. */
103 #define POINTER_SIZE 32
105 /* Allocation boundary (in *bits*) for storing pointers in memory. */
107 #define POINTER_BOUNDARY 32
109 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
111 #define PARM_BOUNDARY 32
113 /* Boundary (in *bits*) on which stack pointer should be aligned. */
115 #define STACK_BOUNDARY 32
117 /* Allocation boundary (in *bits*) for the code of a function. */
119 #define FUNCTION_BOUNDARY 32
121 /* There is no point aligning anything to a rounder boundary than this. */
123 #define BIGGEST_ALIGNMENT 64
125 /* Alignment of field after `int : 0' in a structure. */
127 #define EMPTY_FIELD_BOUNDARY 32
129 /* Define this if move instructions will actually fail to work when given
132 #define STRICT_ALIGNMENT 0
134 /* Define target floating point format. */
136 #define TARGET_FLOAT_FORMAT IBM_FLOAT_FORMAT
138 /* Define character mapping for cross-compiling. */
139 /* but only define it if really needed, since otherwise it will break builds */
143 #define MAP_CHARACTER(c) ((char)(c))
145 #define MAP_CHARACTER(c) ((char)mvs_map_char (c))
150 /* Define this macro if you want to implement any pragmas. If defined, it
151 is a C expression to be executed when #pragma is seen. The
152 argument FILE is the stdio input stream from which the source
153 text can be read. CH is the first character after the #pragma. The
154 result of the expression is the terminating character found
156 #define HANDLE_PRAGMA(GETC, UNGETC, NAME) \
157 handle_pragma ((GETC), (UNGETC), (NAME))
158 #endif /* TARGET_HLASM */
160 /* Define maximum length of page minus page escape overhead. */
162 #define MAX_MVS_PAGE_LENGTH 4080
164 /* Define special register allocation order desired.
165 Don't fiddle with this. I did, and I got all sorts of register
166 spill errors when compiling even relatively simple programs...
167 I have no clue why ...
168 E.g. this one is bad:
169 { 0, 1, 2, 9, 8, 7, 6, 5, 10, 15, 14, 12, 3, 4, 16, 17, 18, 19, 11, 13 }
172 #define REG_ALLOC_ORDER \
173 { 0, 1, 2, 3, 14, 15, 12, 10, 9, 8, 7, 6, 5, 4, 16, 17, 18, 19, 11, 13 }
175 /* Standard register usage. */
177 /* Number of actual hardware registers. The hardware registers are
178 assigned numbers for the compiler from 0 to just below
179 FIRST_PSEUDO_REGISTER.
180 All registers that the compiler knows about must be given numbers,
181 even those that are not normally considered general registers.
182 For the 370, we give the data registers numbers 0-15,
183 and the floating point registers numbers 16-19. */
185 #define FIRST_PSEUDO_REGISTER 20
187 /* Define base and page registers. */
189 #define BASE_REGISTER 3
190 #define PAGE_REGISTER 4
193 /* 1 for registers that have pervasive standard uses and are not available
194 for the register allocator. These are registers that must have fixed,
195 valid values stored in them for the entire length of the subroutine call,
196 and must not in any way be moved around, jiggered with, etc. That is,
197 they must never be clobbered, and, if clobbered, the register allocator
198 will never restore them back.
200 We use five registers in this special way:
201 -- R3 which is used as the base register
202 -- R4 the page origin table pointer used to load R3,
203 -- R11 the arg pointer.
204 -- R12 the TCA pointer
205 -- R13 the stack (DSA) pointer
207 A fifth register is also exceptional: R14 is used in many branch
208 instructions to hold the target of the branch. Technically, this
209 does not qualify R14 as a register with a long-term meaning; it should
210 be enough, theoretically, to note that these instructions clobber
211 R14, and let the compiler deal with that. In practice, however,
212 the "clobber" directive acts as a barrier to optimization, and the
213 optimizer appears to be unable to perform optimizations around branches.
214 Thus, a much better strategy appears to give R14 a pervasive use;
215 this eliminates it from the register pool witout hurting optimization.
217 There are other registers which have special meanings, but its OK
218 for them to get clobbered, since other allocator config below will
219 make sure that they always have the right value. These are for
221 -- R1 the returned structure pointer.
222 -- R10 the static chain reg.
223 -- R15 holds the value a subroutine returns.
225 Notice that it is *almost* safe to mark R11 as available to the allocator.
226 By marking it as a call_used_register, in most cases, the compiler
227 can handle it being clobbered. However, there are a few rare
228 circumstances where the register allocator will allocate r11 and
229 also try to use it as the arg pointer ... thus it must be marked fixed.
230 I think this is a bug, but I can't track it down...
233 #define FIXED_REGISTERS \
234 { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0 }
235 /*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19*/
237 /* 1 for registers not available across function calls. These must include
238 the FIXED_REGISTERS and also any registers that can be used without being
240 The latter must include the registers where values are returned
241 and the register where structure-value addresses are passed.
242 NOTE: all floating registers are undefined across calls.
245 #define CALL_USED_REGISTERS \
246 { 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
247 /*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19*/
249 /* Return number of consecutive hard regs needed starting at reg REGNO
250 to hold something of mode MODE.
251 This is ordinarily the length in words of a value of mode MODE
252 but can be less for certain modes in special long registers.
253 Note that DCmode (complex double) needs two regs.
255 #endif /* TARGET_HLASM */
257 /* ================= */
258 #ifdef TARGET_ELF_ABI
259 /* The Linux/ELF ABI uses the same register layout as the
260 * the MVS/OE version, with the following exceptions:
261 * -- r12 (rtca) is not used.
264 #define FIXED_REGISTERS \
265 { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0 }
266 /*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19*/
268 #define CALL_USED_REGISTERS \
269 { 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 }
270 /*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19*/
272 #endif /* TARGET_ELF_ABI */
273 /* ================= */
276 #define HARD_REGNO_NREGS(REGNO, MODE) \
278 ((GET_MODE_SIZE (MODE) + 2*UNITS_PER_WORD - 1) / (2*UNITS_PER_WORD)) : \
279 (GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD)
281 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
282 On the 370, the cpu registers can hold QI, HI, SI, SF and DF. The
283 even registers can hold DI. The floating point registers can hold
284 either SF, DF, SC or DC. */
286 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
287 ((REGNO) < 16 ? (((REGNO) & 1) == 0 || \
288 (((MODE) != DImode) && ((MODE) != DFmode))) \
289 : ((MODE) == SFmode || (MODE) == DFmode) || \
290 (MODE) == SCmode || (MODE) == DCmode)
292 /* Value is 1 if it is a good idea to tie two pseudo registers when one has
293 mode MODE1 and one has mode MODE2.
294 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
295 for any hard reg, then this must be 0 for correct output. */
297 #define MODES_TIEABLE_P(MODE1, MODE2) \
298 (((MODE1) == SFmode || (MODE1) == DFmode) \
299 == ((MODE2) == SFmode || (MODE2) == DFmode))
301 /* Mark external references. */
303 #define ENCODE_SECTION_INFO(decl) \
304 if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)) \
305 SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
307 /* Specify the registers used for certain standard purposes.
308 The values of these macros are register numbers. */
310 /* 370 PC isn't overloaded on a register. */
312 /* #define PC_REGNUM */
314 /* Register to use for pushing function arguments. */
316 #define STACK_POINTER_REGNUM 13
318 /* Base register for access to local variables of the function. */
320 #define FRAME_POINTER_REGNUM 13
322 /* Value should be nonzero if functions must have frame pointers.
323 Zero means the frame pointer need not be set up (and parms may be
324 accessed via the stack pointer) in functions that seem suitable.
325 This is computed in `reload', in reload1.c. */
327 #define FRAME_POINTER_REQUIRED 1
329 /* Base register for access to arguments of the function. */
331 #define ARG_POINTER_REGNUM 11
333 /* R10 is register in which static-chain is passed to a function.
334 Static-chaining is done when a nested function references as a global
335 a stack variable of its parent: e.g.
336 int parent_func (int arg) {
337 int x; // x is in parents stack
338 void child_func (void) { x++: } // child references x as global var
343 #define STATIC_CHAIN_REGNUM 10
345 /* R1 is register in which address to store a structure value is passed to
346 a function. This is used only when returning 64-bit long-long in a 32-bit arch
347 and when calling functions that return structs by value. e.g.
348 typedef struct A_s { int a,b,c; } A_t;
349 A_t fun_returns_value (void) {
350 A_t a; a.a=1; a.b=2 a.c=3;
353 In the above, the storage for the return value is in the callers stack, and
354 the R1 points at that mem location.
357 #define STRUCT_VALUE_REGNUM 1
359 /* Define the classes of registers for register constraints in the
360 machine description. Also define ranges of constants.
362 One of the classes must always be named ALL_REGS and include all hard regs.
363 If there is more than one class, another class must be named NO_REGS
364 and contain no registers.
366 The name GENERAL_REGS must be the name of a class (or an alias for
367 another name such as ALL_REGS). This is the class of registers
368 that is allowed by "g" or "r" in a register constraint.
369 Also, registers outside this class are allocated only when
370 instructions express preferences for them.
372 The classes must be numbered in nondecreasing order; that is,
373 a larger-numbered class must never be contained completely
374 in a smaller-numbered class.
376 For any two classes, it is very desirable that there be another
377 class that represents their union. */
381 NO_REGS
, ADDR_REGS
, DATA_REGS
,
382 FP_REGS
, ALL_REGS
, LIM_REG_CLASSES
385 #define GENERAL_REGS DATA_REGS
386 #define N_REG_CLASSES (int) LIM_REG_CLASSES
388 /* Give names of register classes as strings for dump file. */
390 #define REG_CLASS_NAMES \
391 { "NO_REGS", "ADDR_REGS", "DATA_REGS", "FP_REGS", "ALL_REGS" }
393 /* Define which registers fit in which classes. This is an initializer for
394 a vector of HARD_REG_SET of length N_REG_CLASSES. */
396 #define REG_CLASS_CONTENTS {{0}, {0x0fffe}, {0x0ffff}, {0xf0000}, {0xfffff}}
398 /* The same information, inverted:
399 Return the class number of the smallest class containing
400 reg number REGNO. This could be a conditional expression
401 or could index an array. */
403 #define REGNO_REG_CLASS(REGNO) \
404 ((REGNO) >= 16 ? FP_REGS : (REGNO) != 0 ? ADDR_REGS : DATA_REGS)
406 /* The class value for index registers, and the one for base regs. */
408 #define INDEX_REG_CLASS ADDR_REGS
409 #define BASE_REG_CLASS ADDR_REGS
411 /* Get reg_class from a letter such as appears in the machine description. */
413 #define REG_CLASS_FROM_LETTER(C) \
414 ((C) == 'a' ? ADDR_REGS : \
415 ((C) == 'd' ? DATA_REGS : \
416 ((C) == 'f' ? FP_REGS : NO_REGS)))
418 /* The letters I, J, K, L and M in a register constraint string can be used
419 to stand for particular ranges of immediate operands.
420 This macro defines what the ranges are.
421 C is the letter, and VALUE is a constant value.
422 Return 1 if VALUE is in the range specified by C. */
424 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
425 ((C) == 'I' ? (unsigned) (VALUE) < 256 : \
426 (C) == 'J' ? (unsigned) (VALUE) < 4096 : \
427 (C) == 'K' ? (VALUE) >= -32768 && (VALUE) < 32768 : 0)
429 /* Similar, but for floating constants, and defining letters G and H.
430 Here VALUE is the CONST_DOUBLE rtx itself. */
432 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
434 /* see recog.c for details */
435 #define EXTRA_CONSTRAINT(OP,C) \
436 ((C) == 'R' ? r_or_s_operand (OP, GET_MODE(OP)) : \
437 (C) == 'S' ? s_operand (OP, GET_MODE(OP)) : 0) \
439 /* Given an rtx X being reloaded into a reg required to be in class CLASS,
440 return the class of reg to actually use. In general this is just CLASS;
441 but on some machines in some cases it is preferable to use a more
444 XXX We reload CONST_INT's into ADDR not DATA regs because on certain
445 rare occasions when lots of egisters are spilled, reload() will try
446 to put a const int into r0 and then use r0 as an index register.
449 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
450 (GET_CODE(X) == CONST_DOUBLE ? FP_REGS : \
451 GET_CODE(X) == CONST_INT ? (reload_in_progress ? ADDR_REGS : DATA_REGS) : \
452 GET_CODE(X) == LABEL_REF || \
453 GET_CODE(X) == SYMBOL_REF || \
454 GET_CODE(X) == CONST ? ADDR_REGS : (CLASS))
456 /* Return the maximum number of consecutive registers needed to represent
457 mode MODE in a register of class CLASS.
458 Note that DCmode (complex double) needs two regs.
461 #define CLASS_MAX_NREGS(CLASS, MODE) \
462 ((CLASS) == FP_REGS ? \
463 ((GET_MODE_SIZE (MODE) + 2*UNITS_PER_WORD - 1) / (2*UNITS_PER_WORD)) : \
464 (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
466 /* Stack layout; function entry, exit and calling. */
468 /* Define this if pushing a word on the stack makes the stack pointer a
470 /* ------------------------------------------------------------------- */
472 /* ================= */
474 /* #define STACK_GROWS_DOWNWARD */
476 /* Define this if the nominal address of the stack frame is at the
477 high-address end of the local variables; that is, each additional local
478 variable allocated goes at a more negative offset in the frame. */
480 /* #define FRAME_GROWS_DOWNWARD */
482 /* Offset within stack frame to start allocating local variables at.
483 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
484 first local allocated. Otherwise, it is the offset to the BEGINNING
485 of the first local allocated. */
487 #define STARTING_FRAME_OFFSET \
488 (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
490 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = STARTING_FRAME_OFFSET
492 /* If we generate an insn to push BYTES bytes, this says how many the stack
493 pointer really advances by. On the 370, we have no push instruction. */
495 #endif /* TARGET_HLASM */
497 /* ================= */
498 #ifdef TARGET_ELF_ABI
500 /* With ELF/Linux, stack is placed at large virtual addrs and grows down.
501 But we want the compiler to generate posistive displacements from the
502 stack pointer, and so we make the frame lie above the stack. */
504 #define STACK_GROWS_DOWNWARD
505 /* #define FRAME_GROWS_DOWNWARD */
507 /* Offset within stack frame to start allocating local variables at.
508 This is the offset to the BEGINNING of the first local allocated. */
510 #define STARTING_FRAME_OFFSET \
511 (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
513 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = STARTING_FRAME_OFFSET
515 #endif /* TARGET_ELF_ABI */
516 /* ================= */
518 /* #define PUSH_ROUNDING(BYTES) */
520 /* Accumulate the outgoing argument count so we can request the right
521 DSA size and determine stack offset. */
523 #define ACCUMULATE_OUTGOING_ARGS
525 /* Define offset from stack pointer, to location where a parm can be
528 #define STACK_POINTER_OFFSET 148
530 /* Offset of first parameter from the argument pointer register value. */
532 #define FIRST_PARM_OFFSET(FNDECL) 0
534 /* 1 if N is a possible register number for function argument passing.
535 On the 370, no registers are used in this way. */
537 #define FUNCTION_ARG_REGNO_P(N) 0
539 /* Define a data type for recording info about an argument list during
540 the scan of that argument list. This data type should hold all
541 necessary information about the function itself and about the args
542 processed so far, enough to enable macros such as FUNCTION_ARG to
543 determine where the next arg should go. */
545 #define CUMULATIVE_ARGS int
547 /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to
548 a function whose data type is FNTYPE.
549 For a library call, FNTYPE is 0. */
551 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) ((CUM) = 0)
553 /* Update the data in CUM to advance over an argument of mode MODE and
554 data type TYPE. (TYPE is null for libcalls where that information
555 may not be available.) */
557 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
558 ((CUM) += ((MODE) == DFmode || (MODE) == SFmode \
560 : (MODE) != BLKmode \
561 ? (GET_MODE_SIZE (MODE) + 3) / 4 \
562 : (int_size_in_bytes (TYPE) + 3) / 4))
564 /* Define where to put the arguments to a function. Value is zero to push
565 the argument on the stack, or a hard register in which to store the
568 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
570 /* For an arg passed partly in registers and partly in memory, this is the
571 number of registers used. For args passed entirely in registers or
572 entirely in memory, zero. */
574 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
576 /* Define if returning from a function call automatically pops the
577 arguments described by the number-of-args field in the call. */
579 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
581 /* The FUNCTION_VALUE macro defines how to find the value returned by a
582 function. VALTYPE is the data type of the value (as a tree).
583 If the precise function being called is known, FUNC is its FUNCTION_DECL;
584 otherwise, FUNC is NULL.
586 On the 370 the return value is in R15 or R16. However,
587 DImode (64-bit ints) scalars need to get returned on the stack,
588 with r15 pointing to the location. To accomplish this, we define
589 the RETURN_IN_MEMORY macro to be true for both blockmode (structures)
590 and the DImode scalars.
593 #define RET_REG(MODE) \
594 (((MODE) == DCmode || (MODE) == SCmode || (MODE) == TFmode || (MODE) == DFmode || (MODE) == SFmode) ? 16 : 15)
596 #define FUNCTION_VALUE(VALTYPE, FUNC) \
597 gen_rtx_REG (TYPE_MODE (VALTYPE), RET_REG (TYPE_MODE (VALTYPE)))
599 #define RETURN_IN_MEMORY(VALTYPE) \
600 ((DImode == TYPE_MODE (VALTYPE)) || (BLKmode == TYPE_MODE (VALTYPE)))
602 /* Define how to find the value returned by a library function assuming
603 the value has mode MODE. */
605 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RET_REG (MODE))
607 /* 1 if N is a possible register number for a function value.
608 On the 370 under C/370, R15 and R16 are thus used. */
610 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 15 || (N) == 16)
612 /* This macro definition sets up a default value for `main' to return. */
614 #define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
617 /* Output assembler code for a block containing the constant parts of a
618 trampoline, leaving space for the variable parts.
620 On the 370, the trampoline contains these instructions:
624 L STATIC_CHAIN_REGISTER,X
630 I am confused as to why this emitting raw binary, instead of instructions ...
631 see for example, rs6000/rs000.c for an example of a different way to
632 do this ... especially since BASR should probably be substituted for BALR.
635 #define TRAMPOLINE_TEMPLATE(FILE) \
637 ASM_OUTPUT_SHORT (FILE, GEN_INT (0x05E0)); \
638 ASM_OUTPUT_SHORT (FILE, GEN_INT (0x5800 | STATIC_CHAIN_REGNUM << 4)); \
639 ASM_OUTPUT_SHORT (FILE, GEN_INT (0xE00A)); \
640 ASM_OUTPUT_SHORT (FILE, GEN_INT (0x58F0)); \
641 ASM_OUTPUT_SHORT (FILE, GEN_INT (0xE00E)); \
642 ASM_OUTPUT_SHORT (FILE, GEN_INT (0x07FF)); \
643 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
644 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
645 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
646 ASM_OUTPUT_SHORT (FILE, const0_rtx); \
649 /* Length in units of the trampoline for entering a nested function. */
651 #define TRAMPOLINE_SIZE 20
653 /* Emit RTL insns to initialize the variable parts of a trampoline. */
655 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
657 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), CXT); \
658 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 16)), FNADDR); \
661 /* Define EXIT_IGNORE_STACK if, when returning from a function, the stack
662 pointer does not matter (provided there is a frame pointer). */
664 #define EXIT_IGNORE_STACK 1
666 /* Addressing modes, and classification of registers for them. */
668 /* #define HAVE_POST_INCREMENT */
669 /* #define HAVE_POST_DECREMENT */
671 /* #define HAVE_PRE_DECREMENT */
672 /* #define HAVE_PRE_INCREMENT */
674 /* These assume that REGNO is a hard or pseudo reg number. They give
675 nonzero only if REGNO is a hard reg of the suitable class or a pseudo
676 reg currently allocated to a suitable hard reg.
677 These definitions are NOT overridden anywhere. */
679 #define REGNO_OK_FOR_INDEX_P(REGNO) \
680 (((REGNO) > 0 && (REGNO) < 16) \
681 || (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16))
683 #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P(REGNO)
685 #define REGNO_OK_FOR_DATA_P(REGNO) \
686 ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)
688 #define REGNO_OK_FOR_FP_P(REGNO) \
689 ((unsigned) ((REGNO) - 16) < 4 || (unsigned) (reg_renumber[REGNO] - 16) < 4)
691 /* Now macros that check whether X is a register and also,
692 strictly, whether it is in a specified class. */
694 /* 1 if X is a data register. */
696 #define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))
698 /* 1 if X is an fp register. */
700 #define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))
702 /* 1 if X is an address register. */
704 #define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))
706 /* Maximum number of registers that can appear in a valid memory address. */
708 #define MAX_REGS_PER_ADDRESS 2
710 /* Recognize any constant value that is a valid address. */
712 #define CONSTANT_ADDRESS_P(X) \
713 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
714 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
715 || (GET_CODE (X) == CONST \
716 && GET_CODE (XEXP (XEXP (X, 0), 0)) == LABEL_REF) \
717 || (GET_CODE (X) == CONST \
718 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \
719 && !SYMBOL_REF_FLAG (XEXP (XEXP (X, 0), 0))))
721 /* Nonzero if the constant value X is a legitimate general operand.
722 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
724 #define LEGITIMATE_CONSTANT_P(X) 1
726 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check
727 its validity for a certain class. We have two alternate definitions
728 for each of them. The usual definition accepts all pseudo regs; the
729 other rejects them all. The symbol REG_OK_STRICT causes the latter
730 definition to be used.
732 Most source files want to accept pseudo regs in the hope that they will
733 get allocated to the class that the insn wants them to be in.
734 Some source files that are used after register allocation
735 need to be strict. */
737 #ifndef REG_OK_STRICT
739 /* Nonzero if X is a hard reg that can be used as an index or if it is
742 #define REG_OK_FOR_INDEX_P(X) \
743 ((REGNO(X) > 0 && REGNO(X) < 16) || REGNO(X) >= 20)
745 /* Nonzero if X is a hard reg that can be used as a base reg or if it is
748 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_INDEX_P(X)
750 #else /* REG_OK_STRICT */
752 /* Nonzero if X is a hard reg that can be used as an index. */
754 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P(REGNO(X))
756 /* Nonzero if X is a hard reg that can be used as a base reg. */
758 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P(REGNO(X))
760 #endif /* REG_OK_STRICT */
762 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
763 valid memory address for an instruction.
764 The MODE argument is the machine mode for the MEM expression
765 that wants to use this address.
767 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
768 except for CONSTANT_ADDRESS_P which is actually machine-independent.
771 #define COUNT_REGS(X, REGS, FAIL) \
773 if (REG_OK_FOR_BASE_P (X)) REGS += 1; \
776 else if (GET_CODE (X) != CONST_INT || (unsigned) INTVAL (X) >= 4096) \
779 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
781 if (REG_P (X) && REG_OK_FOR_BASE_P (X)) \
783 if (GET_CODE (X) == PLUS) \
786 rtx x0 = XEXP (X, 0); \
787 rtx x1 = XEXP (X, 1); \
788 if (GET_CODE (x0) == PLUS) \
790 COUNT_REGS (XEXP (x0, 0), regs, FAIL); \
791 COUNT_REGS (XEXP (x0, 1), regs, FAIL); \
792 COUNT_REGS (x1, regs, FAIL); \
796 else if (GET_CODE (x1) == PLUS) \
798 COUNT_REGS (x0, regs, FAIL); \
799 COUNT_REGS (XEXP (x1, 0), regs, FAIL); \
800 COUNT_REGS (XEXP (x1, 1), regs, FAIL); \
806 COUNT_REGS (x0, regs, FAIL); \
807 COUNT_REGS (x1, regs, FAIL); \
815 /* The 370 has no mode dependent addresses. */
817 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
819 /* Macro: LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
820 Try machine-dependent ways of modifying an illegitimate address
821 to be legitimate. If we find one, return the new, valid address.
822 This macro is used in only one place: `memory_address' in explow.c.
825 (1) It's not obvious that this macro results in better code
826 than its omission does. For historical reasons we leave it in.
828 (2) This macro may be (???) implicated in the accidental promotion
829 or RS operand to RX operands, which bombs out any RS, SI, SS
830 instruction that was expecting a simple address. Note that
831 this occurs fairly rarely ...
833 (3) There is a bug somewhere that causes either r4 to be spilled,
834 or causes r0 to be used as a base register. Changeing the macro
835 below will make the bug move around, but will not make it go away
836 ... Note that this is a rare bug ...
840 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
842 if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
843 (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \
844 copy_to_mode_reg (SImode, XEXP (X, 1))); \
845 if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \
846 (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \
847 copy_to_mode_reg (SImode, XEXP (X, 0))); \
848 if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \
849 (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \
850 force_operand (XEXP (X, 0), 0)); \
851 if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \
852 (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \
853 force_operand (XEXP (X, 1), 0)); \
854 if (memory_address_p (MODE, X)) \
858 /* Specify the machine mode that this machine uses for the index in the
859 tablejump instruction. */
861 #define CASE_VECTOR_MODE SImode
863 /* Define this if the tablejump instruction expects the table to contain
864 offsets from the address of the table.
865 Do not define this if the table should contain absolute addresses. */
867 /* #define CASE_VECTOR_PC_RELATIVE */
869 /* Specify the tree operation to be used to convert reals to integers. */
871 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
873 /* Define this if fixuns_trunc is the same as fix_trunc. */
875 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
877 /* We use "unsigned char" as default. */
879 #define DEFAULT_SIGNED_CHAR 0
881 /* This is the kind of divide that is easiest to do in the general case. */
883 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
885 /* Max number of bytes we can move from memory to memory in one reasonably
890 /* Define this if zero-extension is slow (more than one real instruction). */
892 #define SLOW_ZERO_EXTEND 1
894 /* Nonzero if access to memory by bytes is slow and undesirable. */
896 #define SLOW_BYTE_ACCESS 1
898 /* Define if shifts truncate the shift count which implies one can omit
899 a sign-extension or zero-extension of a shift count. */
901 /* #define SHIFT_COUNT_TRUNCATED */
903 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
904 is done just by pretending it is already truncated. */
906 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) (OUTPREC != 16)
908 /* We assume that the store-condition-codes instructions store 0 for false
909 and some other value for true. This is the value stored for true. */
911 /* #define STORE_FLAG_VALUE -1 */
913 /* When a prototype says `char' or `short', really pass an `int'. */
915 #define PROMOTE_PROTOTYPES 1
917 /* Don't perform CSE on function addresses. */
919 #define NO_FUNCTION_CSE
921 /* Specify the machine mode that pointers have.
922 After generation of rtl, the compiler makes no further distinction
923 between pointers and any other objects of this machine mode. */
927 /* A function address in a call instruction is a byte address (for
928 indexing purposes) so give the MEM rtx a byte's mode. */
930 #define FUNCTION_MODE QImode
932 /* Compute the cost of computing a constant rtl expression RTX whose
933 rtx-code is CODE. The body of this macro is a portion of a switch
934 statement. If the code is computed here, return it with a return
935 statement. Otherwise, break from the switch. */
937 #define CONST_COSTS(RTX, CODE, OUTERCODE) \
939 if ((unsigned) INTVAL (RTX) < 0xfff) return 1; \
947 /* A C statement (sans semicolon) to update the integer variable COST
948 based on the relationship between INSN that is dependent on
949 DEP_INSN through the dependence LINK. The default is to make no
950 adjustment to COST. This can be used for example to specify to
951 the scheduler that an output- or anti-dependence does not incur
952 the same cost as a data-dependence.
954 We will want to use this to indicate that there is a cost associated
955 with the loading, followed by use of base registers ...
956 #define ADJUST_COST (INSN, LINK, DEP_INSN, COST)
959 /* Tell final.c how to eliminate redundant test instructions. */
961 /* Here we define machine-dependent flags and fields in cc_status
962 (see `conditions.h'). */
964 /* Store in cc_status the expressions that the condition codes will
965 describe after execution of an instruction whose pattern is EXP.
966 Do not alter them if the instruction would not alter the cc's.
968 On the 370, load insns do not alter the cc's. However, in some
969 cases these instructions can make it possibly invalid to use the
970 saved cc's. In those cases we clear out some or all of the saved
971 cc's so they won't be used.
973 Note that only some arith instructions set the CC. These include
974 add, subtract, complement, various shifts. Note that multiply
975 and divide do *not* set set the CC. Therefore, in the code below,
976 don't set the status for MUL, DIV, etc.
978 Note that the bitwise ops set the condition code, but not in a
979 way that we can make use of it. So we treat these as clobbering,
980 rather than setting the CC. These are clobbered in the individual
981 instruction patterns that use them. Use CC_STATUS_INIT to clobber.
984 #define NOTICE_UPDATE_CC(EXP, INSN) \
987 if (GET_CODE (exp) == PARALLEL) /* Check this */ \
988 exp = XVECEXP (exp, 0, 0); \
989 if (GET_CODE (exp) != SET) \
993 if (XEXP (exp, 0) == cc0_rtx) \
995 cc_status.value1 = XEXP (exp, 0); \
996 cc_status.value2 = XEXP (exp, 1); \
997 cc_status.flags = 0; \
1001 if (cc_status.value1 \
1002 && reg_mentioned_p (XEXP (exp, 0), cc_status.value1)) \
1003 cc_status.value1 = 0; \
1004 if (cc_status.value2 \
1005 && reg_mentioned_p (XEXP (exp, 0), cc_status.value2)) \
1006 cc_status.value2 = 0; \
1007 switch (GET_CODE (XEXP (exp, 1))) \
1009 case PLUS: case MINUS: case NEG: \
1010 case NOT: case ABS: \
1011 CC_STATUS_SET (XEXP (exp, 0), XEXP (exp, 1)); \
1013 /* mult and div don't set any cc codes !! */ \
1014 case MULT: /* case UMULT: */ case DIV: case UDIV: \
1015 /* and, or and xor set the cc's the wrong way !! */ \
1016 case AND: case IOR: case XOR: \
1017 /* some shifts set the CC some don't. */ \
1018 case ASHIFT: case ASHIFTRT: \
1028 #define CC_STATUS_SET(V1, V2) \
1030 cc_status.flags = 0; \
1031 cc_status.value1 = (V1); \
1032 cc_status.value2 = (V2); \
1033 if (cc_status.value1 \
1034 && reg_mentioned_p (cc_status.value1, cc_status.value2)) \
1035 cc_status.value2 = 0; \
1038 #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \
1039 { if (cc_status.flags & CC_NO_OVERFLOW) return NO_OV; return NORMAL; }
1041 /* ------------------------------------------ */
1042 /* Control the assembler format that we output. */
1044 /* Define the parentheses used to group arithmetic operations
1045 in assembler code. */
1047 #define ASM_OPEN_PAREN "("
1048 #define ASM_CLOSE_PAREN ")"
1050 /* Define results of standard character escape sequences. */
1052 #ifdef TARGET_EBCDIC
1053 #define TARGET_ESC 39
1054 #define TARGET_BELL 47
1055 #define TARGET_BS 22
1056 #define TARGET_TAB 5
1057 #define TARGET_NEWLINE 21
1058 #define TARGET_VT 11
1059 #define TARGET_FF 12
1060 #define TARGET_CR 13
1062 #define TARGET_BELL 007
1063 #define TARGET_BS 010
1064 #define TARGET_TAB 011
1065 #define TARGET_NEWLINE 012
1066 #define TARGET_VT 013
1067 #define TARGET_FF 014
1068 #define TARGET_CR 015
1071 /* ======================================================== */
1074 #define TEXT_SECTION_ASM_OP "* Program text area"
1075 #define DATA_SECTION_ASM_OP "* Program data area"
1076 #define INIT_SECTION_ASM_OP "* Program initialization area"
1077 #define SHARED_SECTION_ASM_OP "* Program shared data"
1078 #define CTOR_LIST_BEGIN /* NO OP */
1079 #define CTOR_LIST_END /* NO OP */
1080 #define MAX_MVS_LABEL_SIZE 8
1082 /* How to refer to registers in assembler output. This sequence is
1083 indexed by compiler's hard-register-number (see above). */
1085 #define REGISTER_NAMES \
1086 { "0", "1", "2", "3", "4", "5", "6", "7", \
1087 "8", "9", "10", "11", "12", "13", "14", "15", \
1088 "0", "2", "4", "6" \
1091 /* How to renumber registers for dbx and gdb. */
1092 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1094 #define ASM_FILE_START(FILE) \
1095 { fputs ("\tRMODE\tANY\n", FILE); \
1096 fputs ("\tCSECT\n", FILE); }
1098 #define ASM_FILE_END(FILE) fputs ("\tEND\n", FILE);
1099 #define ASM_IDENTIFY_GCC(FILE)
1100 #define ASM_COMMENT_START "*"
1101 #define ASM_APP_OFF ""
1102 #define ASM_APP_ON ""
1104 #define ASM_OUTPUT_LABEL(FILE, NAME) \
1105 { assemble_name (FILE, NAME); fputs ("\tEQU\t*\n", FILE); }
1107 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
1109 char temp[MAX_MVS_LABEL_SIZE + 1]; \
1110 if (mvs_check_alias (NAME, temp) == 2) \
1112 fprintf (FILE, "%s\tALIAS\tC'%s'\n", temp, NAME); \
1116 #define ASM_GLOBALIZE_LABEL(FILE, NAME) \
1118 char temp[MAX_MVS_LABEL_SIZE + 1]; \
1119 if (mvs_check_alias (NAME, temp) == 2) \
1121 fprintf (FILE, "%s\tALIAS\tC'%s'\n", temp, NAME); \
1123 fputs ("\tENTRY\t", FILE); \
1124 assemble_name (FILE, NAME); \
1125 fputs ("\n", FILE); \
1128 /* MVS externals are limited to 8 characters, upper case only.
1129 The '_' is mapped to '@', except for MVS functions, then '#'. */
1132 #define ASM_OUTPUT_LABELREF(FILE, NAME) \
1134 char *bp, ch, temp[MAX_MVS_LABEL_SIZE + 1]; \
1135 if (!mvs_get_alias (NAME, temp)) \
1136 strcpy (temp, NAME); \
1137 if (!strcmp (temp,"main")) \
1138 strcpy (temp,"gccmain"); \
1139 if (mvs_function_check (temp)) \
1143 for (bp = temp; *bp; bp++) \
1144 *bp = (*bp == '_' ? ch : TOUPPER (*bp)); \
1145 fprintf (FILE, "%s", temp); \
1148 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
1149 sprintf (LABEL, "*%s%d", PREFIX, NUM)
1151 /* Generate internal label. Since we can branch here from off page, we
1152 must reload the base register. */
1154 #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
1156 if (!strcmp (PREFIX,"L")) \
1158 mvs_add_label(NUM); \
1160 fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM); \
1163 /* Generate case label. */
1164 /* hack alert -- I don't get it ... what if its a really big case label?
1165 * wouldn't we have to say label_emitted also ?? */
1167 #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
1168 fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM)
1170 /* This is how to output an element of a case-vector that is absolute. */
1172 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1173 mvs_check_page (FILE, 4, 0); \
1174 fprintf (FILE, "\tDC\tA(L%d)\n", VALUE)
1176 /* This is how to output an element of a case-vector that is relative. */
1178 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1179 mvs_check_page (FILE, 4, 0); \
1180 fprintf (FILE, "\tDC\tA(L%d-L%d)\n", VALUE, REL)
1182 /* This is how to output an insn to push a register on the stack.
1183 It need not be very fast code.
1184 Right now, PUSH & POP are used only when profiling is enabled,
1185 and then, only to push the static chain reg and the function struct
1186 value reg, and only if those are used. Since profiling is not
1187 supported anyway, punt on this. */
1189 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \
1190 mvs_check_page (FILE, 8, 4); \
1191 fprintf (FILE, "\tSXXX\t13,=F'4'\n\tST\t%s,%d(13)\n", \
1192 reg_names[REGNO], STACK_POINTER_OFFSET)
1194 /* This is how to output an insn to pop a register from the stack.
1195 It need not be very fast code. */
1197 #define ASM_OUTPUT_REG_POP(FILE, REGNO) \
1198 mvs_check_page (FILE, 8, 0); \
1199 fprintf (FILE, "\tL\t%s,%d(13)\n\tLAXXX\t13,4(13)\n", \
1200 reg_names[REGNO], STACK_POINTER_OFFSET)
1202 /* TBD: hack alert XXX these two float point macros print horribly
1203 incorrect things when run in cross-compiler mode. Thats's because
1204 in cross-compiler mode, the VALUE is not really a double. See below,
1205 in the ELF section, for the correct implementation. */
1206 /* This is how to output an assembler line defining a `double' constant. */
1207 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
1208 fprintf (FILE, "\tDC\tD'%.18G'\n", (VALUE))
1210 /* This is how to output an assembler line defining a `float' constant. */
1211 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
1212 fprintf (FILE, "\tDC\tE'%.9G'\n", (VALUE))
1214 /* This outputs an integer, if not a CONST_INT must be address constant. */
1216 #define ASM_OUTPUT_INT(FILE, EXP) \
1218 if (GET_CODE (EXP) == CONST_INT) \
1220 fprintf (FILE, "\tDC\tF'"); \
1221 output_addr_const (FILE, EXP); \
1222 fprintf (FILE, "'\n"); \
1226 fprintf (FILE, "\tDC\tA("); \
1227 output_addr_const (FILE, EXP); \
1228 fprintf (FILE, ")\n"); \
1232 /* This outputs a short integer. */
1234 #define ASM_OUTPUT_SHORT(FILE, EXP) \
1236 fprintf (FILE, "\tDC\tX'%04X'\n", INTVAL(EXP) & 0xFFFF); \
1239 /* This outputs a byte sized integer. */
1241 #define ASM_OUTPUT_CHAR(FILE, EXP) \
1242 fprintf (FILE, "\tDC\tX'%02X'\n", INTVAL (EXP) )
1244 #define ASM_OUTPUT_BYTE(FILE, VALUE) \
1245 fprintf (FILE, "\tDC\tX'%02X'\n", VALUE)
1247 /* This outputs a text string. The string are chopped up to fit into
1248 an 80 byte record. Also, control and special characters, interpreted
1249 by the IBM assembler, are output numerically. */
1251 #define MVS_ASCII_TEXT_LENGTH 48
1253 #define ASM_OUTPUT_ASCII(FILE, PTR, LEN) \
1257 for (j = 0, i = 0; i < LEN; j++, i++) \
1260 if (ISCNTRL (c) || c == '&') \
1262 if (j % MVS_ASCII_TEXT_LENGTH != 0 ) \
1263 fprintf (FILE, "'\n"); \
1265 if (c == '&') c = MAP_CHARACTER (c); \
1266 fprintf (FILE, "\tDC\tX'%X'\n", c ); \
1270 if (j % MVS_ASCII_TEXT_LENGTH == 0) \
1271 fprintf (FILE, "\tDC\tC'"); \
1273 fprintf (FILE, "%c%c", c, c); \
1275 fprintf (FILE, "%c", c); \
1276 if (j % MVS_ASCII_TEXT_LENGTH == MVS_ASCII_TEXT_LENGTH - 1) \
1277 fprintf (FILE, "'\n" ); \
1280 if (j % MVS_ASCII_TEXT_LENGTH != 0) \
1281 fprintf (FILE, "'\n"); \
1284 /* This is how to output an assembler line that says to advance the
1285 location counter to a multiple of 2**LOG bytes. */
1287 #define ASM_OUTPUT_ALIGN(FILE, LOG) \
1291 fprintf (FILE, "\tDS\t0H\n" ); \
1293 fprintf (FILE, "\tDS\t0F\n" ); \
1296 /* The maximum length of memory that the IBM assembler will allow in one
1299 #define MAX_CHUNK 32767
1301 /* A C statement to output to the stdio stream FILE an assembler
1302 instruction to advance the location counter by SIZE bytes. Those
1303 bytes should be zero when loaded. */
1305 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
1308 for (s = (SIZE); s > 0; s -= MAX_CHUNK) \
1310 if (s > MAX_CHUNK) \
1314 fprintf (FILE, "\tDS\tXL%d\n", k); \
1318 /* A C statement (sans semicolon) to output to the stdio stream
1319 FILE the assembler definition of a common-label named NAME whose
1320 size is SIZE bytes. The variable ROUNDED is the size rounded up
1321 to whatever alignment the caller wants. */
1323 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1325 char temp[MAX_MVS_LABEL_SIZE + 1]; \
1326 if (mvs_check_alias(NAME, temp) == 2) \
1328 fprintf (FILE, "%s\tALIAS\tC'%s'\n", temp, NAME); \
1330 fputs ("\tENTRY\t", FILE); \
1331 assemble_name (FILE, NAME); \
1332 fputs ("\n", FILE); \
1333 fprintf (FILE, "\tDS\t0F\n"); \
1334 ASM_OUTPUT_LABEL (FILE,NAME); \
1335 ASM_OUTPUT_SKIP (FILE,SIZE); \
1338 /* A C statement (sans semicolon) to output to the stdio stream
1339 FILE the assembler definition of a local-common-label named NAME
1340 whose size is SIZE bytes. The variable ROUNDED is the size
1341 rounded up to whatever alignment the caller wants. */
1343 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1345 fprintf (FILE, "\tDS\t0F\n"); \
1346 ASM_OUTPUT_LABEL (FILE,NAME); \
1347 ASM_OUTPUT_SKIP (FILE,SIZE); \
1350 /* Store in OUTPUT a string (made with alloca) containing an
1351 assembler-name for a local static variable named NAME.
1352 LABELNO is an integer which is different for each call. */
1354 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1356 (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10); \
1357 sprintf ((OUTPUT), "%s%d", (NAME), (LABELNO)); \
1360 /* Print operand XV (an rtx) in assembler syntax to file FILE.
1361 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1362 For `%' followed by punctuation, CODE is the punctuation and XV is null. */
1364 #define PRINT_OPERAND(FILE, XV, CODE) \
1366 switch (GET_CODE (XV)) \
1368 static char curreg[4]; \
1371 strcpy (curreg, reg_names[REGNO (XV) + 1]); \
1373 strcpy (curreg, reg_names[REGNO (XV)]); \
1374 fprintf (FILE, "%s", curreg); \
1378 rtx addr = XEXP (XV, 0); \
1381 if (GET_CODE (addr) == PLUS) \
1382 fprintf (FILE, "%d", INTVAL (XEXP (addr, 1))); \
1384 fprintf (FILE, "0"); \
1386 else if (CODE == 'R') \
1388 if (GET_CODE (addr) == PLUS) \
1389 fprintf (FILE, "%s", reg_names[REGNO (XEXP (addr, 0))]);\
1391 fprintf (FILE, "%s", reg_names[REGNO (addr)]); \
1394 output_address (XEXP (XV, 0)); \
1399 mvs_page_lit += 4; \
1400 if (SYMBOL_REF_FLAG (XV)) fprintf (FILE, "=V("); \
1401 else fprintf (FILE, "=A("); \
1402 output_addr_const (FILE, XV); \
1403 fprintf (FILE, ")"); \
1407 fprintf (FILE, "%d", INTVAL (XV) & 0xff); \
1408 else if (CODE == 'X') \
1409 fprintf (FILE, "%02X", INTVAL (XV) & 0xff); \
1410 else if (CODE == 'h') \
1411 fprintf (FILE, "%d", (INTVAL (XV) << 16) >> 16); \
1412 else if (CODE == 'H') \
1414 mvs_page_lit += 2; \
1415 fprintf (FILE, "=H'%d'", (INTVAL (XV) << 16) >> 16); \
1417 else if (CODE == 'K') \
1419 /* auto sign-extension of signed 16-bit to signed 32-bit */ \
1420 mvs_page_lit += 4; \
1421 fprintf (FILE, "=F'%d'", (INTVAL (XV) << 16) >> 16); \
1423 else if (CODE == 'W') \
1425 /* hand-built sign-extension of signed 32-bit to 64-bit */ \
1426 mvs_page_lit += 8; \
1427 if (0 <= INTVAL (XV)) { \
1428 fprintf (FILE, "=XL8'00000000"); \
1430 fprintf (FILE, "=XL8'FFFFFFFF"); \
1432 fprintf (FILE, "%08X'", INTVAL (XV)); \
1436 mvs_page_lit += 4; \
1437 fprintf (FILE, "=F'%d'", INTVAL (XV)); \
1440 case CONST_DOUBLE: \
1441 if (GET_MODE (XV) == DImode) \
1445 mvs_page_lit += 4; \
1446 fprintf (FILE, "=XL4'%08X'", CONST_DOUBLE_LOW (XV)); \
1448 else if (CODE == 'L') \
1450 mvs_page_lit += 4; \
1451 fprintf (FILE, "=XL4'%08X'", CONST_DOUBLE_HIGH (XV)); \
1455 mvs_page_lit += 8; \
1456 fprintf (FILE, "=XL8'%08X%08X'", CONST_DOUBLE_LOW (XV), \
1457 CONST_DOUBLE_HIGH (XV)); \
1462 /* hack alert -- this prints wildly incorrect values */ \
1463 /* when run in cross-compiler mode. See ELF section */ \
1464 /* for suggested fix */ \
1465 union { double d; int i[2]; } u; \
1466 u.i[0] = CONST_DOUBLE_LOW (XV); \
1467 u.i[1] = CONST_DOUBLE_HIGH (XV); \
1468 if (GET_MODE (XV) == SFmode) \
1470 mvs_page_lit += 4; \
1471 fprintf (FILE, "=E'%.9G'", u.d); \
1475 mvs_page_lit += 8; \
1476 fprintf (FILE, "=D'%.18G'", u.d); \
1481 if (GET_CODE (XEXP (XV, 0)) == PLUS \
1482 && GET_CODE (XEXP (XEXP (XV, 0), 0)) == SYMBOL_REF) \
1484 mvs_page_lit += 4; \
1485 if (SYMBOL_REF_FLAG (XEXP (XEXP (XV, 0), 0))) \
1487 fprintf (FILE, "=V("); \
1488 ASM_OUTPUT_LABELREF (FILE, \
1489 XSTR (XEXP (XEXP (XV, 0), 0), 0)); \
1490 fprintf (FILE, ")\n\tA\t%s,=F'%d'", curreg, \
1491 INTVAL (XEXP (XEXP (XV, 0), 1))); \
1495 fprintf (FILE, "=A("); \
1496 output_addr_const (FILE, XV); \
1497 fprintf (FILE, ")"); \
1502 mvs_page_lit += 4; \
1503 fprintf (FILE, "=F'"); \
1504 output_addr_const (FILE, XV); \
1505 fprintf (FILE, "'"); \
1513 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1515 rtx breg, xreg, offset, plus; \
1517 switch (GET_CODE (ADDR)) \
1520 fprintf (FILE, "0(%s)", reg_names[REGNO (ADDR)]); \
1526 if (GET_CODE (XEXP (ADDR, 0)) == PLUS) \
1528 if (GET_CODE (XEXP (ADDR, 1)) == REG) \
1529 breg = XEXP (ADDR, 1); \
1531 offset = XEXP (ADDR, 1); \
1532 plus = XEXP (ADDR, 0); \
1536 if (GET_CODE (XEXP (ADDR, 0)) == REG) \
1537 breg = XEXP (ADDR, 0); \
1539 offset = XEXP (ADDR, 0); \
1540 plus = XEXP (ADDR, 1); \
1542 if (GET_CODE (plus) == PLUS) \
1544 if (GET_CODE (XEXP (plus, 0)) == REG) \
1547 xreg = XEXP (plus, 0); \
1549 breg = XEXP (plus, 0); \
1553 offset = XEXP (plus, 0); \
1555 if (GET_CODE (XEXP (plus, 1)) == REG) \
1558 xreg = XEXP (plus, 1); \
1560 breg = XEXP (plus, 1); \
1564 offset = XEXP (plus, 1); \
1567 else if (GET_CODE (plus) == REG) \
1580 if (GET_CODE (offset) == LABEL_REF) \
1581 fprintf (FILE, "L%d", \
1582 CODE_LABEL_NUMBER (XEXP (offset, 0))); \
1584 output_addr_const (FILE, offset); \
1587 fprintf (FILE, "0"); \
1589 fprintf (FILE, "(%s,%s)", \
1590 reg_names[REGNO (xreg)], reg_names[REGNO (breg)]); \
1592 fprintf (FILE, "(%s)", reg_names[REGNO (breg)]); \
1595 mvs_page_lit += 4; \
1596 if (SYMBOL_REF_FLAG (ADDR)) fprintf (FILE, "=V("); \
1597 else fprintf (FILE, "=A("); \
1598 output_addr_const (FILE, ADDR); \
1599 fprintf (FILE, ")"); \
1604 /* This macro generates the assembly code for function entry.
1605 All of the C/370 environment is preserved. */
1606 #define FUNCTION_PROLOGUE(FILE, LSIZE) i370_function_prolog ((FILE), (LSIZE));
1608 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
1610 if (strlen (NAME) + 1 > mvs_function_name_length) \
1612 if (mvs_function_name) \
1613 free (mvs_function_name); \
1614 mvs_function_name = 0; \
1616 if (!mvs_function_name) \
1618 mvs_function_name_length = strlen (NAME) * 2 + 1; \
1619 mvs_function_name = (char *) xmalloc (mvs_function_name_length); \
1621 if (!strcmp (NAME, "main")) \
1622 strcpy (mvs_function_name, "gccmain"); \
1624 strcpy (mvs_function_name, NAME); \
1625 fprintf (FILE, "\tDS\t0F\n"); \
1626 assemble_name (FILE, mvs_function_name); \
1627 fputs ("\tRMODE\tANY\n", FILE); \
1628 assemble_name (FILE, mvs_function_name); \
1629 fputs ("\tCSECT\n", FILE); \
1632 /* This macro generates the assembly code for function exit, on machines
1633 that need it. If FUNCTION_EPILOGUE is not defined then individual
1634 return instructions are generated for each return statement. Args are
1635 same as for FUNCTION_PROLOGUE.
1637 The function epilogue should not depend on the current stack pointer!
1638 It should use the frame pointer only. This is mandatory because
1639 of alloca; we also take advantage of it to omit stack adjustments
1640 before returning. */
1642 #if MACROEPILOGUE == 1
1643 #define FUNCTION_EPILOGUE(FILE, LSIZE) \
1646 check_label_emit(); \
1647 mvs_check_page (FILE,14,0); \
1648 fprintf (FILE, "* Function %s epilogue\n", mvs_function_name); \
1649 fprintf (FILE, "\tEDCEPIL\n"); \
1651 fprintf (FILE, "* Function %s literal pool\n", mvs_function_name); \
1652 fprintf (FILE, "\tDS\t0F\n" ); \
1653 fprintf (FILE, "\tLTORG\n"); \
1654 fprintf (FILE, "* Function %s page table\n", mvs_function_name); \
1655 fprintf (FILE, "\tDS\t0F\n"); \
1656 fprintf (FILE, "PGT%d\tEQU\t*\n", function_base_page); \
1657 mvs_free_label_list(); \
1658 for ( i = function_base_page; i < mvs_page_num; i++ ) \
1659 fprintf (FILE, "\tDC\tA(PG%d)\n", i); \
1661 #else /* MACROEPILOGUE != 1 */
1662 #define FUNCTION_EPILOGUE(FILE, LSIZE) \
1665 check_label_emit(); \
1666 mvs_check_page (FILE,14,0); \
1667 fprintf (FILE, "* Function %s epilogue\n", mvs_function_name); \
1668 fprintf (FILE, "\tL\t13,4(,13)\n"); \
1669 fprintf (FILE, "\tL\t14,12(,13)\n"); \
1670 fprintf (FILE, "\tLM\t2,12,28(13)\n"); \
1671 fprintf (FILE, "\tBALR\t1,14\n"); \
1672 fprintf (FILE, "\tDC\tA("); \
1674 assemble_name (FILE, mvs_function_name); \
1675 fprintf (FILE, ")\n" ); \
1676 fprintf (FILE, "* Function %s literal pool\n", mvs_function_name); \
1677 fprintf (FILE, "\tDS\t0F\n" ); \
1678 fprintf (FILE, "\tLTORG\n"); \
1679 fprintf (FILE, "* Function %s page table\n", mvs_function_name); \
1680 fprintf (FILE, "\tDS\t0F\n"); \
1681 fprintf (FILE, "PGT%d\tEQU\t*\n", function_base_page); \
1682 mvs_free_label_list(); \
1683 for ( i = function_base_page; i < mvs_page_num; i++ ) \
1684 fprintf (FILE, "\tDC\tA(PG%d)\n", i); \
1686 #endif /* MACROEPILOGUE */
1688 /* Output assembler code to FILE to increment profiler label # LABELNO
1689 for profiling a function entry. */
1691 #define FUNCTION_PROFILER(FILE, LABELNO) \
1692 fprintf (FILE, "Error: No profiling available.\n")
1694 #endif /* TARGET_HLASM */
1696 /* ======================================================== */
1698 #ifdef TARGET_ELF_ABI
1700 /* How to refer to registers in assembler output. This sequence is
1701 indexed by compiler's hard-register-number (see above). */
1703 #define REGISTER_NAMES \
1704 { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
1705 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
1706 "f0", "f2", "f4", "f6" \
1709 /* How to renumber registers for dbx and gdb. */
1710 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1712 /* Print operand XV (an rtx) in assembler syntax to file FILE.
1713 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1714 For `%' followed by punctuation, CODE is the punctuation and XV is null. */
1716 #define PRINT_OPERAND(FILE, XV, CODE) \
1718 switch (GET_CODE (XV)) \
1720 static char curreg[4]; \
1723 strcpy (curreg, reg_names[REGNO (XV) + 1]); \
1725 strcpy (curreg, reg_names[REGNO (XV)]); \
1726 fprintf (FILE, "%s", curreg); \
1730 rtx addr = XEXP (XV, 0); \
1733 if (GET_CODE (addr) == PLUS) \
1734 fprintf (FILE, "%d", INTVAL (XEXP (addr, 1))); \
1736 fprintf (FILE, "0"); \
1738 else if (CODE == 'R') \
1740 if (GET_CODE (addr) == PLUS) \
1741 fprintf (FILE, "%s", reg_names[REGNO (XEXP (addr, 0))]);\
1743 fprintf (FILE, "%s", reg_names[REGNO (addr)]); \
1746 output_address (XEXP (XV, 0)); \
1751 mvs_page_lit += 4; \
1752 if (SYMBOL_REF_FLAG (XV)) fprintf (FILE, "=V("); \
1753 else fprintf (FILE, "=A("); \
1754 output_addr_const (FILE, XV); \
1755 fprintf (FILE, ")"); \
1759 fprintf (FILE, "%d", INTVAL (XV) & 0xff); \
1760 else if (CODE == 'X') \
1761 fprintf (FILE, "%02X", INTVAL (XV) & 0xff); \
1762 else if (CODE == 'h') \
1763 fprintf (FILE, "%d", (INTVAL (XV) << 16) >> 16); \
1764 else if (CODE == 'H') \
1766 mvs_page_lit += 2; \
1767 fprintf (FILE, "=H'%d'", (INTVAL (XV) << 16) >> 16); \
1769 else if (CODE == 'K') \
1771 /* auto sign-extension of signed 16-bit to signed 32-bit */ \
1772 mvs_page_lit += 4; \
1773 fprintf (FILE, "=F'%d'", (INTVAL (XV) << 16) >> 16); \
1775 else if (CODE == 'W') \
1777 /* hand-built sign-extension of signed 32-bit to 64-bit */ \
1778 mvs_page_lit += 8; \
1779 if (0 <= INTVAL (XV)) { \
1780 fprintf (FILE, "=XL8'00000000"); \
1782 fprintf (FILE, "=XL8'FFFFFFFF"); \
1784 fprintf (FILE, "%08X'", INTVAL (XV)); \
1788 mvs_page_lit += 4; \
1789 fprintf (FILE, "=F'%d'", INTVAL (XV)); \
1792 case CONST_DOUBLE: \
1793 if (GET_MODE (XV) == DImode) \
1797 mvs_page_lit += 4; \
1798 fprintf (FILE, "=XL4'%08X'", CONST_DOUBLE_LOW (XV)); \
1800 else if (CODE == 'L') \
1802 mvs_page_lit += 4; \
1803 fprintf (FILE, "=XL4'%08X'", CONST_DOUBLE_HIGH (XV)); \
1807 mvs_page_lit += 8; \
1808 fprintf (FILE, "=yyyyXL8'%08X%08X'", \
1809 CONST_DOUBLE_HIGH (XV), CONST_DOUBLE_LOW (XV)); \
1815 REAL_VALUE_TYPE rval; \
1816 REAL_VALUE_FROM_CONST_DOUBLE(rval, XV); \
1817 REAL_VALUE_TO_DECIMAL (rval, HOST_WIDE_INT_PRINT_DEC, buf); \
1818 if (GET_MODE (XV) == SFmode) \
1820 mvs_page_lit += 4; \
1821 fprintf (FILE, "=E'%s'", buf); \
1824 if (GET_MODE (XV) == DFmode) \
1826 mvs_page_lit += 8; \
1827 fprintf (FILE, "=D'%s'", buf); \
1829 else /* VOIDmode !?!? strange but true ... */ \
1831 mvs_page_lit += 8; \
1832 fprintf (FILE, "=XL8'%08X%08X'", \
1833 CONST_DOUBLE_HIGH (XV), CONST_DOUBLE_LOW (XV)); \
1838 if (GET_CODE (XEXP (XV, 0)) == PLUS \
1839 && GET_CODE (XEXP (XEXP (XV, 0), 0)) == SYMBOL_REF) \
1841 mvs_page_lit += 4; \
1842 if (SYMBOL_REF_FLAG (XEXP (XEXP (XV, 0), 0))) \
1844 fprintf (FILE, "=V("); \
1845 ASM_OUTPUT_LABELREF (FILE, \
1846 XSTR (XEXP (XEXP (XV, 0), 0), 0)); \
1847 fprintf (FILE, ")\n\tA\t%s,=F'%d'", curreg, \
1848 INTVAL (XEXP (XEXP (XV, 0), 1))); \
1852 fprintf (FILE, "=A("); \
1853 output_addr_const (FILE, XV); \
1854 fprintf (FILE, ")"); \
1859 mvs_page_lit += 4; \
1860 fprintf (FILE, "=bogus_bad_F'"); \
1861 output_addr_const (FILE, XV); \
1862 fprintf (FILE, "'"); \
1863 /* XXX hack alert this gets gen'd in -fPIC code in relation to a tablejump */ \
1864 /* but its somehow fundamentally broken, I can't make any sense out of it */ \
1874 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1876 rtx breg, xreg, offset, plus; \
1878 switch (GET_CODE (ADDR)) \
1881 fprintf (FILE, "0(%s)", reg_names[REGNO (ADDR)]); \
1887 if (GET_CODE (XEXP (ADDR, 0)) == PLUS) \
1889 if (GET_CODE (XEXP (ADDR, 1)) == REG) \
1890 breg = XEXP (ADDR, 1); \
1892 offset = XEXP (ADDR, 1); \
1893 plus = XEXP (ADDR, 0); \
1897 if (GET_CODE (XEXP (ADDR, 0)) == REG) \
1898 breg = XEXP (ADDR, 0); \
1900 offset = XEXP (ADDR, 0); \
1901 plus = XEXP (ADDR, 1); \
1903 if (GET_CODE (plus) == PLUS) \
1905 if (GET_CODE (XEXP (plus, 0)) == REG) \
1908 xreg = XEXP (plus, 0); \
1910 breg = XEXP (plus, 0); \
1914 offset = XEXP (plus, 0); \
1916 if (GET_CODE (XEXP (plus, 1)) == REG) \
1919 xreg = XEXP (plus, 1); \
1921 breg = XEXP (plus, 1); \
1925 offset = XEXP (plus, 1); \
1928 else if (GET_CODE (plus) == REG) \
1941 if (GET_CODE (offset) == LABEL_REF) \
1942 fprintf (FILE, "L%d", \
1943 CODE_LABEL_NUMBER (XEXP (offset, 0))); \
1945 output_addr_const (FILE, offset); \
1948 fprintf (FILE, "0"); \
1950 fprintf (FILE, "(%s,%s)", \
1951 reg_names[REGNO (xreg)], reg_names[REGNO (breg)]); \
1953 fprintf (FILE, "(%s)", reg_names[REGNO (breg)]); \
1956 mvs_page_lit += 4; \
1957 if (SYMBOL_REF_FLAG (ADDR)) fprintf (FILE, "=V("); \
1958 else fprintf (FILE, "=A("); \
1959 output_addr_const (FILE, ADDR); \
1960 fprintf (FILE, ")"); \
1965 /* This macro generates the assembly code for function exit, on machines
1966 that need it. If FUNCTION_EPILOGUE is not defined then individual
1967 return instructions are generated for each return statement. Args are
1968 same as for FUNCTION_PROLOGUE.
1970 The function epilogue should not depend on the current stack pointer!
1971 It should use the frame pointer only. This is mandatory because
1972 of alloca; we also take advantage of it to omit stack adjustments
1973 before returning. */
1975 #define FUNCTION_EPILOGUE(FILE, LSIZE) \
1978 check_label_emit(); \
1979 mvs_check_page (FILE,14,0); \
1980 fprintf (FILE, "# Function epilogue\n"); \
1981 fprintf (FILE, "\tL\tsp,4(0,sp)\n"); \
1982 fprintf (FILE, "\tL\tlr,12(0,sp)\n"); \
1983 fprintf (FILE, "\tLM\t2,12,28(sp)\n"); \
1984 fprintf (FILE, "\tBASR\t1,lr\n"); \
1986 fprintf (FILE, "# Function literal pool\n"); \
1987 fprintf (FILE, "\t.balign\t4\n"); \
1988 fprintf (FILE, "\t.ltorg\n"); \
1989 fprintf (FILE, "# Function page table\n"); \
1990 fprintf (FILE, "\t.balign\t4\n"); \
1991 fprintf (FILE, ".LPGT%d:\n", function_base_page); \
1992 mvs_free_label_list(); \
1993 for ( i = function_base_page; i < mvs_page_num; i++ ) \
1994 fprintf (FILE, "\t.long\t.LPG%d\n", i); \
1997 #define FUNCTION_PROLOGUE(FILE, LSIZE) i370_function_prolog ((FILE), (LSIZE));
1999 /* Output assembler code to FILE to increment profiler label # LABELNO
2000 for profiling a function entry. */
2001 /* Make it a no-op for now, so we can at least compile glibc */
2002 #define FUNCTION_PROFILER(FILE, LABELNO) { \
2003 mvs_check_page (FILE, 24, 4); \
2004 fprintf (FILE, "\tSTM\tr1,r2,%d(sp)\n", STACK_POINTER_OFFSET-8); \
2005 fprintf (FILE, "\tLA\tr1,1(0,0)\n"); \
2006 fprintf (FILE, "\tL\tr2,=A(.LP%d)\n", LABELNO); \
2007 fprintf (FILE, "\tA\tr1,0(r2)\n"); \
2008 fprintf (FILE, "\tST\tr1,0(r2)\n"); \
2009 fprintf (FILE, "\tLM\tr1,r2,%d(sp)\n", STACK_POINTER_OFFSET-8); \
2012 /* Don't bother to output .extern pseudo-ops. They are not needed by
2015 #undef ASM_OUTPUT_EXTERNAL
2017 #define ASM_DOUBLE "\t.double"
2018 #define ASM_LONG "\t.long"
2019 #define ASM_SHORT "\t.short"
2020 #define ASM_BYTE "\t.byte"
2022 /* Argument to the flt pt. macros is a REAL_VALUE_TYPE which
2023 may or may not be a float/double, depending on whther we
2024 are running in cross-compiler mode. */
2025 /* This is how to output an assembler line defining a `double' constant. */
2026 #define ASM_OUTPUT_DOUBLE(FILE, RVAL) { \
2028 REAL_VALUE_TO_DECIMAL (RVAL, HOST_WIDE_INT_PRINT_DOUBLE_HEX, buf); \
2029 fprintf (FILE, "\tDC\tD'%s'\n", buf); \
2032 /* This is how to output an assembler line defining a `float' constant. */
2033 #define ASM_OUTPUT_FLOAT(FILE, RVAL) { \
2035 REAL_VALUE_TO_DECIMAL (RVAL, HOST_WIDE_INT_PRINT_DEC, buf); \
2036 fprintf (FILE, "\tDC\tE'%s'\n", buf); \
2040 /* This is how to output an assembler line defining an `int' constant. */
2041 #define ASM_OUTPUT_INT(FILE,VALUE) \
2042 ( fprintf (FILE, "%s ", ASM_LONG), \
2043 output_addr_const (FILE,(VALUE)), \
2046 /* Likewise for `char' and `short' constants. */
2047 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
2048 ( fprintf (FILE, "%s ", ASM_SHORT), \
2049 output_addr_const (FILE,(VALUE)), \
2053 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
2054 ( fprintf (FILE, "%s ", ASM_BYTE_OP), \
2055 output_addr_const (FILE, (VALUE)), \
2058 /* This is how to output an assembler line for a numeric constant byte. */
2059 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
2060 fprintf ((FILE), "%s 0x%x\n", ASM_BYTE_OP, (VALUE))
2062 /* This is how to output the definition of a user-level label named NAME,
2063 such as the label on a static function or variable NAME. */
2064 #define ASM_OUTPUT_LABEL(FILE,NAME) \
2065 (assemble_name (FILE, NAME), fputs (":\n", FILE))
2067 /* #define ASM_OUTPUT_LABELREF(FILE, NAME) */ /* use gas -- defaults.h */
2069 /* Generate internal label. Since we can branch here from off page, we
2070 must reload the base register. Note that internal labels are generated
2071 for loops, goto's and case labels. */
2072 #undef ASM_OUTPUT_INTERNAL_LABEL
2073 #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
2075 if (!strcmp (PREFIX,"L")) \
2077 mvs_add_label(NUM); \
2079 fprintf (FILE, ".%s%d:\n", PREFIX, NUM); \
2082 /* let config/svr4.h define this ...
2083 * #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, TABLE)
2084 * fprintf (FILE, "%s%d:\n", PREFIX, NUM)
2087 /* This is how to output an element of a case-vector that is absolute. */
2088 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
2089 mvs_check_page (FILE, 4, 0); \
2090 fprintf (FILE, "\t.long\t.L%d\n", VALUE)
2092 /* This is how to output an element of a case-vector that is relative. */
2093 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
2094 mvs_check_page (FILE, 4, 0); \
2095 fprintf (FILE, "\t.long\t.L%d-.L%d\n", VALUE, REL)
2097 /* Right now, PUSH & POP are used only when profiling is enabled,
2098 and then, only to push the static chain reg and the function struct
2099 value reg, and only if those are used by the function being profiled.
2100 We don't need this for profiling, so punt. */
2101 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO)
2102 #define ASM_OUTPUT_REG_POP(FILE, REGNO)
2105 /* Indicate that jump tables go in the text section. This is
2106 necessary when compiling PIC code. */
2107 #define JUMP_TABLES_IN_TEXT_SECTION 1
2109 /* Define macro used to output shift-double opcodes when the shift
2110 count is in %cl. Some assemblers require %cl as an argument;
2113 GAS requires the %cl argument, so override i386/unix.h. */
2115 #undef SHIFT_DOUBLE_OMITS_COUNT
2116 #define SHIFT_DOUBLE_OMITS_COUNT 0
2118 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
2119 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
2120 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
2122 /* Allow #sccs in preprocessor. */
2123 #define SCCS_DIRECTIVE
2125 /* Implicit library calls should use memcpy, not bcopy, etc. */
2126 #define TARGET_MEM_FUNCTIONS
2128 /* Output before read-only data. */
2129 #define TEXT_SECTION_ASM_OP ".text"
2131 /* Output before writable (initialized) data. */
2132 #define DATA_SECTION_ASM_OP ".data"
2134 /* Output before writable (uninitialized) data. */
2135 #define BSS_SECTION_ASM_OP ".bss"
2137 /* In the past there was confusion as to what the argument to .align was
2138 in GAS. For the last several years the rule has been this: for a.out
2139 file formats that argument is LOG, and for all other file formats the
2142 However, GAS now has .p2align and .balign pseudo-ops so to remove any
2143 doubt or guess work, and since this file is used for both a.out and other
2144 file formats, we use one of them. */
2146 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
2147 if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1<<(LOG))
2149 /* This is how to output a command to make the user-level label named NAME
2150 defined for reference from other files. */
2152 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
2153 (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
2155 /* This says how to output an assembler line
2156 to define a global common symbol. */
2158 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
2159 ( fputs (".comm ", (FILE)), \
2160 assemble_name ((FILE), (NAME)), \
2161 fprintf ((FILE), ",%u\n", (ROUNDED)))
2163 /* This says how to output an assembler line
2164 to define a local common symbol. */
2166 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
2167 ( fputs (".lcomm ", (FILE)), \
2168 assemble_name ((FILE), (NAME)), \
2169 fprintf ((FILE), ",%u\n", (ROUNDED)))
2171 #endif /* TARGET_ELF_ABI */
2172 #endif /* __I370_H__ */