OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [config/] [v850/] [v850.h] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* Definitions of target machine for GNU compiler. NEC V850 series
2
   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3
   2007 Free Software Foundation, Inc.
4
   Contributed by Jeff Law (law@cygnus.com).
5
 
6
   This file is part of GCC.
7
 
8
   GCC is free software; you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation; either version 3, or (at your option)
11
   any later version.
12
 
13
   GCC is distributed in the hope that it will be useful,
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
   GNU General Public License for more details.
17
 
18
   You should have received a copy of the GNU General Public License
19
   along with GCC; see the file COPYING3.  If not see
20
   <http://www.gnu.org/licenses/>.  */
21
 
22
#ifndef GCC_V850_H
23
#define GCC_V850_H
24
 
25
/* These are defined in svr4.h but we want to override them.  */
26
#undef LIB_SPEC
27
#undef ENDFILE_SPEC
28
#undef LINK_SPEC
29
#undef STARTFILE_SPEC
30
#undef ASM_SPEC
31
 
32
#define TARGET_CPU_generic      1
33
#define TARGET_CPU_v850e        2
34
#define TARGET_CPU_v850e1       3
35
 
36
#ifndef TARGET_CPU_DEFAULT
37
#define TARGET_CPU_DEFAULT      TARGET_CPU_generic
38
#endif
39
 
40
#define MASK_DEFAULT            MASK_V850
41
#define SUBTARGET_ASM_SPEC      "%{!mv*:-mv850}"
42
#define SUBTARGET_CPP_SPEC      "%{!mv*:-D__v850__}"
43
#define TARGET_VERSION          fprintf (stderr, " (NEC V850)");
44
 
45
/* Choose which processor will be the default.
46
   We must pass a -mv850xx option to the assembler if no explicit -mv* option
47
   is given, because the assembler's processor default may not be correct.  */
48
#if TARGET_CPU_DEFAULT == TARGET_CPU_v850e
49
#undef  MASK_DEFAULT
50
#define MASK_DEFAULT            MASK_V850E
51
#undef  SUBTARGET_ASM_SPEC
52
#define SUBTARGET_ASM_SPEC      "%{!mv*:-mv850e}"
53
#undef  SUBTARGET_CPP_SPEC
54
#define SUBTARGET_CPP_SPEC      "%{!mv*:-D__v850e__}"
55
#undef  TARGET_VERSION
56
#define TARGET_VERSION          fprintf (stderr, " (NEC V850E)");
57
#endif
58
 
59
#if TARGET_CPU_DEFAULT == TARGET_CPU_v850e1
60
#undef  MASK_DEFAULT
61
#define MASK_DEFAULT            MASK_V850E      /* No practical difference.  */
62
#undef  SUBTARGET_ASM_SPEC
63
#define SUBTARGET_ASM_SPEC      "%{!mv*:-mv850e1}"
64
#undef  SUBTARGET_CPP_SPEC
65
#define SUBTARGET_CPP_SPEC      "%{!mv*:-D__v850e1__} %{mv850e1:-D__v850e1__}"
66
#undef  TARGET_VERSION
67
#define TARGET_VERSION          fprintf (stderr, " (NEC V850E1)");
68
#endif
69
 
70
#define ASM_SPEC "%{mv*:-mv%*}"
71
#define CPP_SPEC                "%{mv850e:-D__v850e__} %{mv850:-D__v850__} %(subtarget_cpp_spec)"
72
 
73
#define EXTRA_SPECS \
74
 { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \
75
 { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }
76
 
77
/* Names to predefine in the preprocessor for this target machine.  */
78
#define TARGET_CPU_CPP_BUILTINS() do {          \
79
  builtin_define( "__v851__" );                 \
80
  builtin_define( "__v850" );                   \
81
  builtin_assert( "machine=v850" );             \
82
  builtin_assert( "cpu=v850" );                 \
83
  if (TARGET_EP)                                \
84
    builtin_define ("__EP__");                  \
85
} while(0)
86
 
87
#define MASK_CPU (MASK_V850 | MASK_V850E)
88
 
89
/* Information about the various small memory areas.  */
90
struct small_memory_info {
91
  const char *name;
92
  long max;
93
  long physical_max;
94
};
95
 
96
enum small_memory_type {
97
  /* tiny data area, using EP as base register */
98
  SMALL_MEMORY_TDA = 0,
99
  /* small data area using dp as base register */
100
  SMALL_MEMORY_SDA,
101
  /* zero data area using r0 as base register */
102
  SMALL_MEMORY_ZDA,
103
  SMALL_MEMORY_max
104
};
105
 
106
extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max];
107
 
108
/* Show we can debug even without a frame pointer.  */
109
#define CAN_DEBUG_WITHOUT_FP
110
 
111
/* Some machines may desire to change what optimizations are
112
   performed for various optimization levels.   This macro, if
113
   defined, is executed once just after the optimization level is
114
   determined and before the remainder of the command options have
115
   been parsed.  Values set in this macro are used as the default
116
   values for the other command line options.
117
 
118
   LEVEL is the optimization level specified; 2 if `-O2' is
119
   specified, 1 if `-O' is specified, and 0 if neither is specified.
120
 
121
   SIZE is nonzero if `-Os' is specified, 0 otherwise.
122
 
123
   You should not use this macro to change options that are not
124
   machine-specific.  These should uniformly selected by the same
125
   optimization level on all supported machines.  Use this macro to
126
   enable machine-specific optimizations.
127
 
128
   *Do not examine `write_symbols' in this macro!* The debugging
129
   options are not supposed to alter the generated code.  */
130
 
131
#define OPTIMIZATION_OPTIONS(LEVEL,SIZE)                                \
132
{                                                                       \
133
  target_flags |= MASK_STRICT_ALIGN;                                    \
134
  if (LEVEL)                                                            \
135
    /* Note - we no longer enable MASK_EP when optimizing.  This is     \
136
       because of a hardware bug which stops the SLD and SST instructions\
137
       from correctly detecting some hazards.  If the user is sure that \
138
       their hardware is fixed or that their program will not encounter \
139
       the conditions that trigger the bug then they can enable -mep by \
140
       hand.  */                                                        \
141
    target_flags |= MASK_PROLOG_FUNCTION;                               \
142
}
143
 
144
 
145
/* Target machine storage layout */
146
 
147
/* Define this if most significant bit is lowest numbered
148
   in instructions that operate on numbered bit-fields.
149
   This is not true on the NEC V850.  */
150
#define BITS_BIG_ENDIAN 0
151
 
152
/* Define this if most significant byte of a word is the lowest numbered.  */
153
/* This is not true on the NEC V850.  */
154
#define BYTES_BIG_ENDIAN 0
155
 
156
/* Define this if most significant word of a multiword number is lowest
157
   numbered.
158
   This is not true on the NEC V850.  */
159
#define WORDS_BIG_ENDIAN 0
160
 
161
/* Width of a word, in units (bytes).  */
162
#define UNITS_PER_WORD          4
163
 
164
/* Define this macro if it is advisable to hold scalars in registers
165
   in a wider mode than that declared by the program.  In such cases,
166
   the value is constrained to be within the bounds of the declared
167
   type, but kept valid in the wider mode.  The signedness of the
168
   extension may differ from that of the type.
169
 
170
   Some simple experiments have shown that leaving UNSIGNEDP alone
171
   generates the best overall code.  */
172
 
173
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)  \
174
  if (GET_MODE_CLASS (MODE) == MODE_INT \
175
      && GET_MODE_SIZE (MODE) < 4)      \
176
    { (MODE) = SImode; }
177
 
178
/* Allocation boundary (in *bits*) for storing arguments in argument list.  */
179
#define PARM_BOUNDARY           32
180
 
181
/* The stack goes in 32 bit lumps.  */
182
#define STACK_BOUNDARY          32
183
 
184
/* Allocation boundary (in *bits*) for the code of a function.
185
   16 is the minimum boundary; 32 would give better performance.  */
186
#define FUNCTION_BOUNDARY 16
187
 
188
/* No data type wants to be aligned rounder than this.  */
189
#define BIGGEST_ALIGNMENT       32
190
 
191
/* Alignment of field after `int : 0' in a structure.  */
192
#define EMPTY_FIELD_BOUNDARY 32
193
 
194
/* No structure field wants to be aligned rounder than this.  */
195
#define BIGGEST_FIELD_ALIGNMENT 32
196
 
197
/* Define this if move instructions will actually fail to work
198
   when given unaligned data.  */
199
#define STRICT_ALIGNMENT  TARGET_STRICT_ALIGN
200
 
201
/* Define this as 1 if `char' should by default be signed; else as 0.
202
 
203
   On the NEC V850, loads do sign extension, so make this default.  */
204
#define DEFAULT_SIGNED_CHAR 1
205
 
206
/* Standard register usage.  */
207
 
208
/* Number of actual hardware registers.
209
   The hardware registers are assigned numbers for the compiler
210
   from 0 to just below FIRST_PSEUDO_REGISTER.
211
 
212
   All registers that the compiler knows about must be given numbers,
213
   even those that are not normally considered general registers.  */
214
 
215
#define FIRST_PSEUDO_REGISTER 34
216
 
217
/* 1 for registers that have pervasive standard uses
218
   and are not available for the register allocator.  */
219
 
220
#define FIXED_REGISTERS \
221
  { 1, 1, 0, 1, 1, 0, 0, 0, \
222
    0, 0, 0, 0, 0, 0, 0, 0, \
223
    0, 0, 0, 0, 0, 0, 0, 0, \
224
    0, 0, 0, 0, 0, 0, 1, 0, \
225
    1, 1}
226
 
227
/* 1 for registers not available across function calls.
228
   These must include the FIXED_REGISTERS and also any
229
   registers that can be used without being saved.
230
   The latter must include the registers where values are returned
231
   and the register where structure-value addresses are passed.
232
   Aside from that, you can include as many other registers as you
233
   like.  */
234
 
235
#define CALL_USED_REGISTERS \
236
  { 1, 1, 0, 1, 1, 1, 1, 1, \
237
    1, 1, 1, 1, 1, 1, 1, 1, \
238
    1, 1, 1, 1, 0, 0, 0, 0, \
239
    0, 0, 0, 0, 0, 0, 1, 1, \
240
    1, 1}
241
 
242
/* List the order in which to allocate registers.  Each register must be
243
   listed once, even those in FIXED_REGISTERS.
244
 
245
   On the 850, we make the return registers first, then all of the volatile
246
   registers, then the saved registers in reverse order to better save the
247
   registers with an out of line function, and finally the fixed
248
   registers.  */
249
 
250
#define REG_ALLOC_ORDER                                                 \
251
{                                                                       \
252
  10, 11,                               /* return registers */          \
253
  12, 13, 14, 15, 16, 17, 18, 19,       /* scratch registers */         \
254
   6,  7,  8,  9, 31,                   /* argument registers */        \
255
  29, 28, 27, 26, 25, 24, 23, 22,       /* saved registers */           \
256
  21, 20,  2,                                                           \
257
   0,  1,  3,  4,  5, 30, 32, 33 /* fixed registers */           \
258
}
259
 
260
/* If TARGET_APP_REGS is not defined then add r2 and r5 to
261
   the pool of fixed registers. See PR 14505.  */
262
#define CONDITIONAL_REGISTER_USAGE  \
263
{                                                       \
264
  if (!TARGET_APP_REGS)                                 \
265
    {                                                   \
266
      fixed_regs[2] = 1;  call_used_regs[2] = 1;        \
267
      fixed_regs[5] = 1;  call_used_regs[5] = 1;        \
268
    }                                                   \
269
}
270
 
271
/* Return number of consecutive hard regs needed starting at reg REGNO
272
   to hold something of mode MODE.
273
 
274
   This is ordinarily the length in words of a value of mode MODE
275
   but can be less for certain modes in special long registers.  */
276
 
277
#define HARD_REGNO_NREGS(REGNO, MODE)   \
278
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
279
 
280
/* Value is 1 if hard register REGNO can hold a value of machine-mode
281
   MODE.  */
282
 
283
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
284
 ((((REGNO) & 1) == 0) || (GET_MODE_SIZE (MODE) <= 4))
285
 
286
/* Value is 1 if it is a good idea to tie two pseudo registers
287
   when one has mode MODE1 and one has mode MODE2.
288
   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
289
   for any hard reg, then this must be 0 for correct output.  */
290
#define MODES_TIEABLE_P(MODE1, MODE2) \
291
  (MODE1 == MODE2 || (GET_MODE_SIZE (MODE1) <= 4 && GET_MODE_SIZE (MODE2) <= 4))
292
 
293
 
294
/* Define the classes of registers for register constraints in the
295
   machine description.  Also define ranges of constants.
296
 
297
   One of the classes must always be named ALL_REGS and include all hard regs.
298
   If there is more than one class, another class must be named NO_REGS
299
   and contain no registers.
300
 
301
   The name GENERAL_REGS must be the name of a class (or an alias for
302
   another name such as ALL_REGS).  This is the class of registers
303
   that is allowed by "g" or "r" in a register constraint.
304
   Also, registers outside this class are allocated only when
305
   instructions express preferences for them.
306
 
307
   The classes must be numbered in nondecreasing order; that is,
308
   a larger-numbered class must never be contained completely
309
   in a smaller-numbered class.
310
 
311
   For any two classes, it is very desirable that there be another
312
   class that represents their union.  */
313
 
314
enum reg_class
315
{
316
  NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
317
};
318
 
319
#define N_REG_CLASSES (int) LIM_REG_CLASSES
320
 
321
/* Give names of register classes as strings for dump file.  */
322
 
323
#define REG_CLASS_NAMES \
324
{ "NO_REGS", "GENERAL_REGS", "ALL_REGS", "LIM_REGS" }
325
 
326
/* Define which registers fit in which classes.
327
   This is an initializer for a vector of HARD_REG_SET
328
   of length N_REG_CLASSES.  */
329
 
330
#define REG_CLASS_CONTENTS              \
331
{                                       \
332
  { 0x00000000 }, /* NO_REGS      */    \
333
  { 0xffffffff }, /* GENERAL_REGS */    \
334
  { 0xffffffff }, /* ALL_REGS   */      \
335
}
336
 
337
/* The same information, inverted:
338
   Return the class number of the smallest class containing
339
   reg number REGNO.  This could be a conditional expression
340
   or could index an array.  */
341
 
342
#define REGNO_REG_CLASS(REGNO)  GENERAL_REGS
343
 
344
/* The class value for index registers, and the one for base regs.  */
345
 
346
#define INDEX_REG_CLASS NO_REGS
347
#define BASE_REG_CLASS  GENERAL_REGS
348
 
349
/* Get reg_class from a letter such as appears in the machine description.  */
350
 
351
#define REG_CLASS_FROM_LETTER(C) (NO_REGS)
352
 
353
/* Macros to check register numbers against specific register classes.  */
354
 
355
/* These assume that REGNO is a hard or pseudo reg number.
356
   They give nonzero only if REGNO is a hard reg of the suitable class
357
   or a pseudo reg currently allocated to a suitable hard reg.
358
   Since they use reg_renumber, they are safe only once reg_renumber
359
   has been allocated, which happens in local-alloc.c.  */
360
 
361
#define REGNO_OK_FOR_BASE_P(regno) \
362
  ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
363
 
364
#define REGNO_OK_FOR_INDEX_P(regno) 0
365
 
366
/* Given an rtx X being reloaded into a reg required to be
367
   in class CLASS, return the class of reg to actually use.
368
   In general this is just CLASS; but on some machines
369
   in some cases it is preferable to use a more restrictive class.  */
370
 
371
#define PREFERRED_RELOAD_CLASS(X,CLASS)  (CLASS)
372
 
373
/* Return the maximum number of consecutive registers
374
   needed to represent mode MODE in a register of class CLASS.  */
375
 
376
#define CLASS_MAX_NREGS(CLASS, MODE)    \
377
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
378
 
379
/* The letters I, J, K, L, M, N, O, P in a register constraint string
380
   can be used to stand for particular ranges of immediate operands.
381
   This macro defines what the ranges are.
382
   C is the letter, and VALUE is a constant value.
383
   Return 1 if VALUE is in the range specified by C.  */
384
 
385
#define INT_7_BITS(VALUE) ((unsigned) (VALUE) + 0x40 < 0x80)
386
#define INT_8_BITS(VALUE) ((unsigned) (VALUE) + 0x80 < 0x100)
387
/* zero */
388
#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)
389
/* 5 bit signed immediate */
390
#define CONST_OK_FOR_J(VALUE) ((unsigned) (VALUE) + 0x10 < 0x20)
391
/* 16 bit signed immediate */
392
#define CONST_OK_FOR_K(VALUE) ((unsigned) (VALUE) + 0x8000 < 0x10000)
393
/* valid constant for movhi instruction.  */
394
#define CONST_OK_FOR_L(VALUE) \
395
  (((unsigned) ((int) (VALUE) >> 16) + 0x8000 < 0x10000) \
396
   && CONST_OK_FOR_I ((VALUE & 0xffff)))
397
/* 16 bit unsigned immediate */
398
#define CONST_OK_FOR_M(VALUE) ((unsigned)(VALUE) < 0x10000)
399
/* 5 bit unsigned immediate in shift instructions */
400
#define CONST_OK_FOR_N(VALUE) ((unsigned) (VALUE) <= 31)
401
/* 9 bit signed immediate for word multiply instruction.  */
402
#define CONST_OK_FOR_O(VALUE) ((unsigned) (VALUE) + 0x100 < 0x200)
403
 
404
#define CONST_OK_FOR_P(VALUE) 0
405
 
406
#define CONST_OK_FOR_LETTER_P(VALUE, C)  \
407
  ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \
408
   (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \
409
   (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \
410
   (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \
411
   (C) == 'M' ? CONST_OK_FOR_M (VALUE) : \
412
   (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \
413
   (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \
414
   (C) == 'P' ? CONST_OK_FOR_P (VALUE) : \
415
   0)
416
 
417
/* Similar, but for floating constants, and defining letters G and H.
418
   Here VALUE is the CONST_DOUBLE rtx itself.
419
 
420
  `G' is a zero of some form.  */
421
 
422
#define CONST_DOUBLE_OK_FOR_G(VALUE)                                    \
423
  ((GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT                     \
424
    && (VALUE) == CONST0_RTX (GET_MODE (VALUE)))                        \
425
   || (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_INT                    \
426
       && CONST_DOUBLE_LOW (VALUE) == 0                                  \
427
       && CONST_DOUBLE_HIGH (VALUE) == 0))
428
 
429
#define CONST_DOUBLE_OK_FOR_H(VALUE) 0
430
 
431
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)                          \
432
  ((C) == 'G'   ? CONST_DOUBLE_OK_FOR_G (VALUE)                         \
433
   : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE)                         \
434
   : 0)
435
 
436
 
437
/* Stack layout; function entry, exit and calling.  */
438
 
439
/* Define this if pushing a word on the stack
440
   makes the stack pointer a smaller address.  */
441
 
442
#define STACK_GROWS_DOWNWARD
443
 
444
/* Define this to nonzero if the nominal address of the stack frame
445
   is at the high-address end of the local variables;
446
   that is, each additional local variable allocated
447
   goes at a more negative offset in the frame.  */
448
 
449
#define FRAME_GROWS_DOWNWARD 1
450
 
451
/* Offset within stack frame to start allocating local variables at.
452
   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
453
   first local allocated.  Otherwise, it is the offset to the BEGINNING
454
   of the first local allocated.  */
455
 
456
#define STARTING_FRAME_OFFSET 0
457
 
458
/* Offset of first parameter from the argument pointer register value.  */
459
/* Is equal to the size of the saved fp + pc, even if an fp isn't
460
   saved since the value is used before we know.  */
461
 
462
#define FIRST_PARM_OFFSET(FNDECL) 0
463
 
464
/* Specify the registers used for certain standard purposes.
465
   The values of these macros are register numbers.  */
466
 
467
/* Register to use for pushing function arguments.  */
468
#define STACK_POINTER_REGNUM 3
469
 
470
/* Base register for access to local variables of the function.  */
471
#define FRAME_POINTER_REGNUM 32
472
 
473
/* Register containing return address from latest function call.  */
474
#define LINK_POINTER_REGNUM 31
475
 
476
/* On some machines the offset between the frame pointer and starting
477
   offset of the automatic variables is not known until after register
478
   allocation has been done (for example, because the saved registers
479
   are between these two locations).  On those machines, define
480
   `FRAME_POINTER_REGNUM' the number of a special, fixed register to
481
   be used internally until the offset is known, and define
482
   `HARD_FRAME_POINTER_REGNUM' to be actual the hard register number
483
   used for the frame pointer.
484
 
485
   You should define this macro only in the very rare circumstances
486
   when it is not possible to calculate the offset between the frame
487
   pointer and the automatic variables until after register
488
   allocation has been completed.  When this macro is defined, you
489
   must also indicate in your definition of `ELIMINABLE_REGS' how to
490
   eliminate `FRAME_POINTER_REGNUM' into either
491
   `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
492
 
493
   Do not define this macro if it would be the same as
494
   `FRAME_POINTER_REGNUM'.  */
495
#undef  HARD_FRAME_POINTER_REGNUM 
496
#define HARD_FRAME_POINTER_REGNUM 29
497
 
498
/* Base register for access to arguments of the function.  */
499
#define ARG_POINTER_REGNUM 33
500
 
501
/* Register in which static-chain is passed to a function.  */
502
#define STATIC_CHAIN_REGNUM 20
503
 
504
/* Value should be nonzero if functions must have frame pointers.
505
   Zero means the frame pointer need not be set up (and parms
506
   may be accessed via the stack pointer) in functions that seem suitable.
507
   This is computed in `reload', in reload1.c.  */
508
#define FRAME_POINTER_REQUIRED 0
509
 
510
/* If defined, this macro specifies a table of register pairs used to
511
   eliminate unneeded registers that point into the stack frame.  If
512
   it is not defined, the only elimination attempted by the compiler
513
   is to replace references to the frame pointer with references to
514
   the stack pointer.
515
 
516
   The definition of this macro is a list of structure
517
   initializations, each of which specifies an original and
518
   replacement register.
519
 
520
   On some machines, the position of the argument pointer is not
521
   known until the compilation is completed.  In such a case, a
522
   separate hard register must be used for the argument pointer.
523
   This register can be eliminated by replacing it with either the
524
   frame pointer or the argument pointer, depending on whether or not
525
   the frame pointer has been eliminated.
526
 
527
   In this case, you might specify:
528
        #define ELIMINABLE_REGS  \
529
        {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
530
         {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
531
         {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
532
 
533
   Note that the elimination of the argument pointer with the stack
534
   pointer is specified first since that is the preferred elimination.  */
535
 
536
#define ELIMINABLE_REGS                                                 \
537
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM },                        \
538
 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM },                   \
539
 { ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM },                        \
540
 { ARG_POINTER_REGNUM,   HARD_FRAME_POINTER_REGNUM }}                   \
541
 
542
/* A C expression that returns nonzero if the compiler is allowed to
543
   try to replace register number FROM-REG with register number
544
   TO-REG.  This macro need only be defined if `ELIMINABLE_REGS' is
545
   defined, and will usually be the constant 1, since most of the
546
   cases preventing register elimination are things that the compiler
547
   already knows about.  */
548
 
549
#define CAN_ELIMINATE(FROM, TO) \
550
 ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1)
551
 
552
/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
553
   specifies the initial difference between the specified pair of
554
   registers.  This macro must be defined if `ELIMINABLE_REGS' is
555
   defined.  */
556
 
557
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
558
{                                                                       \
559
  if ((FROM) == FRAME_POINTER_REGNUM)                                   \
560
    (OFFSET) = get_frame_size () + current_function_outgoing_args_size; \
561
  else if ((FROM) == ARG_POINTER_REGNUM)                                \
562
   (OFFSET) = compute_frame_size (get_frame_size (), (long *)0); \
563
  else                                                                  \
564
    gcc_unreachable ();                                                 \
565
}
566
 
567
/* Keep the stack pointer constant throughout the function.  */
568
#define ACCUMULATE_OUTGOING_ARGS 1
569
 
570
/* Value is the number of bytes of arguments automatically
571
   popped when returning from a subroutine call.
572
   FUNDECL is the declaration node of the function (as a tree),
573
   FUNTYPE is the data type of the function (as a tree),
574
   or for a library call it is an identifier node for the subroutine name.
575
   SIZE is the number of bytes of arguments passed on the stack.  */
576
 
577
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
578
 
579
#define RETURN_ADDR_RTX(COUNT, FP) v850_return_addr (COUNT)
580
 
581
/* Define a data type for recording info about an argument list
582
   during the scan of that argument list.  This data type should
583
   hold all necessary information about the function itself
584
   and about the args processed so far, enough to enable macros
585
   such as FUNCTION_ARG to determine where the next arg should go.  */
586
 
587
#define CUMULATIVE_ARGS struct cum_arg
588
struct cum_arg { int nbytes; int anonymous_args; };
589
 
590
/* Define where to put the arguments to a function.
591
   Value is zero to push the argument on the stack,
592
   or a hard register in which to store the argument.
593
 
594
   MODE is the argument's machine mode.
595
   TYPE is the data type of the argument (as a tree).
596
    This is null for libcalls where that information may
597
    not be available.
598
   CUM is a variable of type CUMULATIVE_ARGS which gives info about
599
    the preceding args and about the function being called.
600
   NAMED is nonzero if this argument is a named parameter
601
    (otherwise it is an extra parameter matching an ellipsis).  */
602
 
603
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
604
  function_arg (&CUM, MODE, TYPE, NAMED)
605
 
606
/* Initialize a variable CUM of type CUMULATIVE_ARGS
607
   for a call to a function whose data type is FNTYPE.
608
   For a library call, FNTYPE is 0.  */
609
 
610
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
611
 ((CUM).nbytes = 0, (CUM).anonymous_args = 0)
612
 
613
/* Update the data in CUM to advance over an argument
614
   of mode MODE and data type TYPE.
615
   (TYPE is null for libcalls where that information may not be available.)  */
616
 
617
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
618
 ((CUM).nbytes += ((MODE) != BLKmode                    \
619
  ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD       \
620
  : (int_size_in_bytes (TYPE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD))
621
 
622
/* When a parameter is passed in a register, stack space is still
623
   allocated for it.  */
624
#define REG_PARM_STACK_SPACE(DECL) (!TARGET_GHS ? 16 : 0)
625
 
626
/* Define this if the above stack space is to be considered part of the
627
   space allocated by the caller.  */
628
#define OUTGOING_REG_PARM_STACK_SPACE
629
 
630
/* 1 if N is a possible register number for function argument passing.  */
631
 
632
#define FUNCTION_ARG_REGNO_P(N) (N >= 6 && N <= 9)
633
 
634
/* Define how to find the value returned by a function.
635
   VALTYPE is the data type of the value (as a tree).
636
   If the precise function being called is known, FUNC is its FUNCTION_DECL;
637
   otherwise, FUNC is 0.  */
638
 
639
#define FUNCTION_VALUE(VALTYPE, FUNC) \
640
  gen_rtx_REG (TYPE_MODE (VALTYPE), 10)
641
 
642
/* Define how to find the value returned by a library function
643
   assuming the value has mode MODE.  */
644
 
645
#define LIBCALL_VALUE(MODE) \
646
  gen_rtx_REG (MODE, 10)
647
 
648
/* 1 if N is a possible register number for a function value.  */
649
 
650
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 10)
651
 
652
#define DEFAULT_PCC_STRUCT_RETURN 0
653
 
654
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
655
   the stack pointer does not matter.  The value is tested only in
656
   functions that have frame pointers.
657
   No definition is equivalent to always zero.  */
658
 
659
#define EXIT_IGNORE_STACK 1
660
 
661
/* Define this macro as a C expression that is nonzero for registers
662
   used by the epilogue or the `return' pattern.  */
663
 
664
#define EPILOGUE_USES(REGNO) \
665
  (reload_completed && (REGNO) == LINK_POINTER_REGNUM)
666
 
667
/* Output assembler code to FILE to increment profiler label # LABELNO
668
   for profiling a function entry.  */
669
 
670
#define FUNCTION_PROFILER(FILE, LABELNO) ;
671
 
672
#define TRAMPOLINE_TEMPLATE(FILE)                       \
673
  do {                                                  \
674
    fprintf (FILE, "\tjarl .+4,r12\n");                 \
675
    fprintf (FILE, "\tld.w 12[r12],r20\n");             \
676
    fprintf (FILE, "\tld.w 16[r12],r12\n");             \
677
    fprintf (FILE, "\tjmp [r12]\n");                    \
678
    fprintf (FILE, "\tnop\n");                          \
679
    fprintf (FILE, "\t.long 0\n");                      \
680
    fprintf (FILE, "\t.long 0\n");                      \
681
  } while (0)
682
 
683
/* Length in units of the trampoline for entering a nested function.  */
684
 
685
#define TRAMPOLINE_SIZE 24
686
 
687
/* Emit RTL insns to initialize the variable parts of a trampoline.
688
   FNADDR is an RTX for the address of the function's pure code.
689
   CXT is an RTX for the static chain value for the function.  */
690
 
691
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                       \
692
{                                                                       \
693
  emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 16)),    \
694
                 (CXT));                                                \
695
  emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 20)),    \
696
                 (FNADDR));                                             \
697
}
698
 
699
/* Addressing modes, and classification of registers for them.  */
700
 
701
 
702
/* 1 if X is an rtx for a constant that is a valid address.  */
703
 
704
/* ??? This seems too exclusive.  May get better code by accepting more
705
   possibilities here, in particular, should accept ZDA_NAME SYMBOL_REFs.  */
706
 
707
#define CONSTANT_ADDRESS_P(X)   \
708
  (GET_CODE (X) == CONST_INT                            \
709
   && CONST_OK_FOR_K (INTVAL (X)))
710
 
711
/* Maximum number of registers that can appear in a valid memory address.  */
712
 
713
#define MAX_REGS_PER_ADDRESS 1
714
 
715
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
716
   and check its validity for a certain class.
717
   We have two alternate definitions for each of them.
718
   The usual definition accepts all pseudo regs; the other rejects
719
   them unless they have been allocated suitable hard regs.
720
   The symbol REG_OK_STRICT causes the latter definition to be used.
721
 
722
   Most source files want to accept pseudo regs in the hope that
723
   they will get allocated to the class that the insn wants them to be in.
724
   Source files for reload pass need to be strict.
725
   After reload, it makes no difference, since pseudo regs have
726
   been eliminated by then.  */
727
 
728
#ifndef REG_OK_STRICT
729
 
730
/* Nonzero if X is a hard reg that can be used as an index
731
   or if it is a pseudo reg.  */
732
#define REG_OK_FOR_INDEX_P(X) 0
733
/* Nonzero if X is a hard reg that can be used as a base reg
734
   or if it is a pseudo reg.  */
735
#define REG_OK_FOR_BASE_P(X) 1
736
#define REG_OK_FOR_INDEX_P_STRICT(X) 0
737
#define REG_OK_FOR_BASE_P_STRICT(X) REGNO_OK_FOR_BASE_P (REGNO (X))
738
#define STRICT 0
739
 
740
#else
741
 
742
/* Nonzero if X is a hard reg that can be used as an index.  */
743
#define REG_OK_FOR_INDEX_P(X) 0
744
/* Nonzero if X is a hard reg that can be used as a base reg.  */
745
#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
746
#define STRICT 1
747
 
748
#endif
749
 
750
/* A C expression that defines the optional machine-dependent
751
   constraint letters that can be used to segregate specific types of
752
   operands, usually memory references, for the target machine.
753
   Normally this macro will not be defined.  If it is required for a
754
   particular target machine, it should return 1 if VALUE corresponds
755
   to the operand type represented by the constraint letter C.  If C
756
   is not defined as an extra constraint, the value returned should
757
   be 0 regardless of VALUE.
758
 
759
   For example, on the ROMP, load instructions cannot have their
760
   output in r0 if the memory reference contains a symbolic address.
761
   Constraint letter `Q' is defined as representing a memory address
762
   that does *not* contain a symbolic address.  An alternative is
763
   specified with a `Q' constraint on the input and `r' on the
764
   output.  The next alternative specifies `m' on the input and a
765
   register class that does not include r0 on the output.  */
766
 
767
#define EXTRA_CONSTRAINT(OP, C)                                         \
768
 ((C) == 'Q'   ? ep_memory_operand (OP, GET_MODE (OP), FALSE)           \
769
  : (C) == 'R' ? special_symbolref_operand (OP, VOIDmode)               \
770
  : (C) == 'S' ? (GET_CODE (OP) == SYMBOL_REF                           \
771
                  && !SYMBOL_REF_ZDA_P (OP))                            \
772
  : (C) == 'T' ? ep_memory_operand (OP, GET_MODE (OP), TRUE)            \
773
  : (C) == 'U' ? ((GET_CODE (OP) == SYMBOL_REF                          \
774
                   && SYMBOL_REF_ZDA_P (OP))                            \
775
                  || (GET_CODE (OP) == CONST                            \
776
                      && GET_CODE (XEXP (OP, 0)) == PLUS         \
777
                      && GET_CODE (XEXP (XEXP (OP, 0), 0)) == SYMBOL_REF \
778
                      && SYMBOL_REF_ZDA_P (XEXP (XEXP (OP, 0), 0))))      \
779
  : 0)
780
 
781
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
782
   that is a valid memory address for an instruction.
783
   The MODE argument is the machine mode for the MEM expression
784
   that wants to use this address.
785
 
786
   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
787
   except for CONSTANT_ADDRESS_P which is actually
788
   machine-independent.  */
789
 
790
/* Accept either REG or SUBREG where a register is valid.  */
791
 
792
#define RTX_OK_FOR_BASE_P(X)                                            \
793
  ((REG_P (X) && REG_OK_FOR_BASE_P (X))                                 \
794
   || (GET_CODE (X) == SUBREG && REG_P (SUBREG_REG (X))                 \
795
       && REG_OK_FOR_BASE_P (SUBREG_REG (X))))
796
 
797
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                         \
798
do {                                                                    \
799
  if (RTX_OK_FOR_BASE_P (X))                                            \
800
    goto ADDR;                                                          \
801
  if (CONSTANT_ADDRESS_P (X)                                            \
802
      && (MODE == QImode || INTVAL (X) % 2 == 0)                 \
803
      && (GET_MODE_SIZE (MODE) <= 4 || INTVAL (X) % 4 == 0))             \
804
    goto ADDR;                                                          \
805
  if (GET_CODE (X) == LO_SUM                                            \
806
      && REG_P (XEXP (X, 0))                                             \
807
      && REG_OK_FOR_BASE_P (XEXP (X, 0))                         \
808
      && CONSTANT_P (XEXP (X, 1))                                       \
809
      && (GET_CODE (XEXP (X, 1)) != CONST_INT                           \
810
          || ((MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0)          \
811
              && CONST_OK_FOR_K (INTVAL (XEXP (X, 1)))))                \
812
      && GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode))             \
813
    goto ADDR;                                                          \
814
  if (special_symbolref_operand (X, MODE)                               \
815
      && (GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode)))           \
816
     goto ADDR;                                                         \
817
  if (GET_CODE (X) == PLUS                                              \
818
      && RTX_OK_FOR_BASE_P (XEXP (X, 0))                                 \
819
      && CONSTANT_ADDRESS_P (XEXP (X, 1))                               \
820
      && ((MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0)              \
821
           && CONST_OK_FOR_K (INTVAL (XEXP (X, 1))                      \
822
                              + (GET_MODE_NUNITS (MODE) * UNITS_PER_WORD)))) \
823
    goto ADDR;                  \
824
} while (0)
825
 
826
 
827
/* Go to LABEL if ADDR (a legitimate address expression)
828
   has an effect that depends on the machine mode it is used for.  */
829
 
830
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)  {}
831
 
832
/* Nonzero if the constant value X is a legitimate general operand.
833
   It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
834
 
835
#define LEGITIMATE_CONSTANT_P(X)                                        \
836
  (GET_CODE (X) == CONST_DOUBLE                                         \
837
   || !(GET_CODE (X) == CONST                                           \
838
        && GET_CODE (XEXP (X, 0)) == PLUS                                \
839
        && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF         \
840
        && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT         \
841
        && ! CONST_OK_FOR_K (INTVAL (XEXP (XEXP (X, 0), 1)))))
842
 
843
/* Tell final.c how to eliminate redundant test instructions.  */
844
 
845
/* Here we define machine-dependent flags and fields in cc_status
846
   (see `conditions.h').  No extra ones are needed for the VAX.  */
847
 
848
/* Store in cc_status the expressions
849
   that the condition codes will describe
850
   after execution of an instruction whose pattern is EXP.
851
   Do not alter them if the instruction would not alter the cc's.  */
852
 
853
#define CC_OVERFLOW_UNUSABLE 0x200
854
#define CC_NO_CARRY CC_NO_OVERFLOW
855
#define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)
856
 
857
/* Nonzero if access to memory by bytes or half words is no faster
858
   than accessing full words.  */
859
#define SLOW_BYTE_ACCESS 1
860
 
861
/* According expr.c, a value of around 6 should minimize code size, and
862
   for the V850 series, that's our primary concern.  */
863
#define MOVE_RATIO 6
864
 
865
/* Indirect calls are expensive, never turn a direct call
866
   into an indirect call.  */
867
#define NO_FUNCTION_CSE
868
 
869
/* The four different data regions on the v850.  */
870
typedef enum
871
{
872
  DATA_AREA_NORMAL,
873
  DATA_AREA_SDA,
874
  DATA_AREA_TDA,
875
  DATA_AREA_ZDA
876
} v850_data_area;
877
 
878
#define TEXT_SECTION_ASM_OP  "\t.section .text"
879
#define DATA_SECTION_ASM_OP  "\t.section .data"
880
#define BSS_SECTION_ASM_OP   "\t.section .bss"
881
#define SDATA_SECTION_ASM_OP "\t.section .sdata,\"aw\""
882
#define SBSS_SECTION_ASM_OP  "\t.section .sbss,\"aw\""
883
 
884
#define SCOMMON_ASM_OP         "\t.scomm\t"
885
#define ZCOMMON_ASM_OP         "\t.zcomm\t"
886
#define TCOMMON_ASM_OP         "\t.tcomm\t"
887
 
888
#define ASM_COMMENT_START "#"
889
 
890
/* Output to assembler file text saying following lines
891
   may contain character constants, extra white space, comments, etc.  */
892
 
893
#define ASM_APP_ON "#APP\n"
894
 
895
/* Output to assembler file text saying following lines
896
   no longer contain unusual constructs.  */
897
 
898
#define ASM_APP_OFF "#NO_APP\n"
899
 
900
#undef  USER_LABEL_PREFIX
901
#define USER_LABEL_PREFIX "_"
902
 
903
#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL)  \
904
  if (! v850_output_addr_const_extra (FILE, X)) \
905
     goto FAIL
906
 
907
/* This says how to output the assembler to define a global
908
   uninitialized but not common symbol.  */
909
 
910
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
911
  asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
912
 
913
#undef  ASM_OUTPUT_ALIGNED_BSS 
914
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
915
  v850_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
916
 
917
/* This says how to output the assembler to define a global
918
   uninitialized, common symbol.  */
919
#undef  ASM_OUTPUT_ALIGNED_COMMON
920
#undef  ASM_OUTPUT_COMMON
921
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
922
     v850_output_common (FILE, DECL, NAME, SIZE, ALIGN)
923
 
924
/* This says how to output the assembler to define a local
925
   uninitialized symbol.  */
926
#undef  ASM_OUTPUT_ALIGNED_LOCAL
927
#undef  ASM_OUTPUT_LOCAL
928
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
929
     v850_output_local (FILE, DECL, NAME, SIZE, ALIGN)
930
 
931
/* Globalizing directive for a label.  */
932
#define GLOBAL_ASM_OP "\t.global "
933
 
934
#define ASM_PN_FORMAT "%s___%lu"
935
 
936
/* This is how we tell the assembler that two symbols have the same value.  */
937
 
938
#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
939
  do { assemble_name(FILE, NAME1);       \
940
       fputs(" = ", FILE);               \
941
       assemble_name(FILE, NAME2);       \
942
       fputc('\n', FILE); } while (0)
943
 
944
 
945
/* How to refer to registers in assembler output.
946
   This sequence is indexed by compiler's hard-register-number (see above).  */
947
 
948
#define REGISTER_NAMES                                                  \
949
{  "r0",  "r1",  "r2",  "sp",  "gp",  "r5",  "r6" , "r7",               \
950
   "r8",  "r9", "r10", "r11", "r12", "r13", "r14", "r15",               \
951
  "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",               \
952
  "r24", "r25", "r26", "r27", "r28", "r29",  "ep", "r31",               \
953
  ".fp", ".ap"}
954
 
955
#define ADDITIONAL_REGISTER_NAMES                                       \
956
{ { "zero",     0 },                                                     \
957
  { "hp",       2 },                                                    \
958
  { "r3",       3 },                                                    \
959
  { "r4",       4 },                                                    \
960
  { "tp",       5 },                                                    \
961
  { "fp",       29 },                                                   \
962
  { "r30",      30 },                                                   \
963
  { "lp",       31} }
964
 
965
/* Print an instruction operand X on file FILE.
966
   look in v850.c for details */
967
 
968
#define PRINT_OPERAND(FILE, X, CODE)  print_operand (FILE, X, CODE)
969
 
970
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
971
  ((CODE) == '.')
972
 
973
/* Print a memory operand whose address is X, on file FILE.
974
   This uses a function in output-vax.c.  */
975
 
976
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
977
 
978
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)
979
#define ASM_OUTPUT_REG_POP(FILE,REGNO)
980
 
981
/* This is how to output an element of a case-vector that is absolute.  */
982
 
983
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
984
  fprintf (FILE, "\t%s .L%d\n",                                 \
985
           (TARGET_BIG_SWITCH ? ".long" : ".short"), VALUE)
986
 
987
/* This is how to output an element of a case-vector that is relative.  */
988
 
989
/* Disable the shift, which is for the currently disabled "switch"
990
   opcode.  Se casesi in v850.md.  */
991
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)                \
992
  fprintf (FILE, "\t%s %s.L%d-.L%d%s\n",                                \
993
           (TARGET_BIG_SWITCH ? ".long" : ".short"),                    \
994
           (0 && ! TARGET_BIG_SWITCH && TARGET_V850E ? "(" : ""),                \
995
           VALUE, REL,                                                  \
996
           (0 && ! TARGET_BIG_SWITCH && TARGET_V850E ? ")>>1" : ""))
997
 
998
#define ASM_OUTPUT_ALIGN(FILE, LOG)     \
999
  if ((LOG) != 0)                        \
1000
    fprintf (FILE, "\t.align %d\n", (LOG))
1001
 
1002
/* We don't have to worry about dbx compatibility for the v850.  */
1003
#define DEFAULT_GDB_EXTENSIONS 1
1004
 
1005
/* Use stabs debugging info by default.  */
1006
#undef PREFERRED_DEBUGGING_TYPE
1007
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
1008
 
1009
/* Specify the machine mode that this machine uses
1010
   for the index in the tablejump instruction.  */
1011
#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? SImode : HImode)
1012
 
1013
/* Define as C expression which evaluates to nonzero if the tablejump
1014
   instruction expects the table to contain offsets from the address of the
1015
   table.
1016
   Do not define this if the table should contain absolute addresses.  */
1017
#define CASE_VECTOR_PC_RELATIVE 1
1018
 
1019
/* The switch instruction requires that the jump table immediately follow
1020
   it.  */
1021
#define JUMP_TABLES_IN_TEXT_SECTION 1
1022
 
1023
/* svr4.h defines this assuming that 4 byte alignment is required.  */
1024
#undef ASM_OUTPUT_BEFORE_CASE_LABEL
1025
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
1026
  ASM_OUTPUT_ALIGN ((FILE), (TARGET_BIG_SWITCH ? 2 : 1));
1027
 
1028
#define WORD_REGISTER_OPERATIONS
1029
 
1030
/* Byte and short loads sign extend the value to a word.  */
1031
#define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
1032
 
1033
/* This flag, if defined, says the same insns that convert to a signed fixnum
1034
   also convert validly to an unsigned one.  */
1035
#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
1036
 
1037
/* Max number of bytes we can move from memory to memory
1038
   in one reasonably fast instruction.  */
1039
#define MOVE_MAX        4
1040
 
1041
/* Define if shifts truncate the shift count
1042
   which implies one can omit a sign-extension or zero-extension
1043
   of a shift count.  */
1044
#define SHIFT_COUNT_TRUNCATED 1
1045
 
1046
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1047
   is done just by pretending it is already truncated.  */
1048
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1049
 
1050
/* Specify the machine mode that pointers have.
1051
   After generation of rtl, the compiler makes no further distinction
1052
   between pointers and any other objects of this machine mode.  */
1053
#define Pmode SImode
1054
 
1055
/* A function address in a call instruction
1056
   is a byte address (for indexing purposes)
1057
   so give the MEM rtx a byte's mode.  */
1058
#define FUNCTION_MODE QImode
1059
 
1060
/* Tell compiler we want to support GHS pragmas */
1061
#define REGISTER_TARGET_PRAGMAS() do {                          \
1062
  c_register_pragma ("ghs", "interrupt", ghs_pragma_interrupt); \
1063
  c_register_pragma ("ghs", "section",   ghs_pragma_section);   \
1064
  c_register_pragma ("ghs", "starttda",  ghs_pragma_starttda);  \
1065
  c_register_pragma ("ghs", "startsda",  ghs_pragma_startsda);  \
1066
  c_register_pragma ("ghs", "startzda",  ghs_pragma_startzda);  \
1067
  c_register_pragma ("ghs", "endtda",    ghs_pragma_endtda);    \
1068
  c_register_pragma ("ghs", "endsda",    ghs_pragma_endsda);    \
1069
  c_register_pragma ("ghs", "endzda",    ghs_pragma_endzda);    \
1070
} while (0)
1071
 
1072
/* enum GHS_SECTION_KIND is an enumeration of the kinds of sections that
1073
   can appear in the "ghs section" pragma.  These names are used to index
1074
   into the GHS_default_section_names[] and GHS_current_section_names[]
1075
   that are defined in v850.c, and so the ordering of each must remain
1076
   consistent.
1077
 
1078
   These arrays give the default and current names for each kind of
1079
   section defined by the GHS pragmas.  The current names can be changed
1080
   by the "ghs section" pragma.  If the current names are null, use
1081
   the default names.  Note that the two arrays have different types.
1082
 
1083
   For the *normal* section kinds (like .data, .text, etc.) we do not
1084
   want to explicitly force the name of these sections, but would rather
1085
   let the linker (or at least the back end) choose the name of the
1086
   section, UNLESS the user has force a specific name for these section
1087
   kinds.  To accomplish this set the name in ghs_default_section_names
1088
   to null.  */
1089
 
1090
enum GHS_section_kind
1091
{
1092
  GHS_SECTION_KIND_DEFAULT,
1093
 
1094
  GHS_SECTION_KIND_TEXT,
1095
  GHS_SECTION_KIND_DATA,
1096
  GHS_SECTION_KIND_RODATA,
1097
  GHS_SECTION_KIND_BSS,
1098
  GHS_SECTION_KIND_SDATA,
1099
  GHS_SECTION_KIND_ROSDATA,
1100
  GHS_SECTION_KIND_TDATA,
1101
  GHS_SECTION_KIND_ZDATA,
1102
  GHS_SECTION_KIND_ROZDATA,
1103
 
1104
  COUNT_OF_GHS_SECTION_KINDS  /* must be last */
1105
};
1106
 
1107
/* The following code is for handling pragmas supported by the
1108
   v850 compiler produced by Green Hills Software.  This is at
1109
   the specific request of a customer.  */
1110
 
1111
typedef struct data_area_stack_element
1112
{
1113
  struct data_area_stack_element * prev;
1114
  v850_data_area                   data_area; /* Current default data area.  */
1115
} data_area_stack_element;
1116
 
1117
/* Track the current data area set by the
1118
   data area pragma (which can be nested).  */
1119
extern data_area_stack_element * data_area_stack;
1120
 
1121
/* Names of the various data areas used on the v850.  */
1122
extern union tree_node * GHS_default_section_names [(int) COUNT_OF_GHS_SECTION_KINDS];
1123
extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS];
1124
 
1125
/* The assembler op to start the file.  */
1126
 
1127
#define FILE_ASM_OP "\t.file\n"
1128
 
1129
/* Enable the register move pass to improve code.  */
1130
#define ENABLE_REGMOVE_PASS
1131
 
1132
 
1133
/* Implement ZDA, TDA, and SDA */
1134
 
1135
#define EP_REGNUM 30    /* ep register number */
1136
 
1137
#define SYMBOL_FLAG_ZDA         (SYMBOL_FLAG_MACH_DEP << 0)
1138
#define SYMBOL_FLAG_TDA         (SYMBOL_FLAG_MACH_DEP << 1)
1139
#define SYMBOL_FLAG_SDA         (SYMBOL_FLAG_MACH_DEP << 2)
1140
#define SYMBOL_REF_ZDA_P(X)     ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ZDA) != 0)
1141
#define SYMBOL_REF_TDA_P(X)     ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_TDA) != 0)
1142
#define SYMBOL_REF_SDA_P(X)     ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SDA) != 0)
1143
 
1144
#define TARGET_ASM_INIT_SECTIONS v850_asm_init_sections
1145
 
1146
#endif /* ! GCC_V850_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.