OSDN Git Service

11b6d84ab6d5296e053346b8f1f78547bd79503b
[pf3gnuchains/gcc-fork.git] / gcc / config / s390 / s390.h
1 /* Definitions of target machine for GNU compiler, for IBM S/390
2    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
3    Free Software Foundation, Inc.
4    Contributed by Hartmut Penner (hpenner@de.ibm.com) and
5                   Ulrich Weigand (uweigand@de.ibm.com).
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to the Free
21 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 02111-1307, USA.  */
23
24 #ifndef _S390_H
25 #define _S390_H
26
27 /* Override the __fixdfdi etc. routines when building libgcc2.
28    ??? This should be done in a cleaner way ...  */
29 #if defined (IN_LIBGCC2) && !defined (__s390x__)
30 #include <config/s390/fixdfdi.h>
31 #endif
32
33 /* Which processor to generate code or schedule for. The cpu attribute
34    defines a list that mirrors this list, so changes to s390.md must be
35    made at the same time.  */
36
37 enum processor_type
38 {
39   PROCESSOR_9672_G5,
40   PROCESSOR_9672_G6,
41   PROCESSOR_2064_Z900,
42   PROCESSOR_2084_Z990,
43   PROCESSOR_max
44 };
45
46 /* Optional architectural facilities supported by the processor.  */
47
48 enum processor_flags
49 {
50   PF_IEEE_FLOAT = 1,
51   PF_ZARCH = 2,
52   PF_LONG_DISPLACEMENT = 4
53 };
54
55 extern enum processor_type s390_tune;
56 extern enum processor_flags s390_tune_flags;
57 extern const char *s390_tune_string;
58
59 extern enum processor_type s390_arch;
60 extern enum processor_flags s390_arch_flags;
61 extern const char *s390_arch_string;
62
63 extern const char *s390_backchain_string;
64
65 extern const char *s390_warn_framesize_string;
66 extern const char *s390_warn_dynamicstack_string;
67 extern const char *s390_stack_size_string;
68 extern const char *s390_stack_guard_string;
69
70 #define TARGET_CPU_IEEE_FLOAT \
71         (s390_arch_flags & PF_IEEE_FLOAT)
72 #define TARGET_CPU_ZARCH \
73         (s390_arch_flags & PF_ZARCH)
74 #define TARGET_CPU_LONG_DISPLACEMENT \
75         (s390_arch_flags & PF_LONG_DISPLACEMENT)
76
77 #define TARGET_LONG_DISPLACEMENT \
78        (TARGET_ZARCH && TARGET_CPU_LONG_DISPLACEMENT)
79
80
81 /* Run-time target specification.  */
82
83 /* This will be overridden by OS headers.  */
84 #define TARGET_TPF 0
85
86 /* Target CPU builtins.  */
87 #define TARGET_CPU_CPP_BUILTINS()                       \
88   do                                                    \
89     {                                                   \
90       builtin_assert ("cpu=s390");                      \
91       builtin_assert ("machine=s390");                  \
92       builtin_define ("__s390__");                      \
93       if (TARGET_64BIT)                                 \
94         builtin_define ("__s390x__");                   \
95     }                                                   \
96   while (0)
97
98 /* Optional target features.  */
99 extern int target_flags;
100
101 #define MASK_HARD_FLOAT            0x01
102 #define MASK_SMALL_EXEC            0x04
103 #define MASK_DEBUG_ARG             0x08
104 #define MASK_64BIT                 0x10
105 #define MASK_ZARCH                 0x20
106 #define MASK_MVCLE                 0x40
107 #define MASK_TPF_PROFILING         0x80
108 #define MASK_NO_FUSED_MADD         0x100
109
110 #define TARGET_HARD_FLOAT          (target_flags & MASK_HARD_FLOAT)
111 #define TARGET_SOFT_FLOAT          (!(target_flags & MASK_HARD_FLOAT))
112 #define TARGET_SMALL_EXEC          (target_flags & MASK_SMALL_EXEC)
113 #define TARGET_DEBUG_ARG           (target_flags & MASK_DEBUG_ARG)
114 #define TARGET_64BIT               (target_flags & MASK_64BIT)
115 #define TARGET_ZARCH               (target_flags & MASK_ZARCH)
116 #define TARGET_MVCLE               (target_flags & MASK_MVCLE)
117 #define TARGET_TPF_PROFILING       (target_flags & MASK_TPF_PROFILING)
118 #define TARGET_NO_FUSED_MADD       (target_flags & MASK_NO_FUSED_MADD)
119 #define TARGET_FUSED_MADD          (! TARGET_NO_FUSED_MADD)
120
121 #define TARGET_BACKCHAIN           (s390_backchain_string[0] == '1')
122 #define TARGET_KERNEL_BACKCHAIN    (s390_backchain_string[0] == '2')
123
124 /* ??? Once this actually works, it could be made a runtime option.  */
125 #define TARGET_IBM_FLOAT           0
126 #define TARGET_IEEE_FLOAT          1
127
128 #ifdef DEFAULT_TARGET_64BIT
129 #define TARGET_DEFAULT             (MASK_64BIT | MASK_ZARCH | MASK_HARD_FLOAT)
130 #else
131 #define TARGET_DEFAULT             MASK_HARD_FLOAT
132 #endif
133
134 #define TARGET_DEFAULT_BACKCHAIN ""
135
136 #define TARGET_SWITCHES                                                  \
137 { { "hard-float",      1, N_("Use hardware fp")},                        \
138   { "soft-float",     -1, N_("Don't use hardware fp")},                  \
139   { "small-exec",      4, N_("Use bras for executable < 64k")},          \
140   { "no-small-exec",  -4, N_("Don't use bras")},                         \
141   { "debug",           8, N_("Additional debug prints")},                \
142   { "no-debug",       -8, N_("Don't print additional debug prints")},    \
143   { "64",             16, N_("64 bit ABI")},                             \
144   { "31",            -16, N_("31 bit ABI")},                             \
145   { "zarch",          32, N_("z/Architecture")},                         \
146   { "esa",           -32, N_("ESA/390 architecture")},                   \
147   { "mvcle",          64, N_("mvcle use")},                              \
148   { "no-mvcle",      -64, N_("mvc&ex")},                                 \
149   { "tpf-trace",     128, N_("enable tpf OS tracing code")},             \
150   { "no-tpf-trace", -128, N_("disable tpf OS tracing code")},            \
151   { "no-fused-madd", 256, N_("disable fused multiply/add instructions")},\
152   { "fused-madd",   -256, N_("enable fused multiply/add instructions")}, \
153   { "", TARGET_DEFAULT, 0 } }
154
155 #define TARGET_OPTIONS                                                         \
156 { { "tune=",            &s390_tune_string,                                     \
157     N_("Schedule code for given CPU"), 0},                                     \
158   { "arch=",            &s390_arch_string,                                     \
159     N_("Generate code for given CPU"), 0},                                     \
160   { "backchain",        &s390_backchain_string,                                \
161     N_("Set backchain"), "1"},                                                 \
162   { "no-backchain",     &s390_backchain_string,                                \
163     N_("Do not set backchain"), ""},                                           \
164   { "kernel-backchain", &s390_backchain_string,                                \
165     N_("Set backchain appropriate for the linux kernel"), "2"},                \
166   { "warn-framesize=",   &s390_warn_framesize_string,                          \
167     N_("Warn if a single function's framesize exceeds the given framesize"),   \
168        0},                                                                     \
169   { "warn-dynamicstack", &s390_warn_dynamicstack_string,                       \
170     N_("Warn if a function uses alloca or creates an array with dynamic size"),\
171        0},                                                                     \
172   { "stack-size=",       &s390_stack_size_string,                              \
173     N_("Emit extra code in the function prologue in order to trap if the stack"\
174        "size exceeds the given limit"), 0},                                    \
175   { "stack-guard=",      &s390_stack_guard_string,                             \
176     N_("Set the max. number of bytes which has to be left to stack size "      \
177        "before a trap instruction is triggered"), 0},                          \
178 }
179
180 /* Support for configure-time defaults.  */
181 #define OPTION_DEFAULT_SPECS                                    \
182   { "mode", "%{!mesa:%{!mzarch:-m%(VALUE)}}" },                 \
183   { "arch", "%{!march=*:-march=%(VALUE)}" },                    \
184   { "tune", "%{!mtune=*:-mtune=%(VALUE)}" }
185
186 /* Defaulting rules.  */
187 #ifdef DEFAULT_TARGET_64BIT
188 #define DRIVER_SELF_SPECS                                       \
189   "%{!m31:%{!m64:-m64}}",                                       \
190   "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}",             \
191   "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}"
192 #else
193 #define DRIVER_SELF_SPECS                                       \
194   "%{!m31:%{!m64:-m31}}",                                       \
195   "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}",             \
196   "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}"
197 #endif
198
199 /* Target version string.  Overridden by the OS header.  */
200 #ifdef DEFAULT_TARGET_64BIT
201 #define TARGET_VERSION fprintf (stderr, " (zSeries)");
202 #else
203 #define TARGET_VERSION fprintf (stderr, " (S/390)");
204 #endif
205
206 /* Hooks to override options.  */
207 #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options(LEVEL, SIZE)
208 #define OVERRIDE_OPTIONS override_options ()
209
210 /* Frame pointer is not used for debugging.  */
211 #define CAN_DEBUG_WITHOUT_FP
212
213
214 /* In libgcc2, determine target settings as compile-time constants.  */
215 #ifdef IN_LIBGCC2
216 #undef TARGET_64BIT
217 #ifdef __s390x__
218 #define TARGET_64BIT 1
219 #else
220 #define TARGET_64BIT 0
221 #endif
222 #endif
223
224
225 /* Target machine storage layout.  */
226
227 /* Everything is big-endian.  */
228 #define BITS_BIG_ENDIAN 1
229 #define BYTES_BIG_ENDIAN 1
230 #define WORDS_BIG_ENDIAN 1
231
232 /* Width of a word, in units (bytes).  */
233 #define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4)
234 #ifndef IN_LIBGCC2
235 #define MIN_UNITS_PER_WORD 4
236 #endif
237 #define MAX_BITS_PER_WORD 64
238
239 /* Function arguments and return values are promoted to word size.  */
240 #define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE)            \
241 if (INTEGRAL_MODE_P (MODE) &&                           \
242     GET_MODE_SIZE (MODE) < UNITS_PER_WORD) {            \
243   (MODE) = Pmode;                                       \
244           }
245
246 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
247 #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)
248
249 /* Boundary (in *bits*) on which stack pointer should be aligned.  */
250 #define STACK_BOUNDARY 64
251
252 /* Allocation boundary (in *bits*) for the code of a function.  */
253 #define FUNCTION_BOUNDARY 32
254
255 /* There is no point aligning anything to a rounder boundary than this.  */
256 #define BIGGEST_ALIGNMENT 64
257
258 /* Alignment of field after `int : 0' in a structure.  */
259 #define EMPTY_FIELD_BOUNDARY 32
260
261 /* Alignment on even addresses for LARL instruction.  */
262 #define CONSTANT_ALIGNMENT(EXP, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
263 #define DATA_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
264
265 /* Alignment is not required by the hardware.  */
266 #define STRICT_ALIGNMENT 0
267
268 /* Mode of stack savearea.
269    FUNCTION is VOIDmode because calling convention maintains SP.
270    BLOCK needs Pmode for SP.
271    NONLOCAL needs twice Pmode to maintain both backchain and SP.  */
272 #define STACK_SAVEAREA_MODE(LEVEL)      \
273   (LEVEL == SAVE_FUNCTION ? VOIDmode    \
274   : LEVEL == SAVE_NONLOCAL ? (TARGET_64BIT ? OImode : TImode) : Pmode)
275
276 /* Define target floating point format.  */
277 #define TARGET_FLOAT_FORMAT \
278   (TARGET_IEEE_FLOAT? IEEE_FLOAT_FORMAT : IBM_FLOAT_FORMAT)
279
280
281 /* Type layout.  */
282
283 /* Sizes in bits of the source language data types.  */
284 #define SHORT_TYPE_SIZE 16
285 #define INT_TYPE_SIZE 32
286 #define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32)
287 #define LONG_LONG_TYPE_SIZE 64
288 #define FLOAT_TYPE_SIZE 32
289 #define DOUBLE_TYPE_SIZE 64
290 #define LONG_DOUBLE_TYPE_SIZE 64  /* ??? Should support extended format.  */
291
292 /* We use "unsigned char" as default.  */
293 #define DEFAULT_SIGNED_CHAR 0
294
295
296 /* Register usage.  */
297
298 /* We have 16 general purpose registers (registers 0-15),
299    and 16 floating point registers (registers 16-31).
300    (On non-IEEE machines, we have only 4 fp registers.)
301
302    Amongst the general purpose registers, some are used
303    for specific purposes:
304    GPR 11: Hard frame pointer (if needed)
305    GPR 12: Global offset table pointer (if needed)
306    GPR 13: Literal pool base register
307    GPR 14: Return address register
308    GPR 15: Stack pointer
309
310    Registers 32-34 are 'fake' hard registers that do not
311    correspond to actual hardware:
312    Reg 32: Argument pointer
313    Reg 33: Condition code
314    Reg 34: Frame pointer  */
315
316 #define FIRST_PSEUDO_REGISTER 36
317
318 /* Standard register usage.  */
319 #define GENERAL_REGNO_P(N)      ((int)(N) >= 0 && (N) < 16)
320 #define ADDR_REGNO_P(N)         ((N) >= 1 && (N) < 16)
321 #define FP_REGNO_P(N)           ((N) >= 16 && (N) < (TARGET_IEEE_FLOAT? 32 : 20))
322 #define CC_REGNO_P(N)           ((N) == 33)
323 #define FRAME_REGNO_P(N)        ((N) == 32 || (N) == 34 || (N) == 35)
324
325 #define GENERAL_REG_P(X)        (REG_P (X) && GENERAL_REGNO_P (REGNO (X)))
326 #define ADDR_REG_P(X)           (REG_P (X) && ADDR_REGNO_P (REGNO (X)))
327 #define FP_REG_P(X)             (REG_P (X) && FP_REGNO_P (REGNO (X)))
328 #define CC_REG_P(X)             (REG_P (X) && CC_REGNO_P (REGNO (X)))
329 #define FRAME_REG_P(X)          (REG_P (X) && FRAME_REGNO_P (REGNO (X)))
330
331 #define SIBCALL_REGNUM 1
332 #define BASE_REGNUM 13
333 #define RETURN_REGNUM 14
334 #define CC_REGNUM 33
335
336 /* Set up fixed registers and calling convention:
337
338    GPRs 0-5 are always call-clobbered,
339    GPRs 6-15 are always call-saved.
340    GPR 12 is fixed if used as GOT pointer.
341    GPR 13 is always fixed (as literal pool pointer).
342    GPR 14 is always fixed on S/390 machines (as return address).
343    GPR 15 is always fixed (as stack pointer).
344    The 'fake' hard registers are call-clobbered and fixed.
345
346    On 31-bit, FPRs 18-19 are call-clobbered;
347    on 64-bit, FPRs 24-31 are call-clobbered.
348    The remaining FPRs are call-saved.  */
349
350 #define FIXED_REGISTERS                         \
351 { 0, 0, 0, 0,                                   \
352   0, 0, 0, 0,                                   \
353   0, 0, 0, 0,                                   \
354   0, 1, 1, 1,                                   \
355   0, 0, 0, 0,                                   \
356   0, 0, 0, 0,                                   \
357   0, 0, 0, 0,                                   \
358   0, 0, 0, 0,                                   \
359   1, 1, 1, 1 }
360
361 #define CALL_USED_REGISTERS                     \
362 { 1, 1, 1, 1,                                   \
363   1, 1, 0, 0,                                   \
364   0, 0, 0, 0,                                   \
365   0, 1, 1, 1,                                   \
366   1, 1, 1, 1,                                   \
367   1, 1, 1, 1,                                   \
368   1, 1, 1, 1,                                   \
369   1, 1, 1, 1,                                   \
370   1, 1, 1, 1 }
371
372 #define CALL_REALLY_USED_REGISTERS              \
373 { 1, 1, 1, 1,                                   \
374   1, 1, 0, 0,                                   \
375   0, 0, 0, 0,                                   \
376   0, 0, 0, 0,                                   \
377   1, 1, 1, 1,                                   \
378   1, 1, 1, 1,                                   \
379   1, 1, 1, 1,                                   \
380   1, 1, 1, 1,                                   \
381   1, 1, 1, 1 }
382
383 #define CONDITIONAL_REGISTER_USAGE s390_conditional_register_usage ()
384
385 /* Preferred register allocation order.  */
386 #define REG_ALLOC_ORDER                                         \
387 {  1, 2, 3, 4, 5, 0, 13, 12, 11, 10, 9, 8, 7, 6, 14,            \
388    16, 17, 18, 19, 20, 21, 22, 23,                              \
389    24, 25, 26, 27, 28, 29, 30, 31,                              \
390    15, 32, 33, 34, 35 }
391
392
393 /* Fitting values into registers.  */
394
395 /* Integer modes <= word size fit into any GPR.
396    Integer modes > word size fit into successive GPRs, starting with
397    an even-numbered register.
398    SImode and DImode fit into FPRs as well.
399
400    Floating point modes <= word size fit into any FPR or GPR.
401    Floating point modes > word size (i.e. DFmode on 32-bit) fit
402    into any FPR, or an even-odd GPR pair.
403
404    Complex floating point modes fit either into two FPRs, or into
405    successive GPRs (again starting with an even number).
406
407    Condition code modes fit only into the CC register.  */
408
409 #define HARD_REGNO_NREGS(REGNO, MODE)                           \
410   (FP_REGNO_P(REGNO)?                                           \
411     (GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) :      \
412    GENERAL_REGNO_P(REGNO)?                                      \
413     ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : \
414    1)
415
416 #define HARD_REGNO_MODE_OK(REGNO, MODE)                             \
417   (FP_REGNO_P(REGNO)?                                               \
418    ((MODE) == SImode || (MODE) == DImode ||                         \
419     GET_MODE_CLASS(MODE) == MODE_FLOAT ||                           \
420     GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT) :                   \
421    GENERAL_REGNO_P(REGNO)?                                          \
422     (HARD_REGNO_NREGS(REGNO, MODE) == 1 || !((REGNO) & 1)) :        \
423    CC_REGNO_P(REGNO)?                                               \
424      GET_MODE_CLASS (MODE) == MODE_CC :                             \
425    FRAME_REGNO_P(REGNO)?                                            \
426      (enum machine_mode) (MODE) == Pmode :                          \
427    0)
428
429 #define MODES_TIEABLE_P(MODE1, MODE2)           \
430    (((MODE1) == SFmode || (MODE1) == DFmode)    \
431    == ((MODE2) == SFmode || (MODE2) == DFmode))
432
433 /* Maximum number of registers to represent a value of mode MODE
434    in a register of class CLASS.  */
435 #define CLASS_MAX_NREGS(CLASS, MODE)                                    \
436      ((CLASS) == FP_REGS ?                                              \
437       (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) :           \
438       (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
439
440 /* If a 4-byte value is loaded into a FPR, it is placed into the
441    *upper* half of the register, not the lower.  Therefore, we
442    cannot use SUBREGs to switch between modes in FP registers.  */
443 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)               \
444   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)                   \
445    ? reg_classes_intersect_p (FP_REGS, CLASS) : 0)
446
447 /* Register classes.  */
448
449 /* We use the following register classes:
450    GENERAL_REGS     All general purpose registers
451    ADDR_REGS        All general purpose registers except %r0
452                     (These registers can be used in address generation)
453    FP_REGS          All floating point registers
454
455    GENERAL_FP_REGS  Union of GENERAL_REGS and FP_REGS
456    ADDR_FP_REGS     Union of ADDR_REGS and FP_REGS
457
458    NO_REGS          No registers
459    ALL_REGS         All registers
460
461    Note that the 'fake' frame pointer and argument pointer registers
462    are included amongst the address registers here.  The condition
463    code register is only included in ALL_REGS.  */
464
465 enum reg_class
466 {
467   NO_REGS, ADDR_REGS, GENERAL_REGS,
468   FP_REGS, ADDR_FP_REGS, GENERAL_FP_REGS,
469   ALL_REGS, LIM_REG_CLASSES
470 };
471 #define N_REG_CLASSES (int) LIM_REG_CLASSES
472
473 #define REG_CLASS_NAMES                                                 \
474 { "NO_REGS", "ADDR_REGS", "GENERAL_REGS",                               \
475   "FP_REGS", "ADDR_FP_REGS", "GENERAL_FP_REGS", "ALL_REGS" }
476
477 /* Class -> register mapping.  */
478 #define REG_CLASS_CONTENTS \
479 {                                                       \
480   { 0x00000000, 0x00000000 },   /* NO_REGS */           \
481   { 0x0000fffe, 0x0000000d },   /* ADDR_REGS */         \
482   { 0x0000ffff, 0x0000000d },   /* GENERAL_REGS */      \
483   { 0xffff0000, 0x00000000 },   /* FP_REGS */           \
484   { 0xfffffffe, 0x0000000d },   /* ADDR_FP_REGS */      \
485   { 0xffffffff, 0x0000000d },   /* GENERAL_FP_REGS */   \
486   { 0xffffffff, 0x0000000f },   /* ALL_REGS */          \
487 }
488
489 /* Register -> class mapping.  */
490 extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
491 #define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])
492
493 /* ADDR_REGS can be used as base or index register.  */
494 #define INDEX_REG_CLASS ADDR_REGS
495 #define BASE_REG_CLASS ADDR_REGS
496
497 /* Check whether REGNO is a hard register of the suitable class
498    or a pseudo register currently allocated to one such.  */
499 #define REGNO_OK_FOR_INDEX_P(REGNO)                                     \
500     (((REGNO) < FIRST_PSEUDO_REGISTER                                   \
501      && REGNO_REG_CLASS ((REGNO)) == ADDR_REGS)                         \
502     || (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16))
503 #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
504
505
506 /* Given an rtx X being reloaded into a reg required to be in class CLASS,
507    return the class of reg to actually use.  */
508 #define PREFERRED_RELOAD_CLASS(X, CLASS)        \
509   s390_preferred_reload_class ((X), (CLASS))
510
511 /* We need a secondary reload when loading a PLUS which is
512    not a valid operand for LOAD ADDRESS.  */
513 #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, IN)   \
514   s390_secondary_input_reload_class ((CLASS), (MODE), (IN))
515
516 /* We need a secondary reload when storing a double-word
517    to a non-offsettable memory address.  */
518 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, OUT) \
519   s390_secondary_output_reload_class ((CLASS), (MODE), (OUT))
520
521 /* We need secondary memory to move data between GPRs and FPRs.  */
522 #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
523  ((CLASS1) != (CLASS2) && ((CLASS1) == FP_REGS || (CLASS2) == FP_REGS))
524
525 /* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on 64bit
526    because the movsi and movsf patterns don't handle r/f moves.  */
527 #define SECONDARY_MEMORY_NEEDED_MODE(MODE)              \
528  (GET_MODE_BITSIZE (MODE) < 32                          \
529   ? mode_for_size (32, GET_MODE_CLASS (MODE), 0)        \
530   : MODE)
531
532
533 /* Define various machine-dependent constraint letters.  */
534
535 #define REG_CLASS_FROM_LETTER(C)                                        \
536   ((C) == 'a' ? ADDR_REGS :                                             \
537    (C) == 'd' ? GENERAL_REGS :                                          \
538    (C) == 'f' ? FP_REGS : NO_REGS)
539
540 #define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR)                          \
541   s390_const_ok_for_constraint_p ((VALUE), (C), (STR))
542
543 #define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(VALUE, C, STR)  1
544
545 #define EXTRA_CONSTRAINT_STR(OP, C, STR)                                \
546   s390_extra_constraint_str ((OP), (C), (STR))
547 #define EXTRA_MEMORY_CONSTRAINT(C, STR)                                 \
548   ((C) == 'Q' || (C) == 'R' || (C) == 'S' || (C) == 'T' || (C) == 'A')
549 #define EXTRA_ADDRESS_CONSTRAINT(C, STR)                                \
550   ((C) == 'U' || (C) == 'W' || (C) == 'Y')
551
552 #define CONSTRAINT_LEN(C, STR)                                          \
553   ((C) == 'N' ? 5 :                                                     \
554    (C) == 'A' ? 2 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
555
556 /* Stack layout and calling conventions.  */
557
558 /* Our stack grows from higher to lower addresses.  However, local variables
559    are accessed by positive offsets, and function arguments are stored at
560    increasing addresses.  */
561 #define STACK_GROWS_DOWNWARD
562 /* #undef FRAME_GROWS_DOWNWARD */
563 /* #undef ARGS_GROW_DOWNWARD */
564
565 /* The basic stack layout looks like this: the stack pointer points
566    to the register save area for called functions.  Above that area
567    is the location to place outgoing arguments.  Above those follow
568    dynamic allocations (alloca), and finally the local variables.  */
569
570 /* Offset from stack-pointer to first location of outgoing args.  */
571 #define STACK_POINTER_OFFSET (TARGET_64BIT ? 160 : 96)
572
573 /* Offset within stack frame to start allocating local variables at.  */
574 extern int current_function_outgoing_args_size;
575 #define STARTING_FRAME_OFFSET \
576      (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
577
578 /* Offset from the stack pointer register to an item dynamically
579    allocated on the stack, e.g., by `alloca'.  */
580 #define STACK_DYNAMIC_OFFSET(FUNDECL) (STARTING_FRAME_OFFSET)
581
582 /* Offset of first parameter from the argument pointer register value.
583    We have a fake argument pointer register that points directly to
584    the argument area.  */
585 #define FIRST_PARM_OFFSET(FNDECL) 0
586
587 /* The return address of the current frame is retrieved
588    from the initial value of register RETURN_REGNUM.
589    For frames farther back, we use the stack slot where
590    the corresponding RETURN_REGNUM register was saved.  */
591
592 #define DYNAMIC_CHAIN_ADDRESS(FRAME)                                            \
593   (TARGET_BACKCHAIN ?                                                           \
594    ((FRAME) != hard_frame_pointer_rtx ? (FRAME) :                               \
595     plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)) :                   \
596     ((FRAME) != hard_frame_pointer_rtx ?                                        \
597      plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) :           \
598      plus_constant (arg_pointer_rtx, -UNITS_PER_WORD)))
599
600 #define RETURN_ADDR_RTX(COUNT, FRAME)                                           \
601   s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME)))
602
603 /* In 31-bit mode, we need to mask off the high bit of return addresses.  */
604 #define MASK_RETURN_ADDR (TARGET_64BIT ? constm1_rtx : GEN_INT (0x7fffffff))
605
606
607 /* Exception handling.  */
608
609 /* Describe calling conventions for DWARF-2 exception handling.  */
610 #define INCOMING_RETURN_ADDR_RTX  gen_rtx_REG (Pmode, RETURN_REGNUM)
611 #define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET
612 #define DWARF_FRAME_RETURN_COLUMN  14
613
614 /* Describe how we implement __builtin_eh_return.  */
615 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM)
616 #define EH_RETURN_HANDLER_RTX gen_rtx_MEM (Pmode, return_address_pointer_rtx)
617        
618 /* Select a format to encode pointers in exception handling data.  */
619 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL)                          \
620   (flag_pic                                                                 \
621     ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
622    : DW_EH_PE_absptr)
623
624
625 /* Frame registers.  */
626
627 #define STACK_POINTER_REGNUM 15
628 #define FRAME_POINTER_REGNUM 34
629 #define HARD_FRAME_POINTER_REGNUM 11
630 #define ARG_POINTER_REGNUM 32
631 #define RETURN_ADDRESS_POINTER_REGNUM 35
632
633 /* The static chain must be call-clobbered, but not used for
634    function argument passing.  As register 1 is clobbered by
635    the trampoline code, we only have one option.  */
636 #define STATIC_CHAIN_REGNUM 0
637
638 /* Number of hardware registers that go into the DWARF-2 unwind info.
639    To avoid ABI incompatibility, this number must not change even as
640    'fake' hard registers are added or removed.  */
641 #define DWARF_FRAME_REGISTERS 34
642
643
644 /* Frame pointer and argument pointer elimination.  */
645
646 #define FRAME_POINTER_REQUIRED 0
647
648 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0
649
650 #define ELIMINABLE_REGS                                      \
651 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},              \
652  { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},         \
653  { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},                \
654  { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},           \
655  { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM},     \
656  { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
657
658 #define CAN_ELIMINATE(FROM, TO) \
659   s390_can_eliminate ((FROM), (TO))
660
661 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
662   (OFFSET) = s390_initial_elimination_offset ((FROM), (TO))
663
664
665 /* Stack arguments.  */
666
667 /* We need current_function_outgoing_args to be valid.  */
668 #define ACCUMULATE_OUTGOING_ARGS 1
669
670 /* Return doesn't modify the stack.  */
671 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
672
673
674 /* Register arguments.  */
675
676 typedef struct s390_arg_structure
677 {
678   int gprs;                     /* gpr so far */
679   int fprs;                     /* fpr so far */
680 }
681 CUMULATIVE_ARGS;
682
683 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, NN, N_NAMED_ARGS) \
684   ((CUM).gprs=0, (CUM).fprs=0)
685
686 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                    \
687   s390_function_arg_advance (&CUM, MODE, TYPE, NAMED)
688
689 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)   \
690   s390_function_arg (&CUM, MODE, TYPE, NAMED)
691
692 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
693
694 /* Arguments can be placed in general registers 2 to 6,
695    or in floating point registers 0 and 2.  */
696 #define FUNCTION_ARG_REGNO_P(N) (((N) >=2 && (N) <7) || \
697                                  (N) == 16 || (N) == 17)
698
699
700 /* Scalar return values.  */
701
702 #define FUNCTION_VALUE(VALTYPE, FUNC) \
703   s390_function_value ((VALTYPE), VOIDmode)
704
705 #define LIBCALL_VALUE(MODE) \
706   s390_function_value (NULL, (MODE))
707
708 /* Only gpr 2 and fpr 0 are ever used as return registers.  */
709 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16)
710
711
712 /* Function entry and exit.  */
713
714 /* When returning from a function, the stack pointer does not matter.  */
715 #define EXIT_IGNORE_STACK       1
716
717
718 /* Profiling.  */
719
720 #define FUNCTION_PROFILER(FILE, LABELNO)                        \
721   s390_function_profiler ((FILE), ((LABELNO)))
722
723 #define PROFILE_BEFORE_PROLOGUE 1
724
725
726 /* Implementing the varargs macros.  */
727
728 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
729   s390_va_start (valist, nextarg)
730
731 /* Trampolines for nested functions.  */
732
733 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 36 : 20)
734
735 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT)                       \
736    s390_initialize_trampoline ((ADDR), (FNADDR), (CXT))
737
738 #define TRAMPOLINE_TEMPLATE(FILE)                                       \
739    s390_trampoline_template (FILE)
740
741
742 /* Addressing modes, and classification of registers for them.  */
743
744 /* Recognize any constant value that is a valid address.  */
745 #define CONSTANT_ADDRESS_P(X) 0
746
747 /* Maximum number of registers that can appear in a valid memory address.  */
748 #define MAX_REGS_PER_ADDRESS 2
749
750 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check
751    its validity for a certain class.  We have two alternate definitions
752    for each of them.  The usual definition accepts all pseudo regs; the
753    other rejects them all.  The symbol REG_OK_STRICT causes the latter
754    definition to be used.
755
756    Most source files want to accept pseudo regs in the hope that they will
757    get allocated to the class that the insn wants them to be in.
758    Some source files that are used after register allocation
759    need to be strict.  */
760
761 #define REG_OK_FOR_INDEX_NONSTRICT_P(X)         \
762 ((GET_MODE (X) == Pmode) &&                     \
763  ((REGNO (X) >= FIRST_PSEUDO_REGISTER)          \
764   || REGNO_REG_CLASS (REGNO (X)) == ADDR_REGS))
765
766 #define REG_OK_FOR_BASE_NONSTRICT_P(X)    REG_OK_FOR_INDEX_NONSTRICT_P (X)
767
768 #define REG_OK_FOR_INDEX_STRICT_P(X)                            \
769 ((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_INDEX_P (REGNO (X))))
770
771 #define REG_OK_FOR_BASE_STRICT_P(X)                             \
772 ((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_BASE_P (REGNO (X))))
773
774 #ifndef REG_OK_STRICT
775 #define REG_OK_FOR_INDEX_P(X)  REG_OK_FOR_INDEX_NONSTRICT_P(X)
776 #define REG_OK_FOR_BASE_P(X)   REG_OK_FOR_BASE_NONSTRICT_P(X)
777 #else
778 #define REG_OK_FOR_INDEX_P(X)  REG_OK_FOR_INDEX_STRICT_P(X)
779 #define REG_OK_FOR_BASE_P(X)   REG_OK_FOR_BASE_STRICT_P(X)
780 #endif
781
782 /* S/390 has no mode dependent addresses.  */
783 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
784
785 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
786    valid memory address for an instruction.
787    The MODE argument is the machine mode for the MEM expression
788    that wants to use this address.  */
789 #ifdef REG_OK_STRICT
790 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                         \
791 {                                                                       \
792   if (legitimate_address_p (MODE, X, 1))                                \
793     goto ADDR;                                                          \
794 }
795 #else
796 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                         \
797 {                                                                       \
798   if (legitimate_address_p (MODE, X, 0))                                \
799     goto ADDR;                                                          \
800 }
801 #endif
802
803 /* Try machine-dependent ways of modifying an illegitimate address
804    to be legitimate.  If we find one, return the new, valid address.
805    This macro is used in only one place: `memory_address' in explow.c.  */
806 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)                          \
807 {                                                                       \
808   (X) = legitimize_address (X, OLDX, MODE);                             \
809   if (memory_address_p (MODE, X))                                       \
810     goto WIN;                                                           \
811 }
812
813 /* Try a machine-dependent way of reloading an illegitimate address
814    operand.  If we find one, push the reload and jump to WIN.  This
815    macro is used in only one place: `find_reloads_address' in reload.c.  */
816 #define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN)      \
817 do {                                                                    \
818   rtx new = legitimize_reload_address (AD, MODE, OPNUM, (int)(TYPE));   \
819   if (new)                                                              \
820     {                                                                   \
821       (AD) = new;                                                       \
822       goto WIN;                                                         \
823     }                                                                   \
824 } while (0)
825
826 /* Nonzero if the constant value X is a legitimate general operand.
827    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
828 #define LEGITIMATE_CONSTANT_P(X) \
829      legitimate_constant_p (X)
830
831 /* Helper macro for s390.c and s390.md to check for symbolic constants.  */
832 #define SYMBOLIC_CONST(X)       \
833 (GET_CODE (X) == SYMBOL_REF                                             \
834  || GET_CODE (X) == LABEL_REF                                           \
835  || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
836
837 #define TLS_SYMBOLIC_CONST(X)   \
838 ((GET_CODE (X) == SYMBOL_REF && tls_symbolic_operand (X))       \
839  || (GET_CODE (X) == CONST && tls_symbolic_reference_mentioned_p (X)))
840
841
842 /* Condition codes.  */
843
844 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
845    return the mode to be used for the comparison.  */
846 #define SELECT_CC_MODE(OP, X, Y) s390_select_ccmode ((OP), (X), (Y))
847
848 /* Canonicalize a comparison from one we don't have to one we do have.  */
849 #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \
850   s390_canonicalize_comparison (&(CODE), &(OP0), &(OP1))
851
852 /* Define the information needed to generate branch and scc insns.  This is
853    stored from the compare operation.  Note that we can't use "rtx" here
854    since it hasn't been defined!  */
855 extern struct rtx_def *s390_compare_op0, *s390_compare_op1;
856
857
858 /* Relative costs of operations.  */
859
860 /* On s390, copy between fprs and gprs is expensive.  */
861 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2)                        \
862   ((   (   reg_classes_intersect_p ((CLASS1), GENERAL_REGS)             \
863         && reg_classes_intersect_p ((CLASS2), FP_REGS))                 \
864     || (   reg_classes_intersect_p ((CLASS1), FP_REGS)                  \
865         && reg_classes_intersect_p ((CLASS2), GENERAL_REGS))) ? 10 : 1)
866
867 /* A C expression for the cost of moving data of mode M between a
868    register and memory.  A value of 2 is the default; this cost is
869    relative to those in `REGISTER_MOVE_COST'.  */
870 #define MEMORY_MOVE_COST(M, C, I) 1
871
872 /* A C expression for the cost of a branch instruction.  A value of 1
873    is the default; other values are interpreted relative to that.  */
874 #define BRANCH_COST 1
875
876 /* Nonzero if access to memory by bytes is slow and undesirable.  */
877 #define SLOW_BYTE_ACCESS 1
878
879 /* An integer expression for the size in bits of the largest integer machine
880    mode that should actually be used.  We allow pairs of registers.  */ 
881 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode)
882
883 /* The maximum number of bytes that a single instruction can move quickly
884    between memory and registers or between two memory locations.  */
885 #define MOVE_MAX (TARGET_64BIT ? 16 : 8)
886 #define MOVE_MAX_PIECES (TARGET_64BIT ? 8 : 4)
887 #define MAX_MOVE_MAX 16
888
889 /* Determine whether to use move_by_pieces or block move insn.  */
890 #define MOVE_BY_PIECES_P(SIZE, ALIGN)           \
891   ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4   \
892     || (TARGET_64BIT && (SIZE) == 8) )
893
894 /* Determine whether to use clear_by_pieces or block clear insn.  */
895 #define CLEAR_BY_PIECES_P(SIZE, ALIGN)          \
896   ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4   \
897     || (TARGET_64BIT && (SIZE) == 8) )
898
899 /* This macro is used to determine whether store_by_pieces should be
900    called to "memset" storage with byte values other than zero, or
901    to "memcpy" storage when the source is a constant string.  */
902 #define STORE_BY_PIECES_P(SIZE, ALIGN) MOVE_BY_PIECES_P (SIZE, ALIGN)
903
904 /* Don't perform CSE on function addresses.  */
905 #define NO_FUNCTION_CSE
906
907
908 /* Sections.  */
909
910 /* Output before read-only data.  */
911 #define TEXT_SECTION_ASM_OP ".text"
912
913 /* Output before writable (initialized) data.  */
914 #define DATA_SECTION_ASM_OP ".data"
915
916 /* Output before writable (uninitialized) data.  */
917 #define BSS_SECTION_ASM_OP ".bss"
918
919 /* S/390 constant pool breaks the devices in crtstuff.c to control section
920    in where code resides.  We have to write it as asm code.  */
921 #ifndef __s390x__
922 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
923     asm (SECTION_OP "\n\
924         bras\t%r2,1f\n\
925 0:      .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\
926 1:      l\t%r3,0(%r2)\n\
927         bas\t%r14,0(%r3,%r2)\n\
928         .previous");
929 #endif
930
931
932 /* Position independent code.  */
933
934 extern int flag_pic;
935
936 #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 12 : INVALID_REGNUM)
937
938 #define LEGITIMATE_PIC_OPERAND_P(X)  legitimate_pic_operand_p (X)
939
940
941 /* Assembler file format.  */
942
943 /* Character to start a comment.  */
944 #define ASM_COMMENT_START "#"
945
946 /* Declare an uninitialized external linkage data object.  */
947 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
948   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
949
950 /* Globalizing directive for a label.  */
951 #define GLOBAL_ASM_OP ".globl "
952
953 /* Advance the location counter to a multiple of 2**LOG bytes.  */
954 #define ASM_OUTPUT_ALIGN(FILE, LOG) \
955   if ((LOG)) fprintf ((FILE), "\t.align\t%d\n", 1 << (LOG))
956
957 /* Advance the location counter by SIZE bytes.  */
958 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
959   fprintf ((FILE), "\t.set\t.,.+"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE))
960
961 /* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
962 #define LOCAL_LABEL_PREFIX "."
963
964 /* How to refer to registers in assembler output.  This sequence is
965    indexed by compiler's hard-register-number (see above).  */
966 #define REGISTER_NAMES                                                  \
967 { "%r0",  "%r1",  "%r2",  "%r3",  "%r4",  "%r5",  "%r6",  "%r7",        \
968   "%r8",  "%r9",  "%r10", "%r11", "%r12", "%r13", "%r14", "%r15",       \
969   "%f0",  "%f2",  "%f4",  "%f6",  "%f1",  "%f3",  "%f5",  "%f7",        \
970   "%f8",  "%f10", "%f12", "%f14", "%f9",  "%f11", "%f13", "%f15",       \
971   "%ap",  "%cc",  "%fp",  "%rp"                                         \
972 }
973
974 /* Emit a dtp-relative reference to a TLS variable.  */
975
976 #ifdef HAVE_AS_TLS
977 #define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \
978   s390_output_dwarf_dtprel (FILE, SIZE, X)
979 #endif
980
981 /* Print operand X (an rtx) in assembler syntax to file FILE.  */
982 #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
983 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
984
985 /* Output machine-dependent UNSPECs in address constants.  */
986 #define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL)          \
987 do {                                                    \
988   if (!s390_output_addr_const_extra (FILE, (X)))        \
989     goto FAIL;                                          \
990 } while (0);
991
992 /* Output an element of a case-vector that is absolute.  */
993 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)                            \
994 do {                                                                    \
995   char buf[32];                                                         \
996   fputs (integer_asm_op (UNITS_PER_WORD, TRUE), (FILE));                \
997   ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE));                      \
998   assemble_name ((FILE), buf);                                          \
999   fputc ('\n', (FILE));                                                 \
1000 } while (0)
1001
1002 /* Output an element of a case-vector that is relative.  */
1003 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)                \
1004 do {                                                                    \
1005   char buf[32];                                                         \
1006   fputs (integer_asm_op (UNITS_PER_WORD, TRUE), (FILE));                \
1007   ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE));                      \
1008   assemble_name ((FILE), buf);                                          \
1009   fputc ('-', (FILE));                                                  \
1010   ASM_GENERATE_INTERNAL_LABEL (buf, "L", (REL));                        \
1011   assemble_name ((FILE), buf);                                          \
1012   fputc ('\n', (FILE));                                                 \
1013 } while (0)
1014
1015
1016 /* Miscellaneous parameters.  */
1017
1018 /* Define the codes that are matched by predicates in aux-output.c.  */
1019 #define PREDICATE_CODES                                                 \
1020   {"s_operand",       { SUBREG, MEM }},                                 \
1021   {"shift_count_operand", { REG, SUBREG, PLUS, CONST_INT }},            \
1022   {"bras_sym_operand",{ SYMBOL_REF, CONST }},                           \
1023   {"larl_operand",    { SYMBOL_REF, CONST, CONST_INT, CONST_DOUBLE }},  \
1024   {"load_multiple_operation", {PARALLEL}},                              \
1025   {"store_multiple_operation", {PARALLEL}},                             \
1026   {"const0_operand",  { CONST_INT, CONST_DOUBLE }},                     \
1027   {"consttable_operand", { SYMBOL_REF, LABEL_REF, CONST,                \
1028                            CONST_INT, CONST_DOUBLE }},                  \
1029   {"s390_plus_operand", { PLUS }},                                      \
1030   {"s390_comparison",     { EQ, NE, LT, GT, LE, GE, LTU, GTU, LEU, GEU, \
1031                             UNEQ, UNLT, UNGT, UNLE, UNGE, LTGT,         \
1032                             UNORDERED, ORDERED }},                      \
1033   {"s390_alc_comparison", { ZERO_EXTEND, SIGN_EXTEND,                   \
1034                             LTU, GTU, LEU, GEU }},                      \
1035   {"s390_slb_comparison", { ZERO_EXTEND, SIGN_EXTEND,                   \
1036                             LTU, GTU, LEU, GEU }},
1037
1038 /* Specify the machine mode that this machine uses for the index in the
1039    tablejump instruction.  */
1040 #define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode)
1041
1042 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1043    is done just by pretending it is already truncated.  */
1044 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC)  1
1045
1046 /* Specify the machine mode that pointers have.
1047    After generation of rtl, the compiler makes no further distinction
1048    between pointers and any other objects of this machine mode.  */
1049 #define Pmode ((enum machine_mode) (TARGET_64BIT ? DImode : SImode))
1050
1051 /* This is -1 for "pointer mode" extend.  See ptr_extend in s390.md.  */
1052 #define POINTERS_EXTEND_UNSIGNED -1
1053
1054 /* A function address in a call instruction is a byte address (for
1055    indexing purposes) so give the MEM rtx a byte's mode.  */
1056 #define FUNCTION_MODE QImode
1057
1058 #endif