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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [fr30/] [fr30.h] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/*{{{  Comment.  */
2
 
3
/* Definitions of FR30 target.
4
   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
5
   Free Software Foundation, Inc.
6
   Contributed by Cygnus Solutions.
7
 
8
This file is part of GCC.
9
 
10
GCC is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2, or (at your option)
13
any later version.
14
 
15
GCC is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
GNU General Public License for more details.
19
 
20
You should have received a copy of the GNU General Public License
21
along with GCC; see the file COPYING.  If not, write to
22
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23
Boston, MA 02110-1301, USA.  */
24
 
25
/*}}}*/ 
26
/*{{{  Driver configuration.  */
27
 
28
/* Defined in svr4.h.  */
29
#undef SWITCH_TAKES_ARG
30
 
31
/* Defined in svr4.h.  */
32
#undef WORD_SWITCH_TAKES_ARG
33
 
34
/*}}}*/ 
35
/*{{{  Run-time target specifications.  */
36
 
37
#undef  ASM_SPEC
38
#define ASM_SPEC "%{v}"
39
 
40
/* Define this to be a string constant containing `-D' options to define the
41
   predefined macros that identify this machine and system.  These macros will
42
   be predefined unless the `-ansi' option is specified.  */
43
 
44
#define TARGET_CPU_CPP_BUILTINS()               \
45
  do                                            \
46
    {                                           \
47
      builtin_define_std ("fr30");              \
48
      builtin_assert ("machine=fr30");          \
49
    }                                           \
50
   while (0)
51
 
52
#define TARGET_VERSION fprintf (stderr, " (fr30)");
53
 
54
#define CAN_DEBUG_WITHOUT_FP
55
 
56
#undef  STARTFILE_SPEC
57
#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
58
 
59
/* Include the OS stub library, so that the code can be simulated.
60
   This is not the right way to do this.  Ideally this kind of thing
61
   should be done in the linker script - but I have not worked out how
62
   to specify the location of a linker script in a gcc command line yet... */
63
#undef  ENDFILE_SPEC
64
#define ENDFILE_SPEC  "%{!mno-lsim:-lsim} crtend.o%s crtn.o%s"
65
 
66
/*}}}*/ 
67
/*{{{  Storage Layout.  */
68
 
69
#define BITS_BIG_ENDIAN 1
70
 
71
#define BYTES_BIG_ENDIAN 1
72
 
73
#define WORDS_BIG_ENDIAN 1
74
 
75
#define UNITS_PER_WORD  4
76
 
77
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)       \
78
  do                                            \
79
    {                                           \
80
      if (GET_MODE_CLASS (MODE) == MODE_INT     \
81
          && GET_MODE_SIZE (MODE) < 4)          \
82
        (MODE) = SImode;                        \
83
    }                                           \
84
  while (0)
85
 
86
#define PARM_BOUNDARY 32
87
 
88
#define STACK_BOUNDARY 32
89
 
90
#define FUNCTION_BOUNDARY 32
91
 
92
#define BIGGEST_ALIGNMENT 32
93
 
94
#define DATA_ALIGNMENT(TYPE, ALIGN)             \
95
  (TREE_CODE (TYPE) == ARRAY_TYPE               \
96
   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
97
   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
98
 
99
#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
100
  (TREE_CODE (EXP) == STRING_CST        \
101
   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
102
 
103
#define STRICT_ALIGNMENT 1
104
 
105
/* Defined in svr4.h.  */
106
#define PCC_BITFIELD_TYPE_MATTERS 1
107
 
108
/*}}}*/ 
109
/*{{{  Layout of Source Language Data Types.  */
110
 
111
#define SHORT_TYPE_SIZE         16
112
#define INT_TYPE_SIZE           32
113
#define LONG_TYPE_SIZE          32
114
#define LONG_LONG_TYPE_SIZE     64
115
#define FLOAT_TYPE_SIZE         32
116
#define DOUBLE_TYPE_SIZE        64
117
#define LONG_DOUBLE_TYPE_SIZE   64
118
 
119
#define DEFAULT_SIGNED_CHAR 1
120
 
121
/*}}}*/ 
122
/*{{{  REGISTER BASICS.  */
123
 
124
/* Number of hardware registers known to the compiler.  They receive numbers 0
125
   through `FIRST_PSEUDO_REGISTER-1'; thus, the first pseudo register's number
126
   really is assigned the number `FIRST_PSEUDO_REGISTER'.  */
127
#define FIRST_PSEUDO_REGISTER   21
128
 
129
/* Fixed register assignments: */
130
 
131
/* Here we do a BAD THING - reserve a register for use by the machine
132
   description file.  There are too many places in compiler where it
133
   assumes that it can issue a branch or jump instruction without
134
   providing a scratch register for it, and reload just cannot cope, so
135
   we keep a register back for these situations.  */
136
#define COMPILER_SCRATCH_REGISTER 0
137
 
138
/* The register that contains the result of a function call.  */
139
#define RETURN_VALUE_REGNUM      4
140
 
141
/* The first register that can contain the arguments to a function.  */
142
#define FIRST_ARG_REGNUM         4
143
 
144
/* A call-used register that can be used during the function prologue.  */
145
#define PROLOGUE_TMP_REGNUM      COMPILER_SCRATCH_REGISTER
146
 
147
/* Register numbers used for passing a function's static chain pointer.  If
148
   register windows are used, the register number as seen by the called
149
   function is `STATIC_CHAIN_INCOMING_REGNUM', while the register number as
150
   seen by the calling function is `STATIC_CHAIN_REGNUM'.  If these registers
151
   are the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
152
 
153
   The static chain register need not be a fixed register.
154
 
155
   If the static chain is passed in memory, these macros should not be defined;
156
   instead, the next two macros should be defined.  */
157
#define STATIC_CHAIN_REGNUM     12
158
/* #define STATIC_CHAIN_INCOMING_REGNUM */
159
 
160
/* An FR30 specific hardware register.  */
161
#define ACCUMULATOR_REGNUM      13
162
 
163
/* The register number of the frame pointer register, which is used to access
164
   automatic variables in the stack frame.  On some machines, the hardware
165
   determines which register this is.  On other machines, you can choose any
166
   register you wish for this purpose.  */
167
#define FRAME_POINTER_REGNUM    14
168
 
169
/* The register number of the stack pointer register, which must also be a
170
   fixed register according to `FIXED_REGISTERS'.  On most machines, the
171
   hardware determines which register this is.  */
172
#define STACK_POINTER_REGNUM    15
173
 
174
/* The following a fake hard registers that describe some of the dedicated
175
   registers on the FR30.  */
176
#define CONDITION_CODE_REGNUM   16
177
#define RETURN_POINTER_REGNUM   17
178
#define MD_HIGH_REGNUM          18
179
#define MD_LOW_REGNUM           19
180
 
181
/* An initializer that says which registers are used for fixed purposes all
182
   throughout the compiled code and are therefore not available for general
183
   allocation.  These would include the stack pointer, the frame pointer
184
   (except on machines where that can be used as a general register when no
185
   frame pointer is needed), the program counter on machines where that is
186
   considered one of the addressable registers, and any other numbered register
187
   with a standard use.
188
 
189
   This information is expressed as a sequence of numbers, separated by commas
190
   and surrounded by braces.  The Nth number is 1 if register N is fixed, 0
191
   otherwise.
192
 
193
   The table initialized from this macro, and the table initialized by the
194
   following one, may be overridden at run time either automatically, by the
195
   actions of the macro `CONDITIONAL_REGISTER_USAGE', or by the user with the
196
   command options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.  */
197
#define FIXED_REGISTERS                         \
198
  { 1, 0, 0, 0, 0, 0, 0, 0,    /*  0 -  7 */   \
199
    0, 0, 0, 0, 0, 0, 0, 1,    /*  8 - 15 */   \
200
    1, 1, 1, 1, 1 }             /* 16 - 20 */
201
 
202
/* XXX - MDL and MDH set as fixed for now - this is until I can get the
203
   mul patterns working.  */
204
 
205
/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
206
   general) by function calls as well as for fixed registers.  This macro
207
   therefore identifies the registers that are not available for general
208
   allocation of values that must live across function calls.
209
 
210
   If a register has 0 in `CALL_USED_REGISTERS', the compiler automatically
211
   saves it on function entry and restores it on function exit, if the register
212
   is used within the function.  */
213
#define CALL_USED_REGISTERS                     \
214
  { 1, 1, 1, 1, 1, 1, 1, 1,     /*  0 -  7 */   \
215
    0, 0, 0, 0, 1, 1, 0, 1,  /*  8 - 15 */   \
216
    1, 1, 1, 1, 1 }             /* 16 - 20 */
217
 
218
/* A C initializer containing the assembler's names for the machine registers,
219
   each one as a C string constant.  This is what translates register numbers
220
   in the compiler into assembler language.  */
221
#define REGISTER_NAMES                                          \
222
{   "r0", "r1", "r2",  "r3",  "r4",  "r5", "r6", "r7",  \
223
    "r8", "r9", "r10", "r11", "r12", "ac", "fp", "sp",  \
224
    "cc", "rp", "mdh", "mdl", "ap"                      \
225
}
226
 
227
/* If defined, a C initializer for an array of structures containing a name and
228
   a register number.  This macro defines additional names for hard registers,
229
   thus allowing the `asm' option in declarations to refer to registers using
230
   alternate names.  */
231
#define ADDITIONAL_REGISTER_NAMES                               \
232
{                                                               \
233
  {"r13", 13}, {"r14", 14}, {"r15", 15}, {"usp", 15}, {"ps", 16}\
234
}
235
 
236
/*}}}*/ 
237
/*{{{  How Values Fit in Registers.  */
238
 
239
/* A C expression for the number of consecutive hard registers, starting at
240
   register number REGNO, required to hold a value of mode MODE.  */
241
 
242
#define HARD_REGNO_NREGS(REGNO, MODE)                   \
243
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
244
 
245
/* A C expression that is nonzero if it is permissible to store a value of mode
246
   MODE in hard register number REGNO (or in several registers starting with
247
   that one).  */
248
 
249
#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
250
 
251
/* A C expression that is nonzero if it is desirable to choose register
252
   allocation so as to avoid move instructions between a value of mode MODE1
253
   and a value of mode MODE2.
254
 
255
   If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
256
   ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
257
   zero.  */
258
#define MODES_TIEABLE_P(MODE1, MODE2) 1
259
 
260
/*}}}*/ 
261
/*{{{  Register Classes.  */
262
 
263
/* An enumeral type that must be defined with all the register class names as
264
   enumeral values.  `NO_REGS' must be first.  `ALL_REGS' must be the last
265
   register class, followed by one more enumeral value, `LIM_REG_CLASSES',
266
   which is not a register class but rather tells how many classes there are.
267
 
268
   Each register class has a number, which is the value of casting the class
269
   name to type `int'.  The number serves as an index in many of the tables
270
   described below.  */
271
enum reg_class
272
{
273
  NO_REGS,
274
  MULTIPLY_32_REG,      /* the MDL register as used by the MULH, MULUH insns */
275
  MULTIPLY_64_REG,      /* the MDH,MDL register pair as used by MUL and MULU */
276
  LOW_REGS,             /* registers 0 through 7 */
277
  HIGH_REGS,            /* registers 8 through 15 */
278
  REAL_REGS,            /* i.e. all the general hardware registers on the FR30 */
279
  ALL_REGS,
280
  LIM_REG_CLASSES
281
};
282
 
283
#define GENERAL_REGS    REAL_REGS
284
#define N_REG_CLASSES   ((int) LIM_REG_CLASSES)
285
 
286
/* An initializer containing the names of the register classes as C string
287
   constants.  These names are used in writing some of the debugging dumps.  */
288
#define REG_CLASS_NAMES \
289
{                       \
290
  "NO_REGS",            \
291
  "MULTIPLY_32_REG",    \
292
  "MULTIPLY_64_REG",    \
293
  "LOW_REGS",           \
294
  "HIGH_REGS",          \
295
  "REAL_REGS",          \
296
  "ALL_REGS"            \
297
 }
298
 
299
/* An initializer containing the contents of the register classes, as integers
300
   which are bit masks.  The Nth integer specifies the contents of class N.
301
   The way the integer MASK is interpreted is that register R is in the class
302
   if `MASK & (1 << R)' is 1.
303
 
304
   When the machine has more than 32 registers, an integer does not suffice.
305
   Then the integers are replaced by sub-initializers, braced groupings
306
   containing several integers.  Each sub-initializer must be suitable as an
307
   initializer for the type `HARD_REG_SET' which is defined in
308
   `hard-reg-set.h'.  */
309
#define REG_CLASS_CONTENTS                              \
310
{                                                       \
311
  { 0 },                                         \
312
  { 1 << MD_LOW_REGNUM },                               \
313
  { (1 << MD_LOW_REGNUM) | (1 << MD_HIGH_REGNUM) },     \
314
  { (1 << 8) - 1 },                                     \
315
  { ((1 << 8) - 1) << 8 },                              \
316
  { (1 << CONDITION_CODE_REGNUM) - 1 },                 \
317
  { (1 << FIRST_PSEUDO_REGISTER) - 1 }                  \
318
}
319
 
320
/* A C expression whose value is a register class containing hard register
321
   REGNO.  In general there is more than one such class; choose a class which
322
   is "minimal", meaning that no smaller class also contains the register.  */
323
#define REGNO_REG_CLASS(REGNO)                  \
324
  ( (REGNO) < 8 ? LOW_REGS                      \
325
  : (REGNO) < CONDITION_CODE_REGNUM ? HIGH_REGS \
326
  : (REGNO) == MD_LOW_REGNUM ? MULTIPLY_32_REG  \
327
  : (REGNO) == MD_HIGH_REGNUM ? MULTIPLY_64_REG \
328
  : ALL_REGS)
329
 
330
/* A macro whose definition is the name of the class to which a valid base
331
   register must belong.  A base register is one used in an address which is
332
   the register value plus a displacement.  */
333
#define BASE_REG_CLASS  REAL_REGS
334
 
335
/* A macro whose definition is the name of the class to which a valid index
336
   register must belong.  An index register is one used in an address where its
337
   value is either multiplied by a scale factor or added to another register
338
   (as well as added to a displacement).  */
339
#define INDEX_REG_CLASS REAL_REGS
340
 
341
/* A C expression which defines the machine-dependent operand constraint
342
   letters for register classes.  If CHAR is such a letter, the value should be
343
   the register class corresponding to it.  Otherwise, the value should be
344
   `NO_REGS'.  The register letter `r', corresponding to class `GENERAL_REGS',
345
   will not be passed to this macro; you do not need to handle it.
346
 
347
   The following letters are unavailable, due to being used as
348
   constraints:
349
        '0'..'9'
350
        '<', '>'
351
        'E', 'F', 'G', 'H'
352
        'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
353
        'Q', 'R', 'S', 'T', 'U'
354
        'V', 'X'
355
        'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
356
 
357
#define REG_CLASS_FROM_LETTER(CHAR)     \
358
     (  (CHAR) == 'd' ? MULTIPLY_64_REG \
359
      : (CHAR) == 'e' ? MULTIPLY_32_REG \
360
      : (CHAR) == 'h' ? HIGH_REGS       \
361
      : (CHAR) == 'l' ? LOW_REGS        \
362
      : (CHAR) == 'a' ? ALL_REGS        \
363
      : NO_REGS)
364
 
365
/* A C expression which is nonzero if register number NUM is suitable for use
366
   as a base register in operand addresses.  It may be either a suitable hard
367
   register or a pseudo register that has been allocated such a hard register.  */
368
#define REGNO_OK_FOR_BASE_P(NUM) 1
369
 
370
/* A C expression which is nonzero if register number NUM is suitable for use
371
   as an index register in operand addresses.  It may be either a suitable hard
372
   register or a pseudo register that has been allocated such a hard register.
373
 
374
   The difference between an index register and a base register is that the
375
   index register may be scaled.  If an address involves the sum of two
376
   registers, neither one of them scaled, then either one may be labeled the
377
   "base" and the other the "index"; but whichever labeling is used must fit
378
   the machine's constraints of which registers may serve in each capacity.
379
   The compiler will try both labelings, looking for one that is valid, and
380
   will reload one or both registers only if neither labeling works.  */
381
#define REGNO_OK_FOR_INDEX_P(NUM) 1
382
 
383
/* A C expression that places additional restrictions on the register class to
384
   use when it is necessary to copy value X into a register in class CLASS.
385
   The value is a register class; perhaps CLASS, or perhaps another, smaller
386
   class.  On many machines, the following definition is safe:
387
 
388
        #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
389
 
390
   Sometimes returning a more restrictive class makes better code.  For
391
   example, on the 68000, when X is an integer constant that is in range for a
392
   `moveq' instruction, the value of this macro is always `DATA_REGS' as long
393
   as CLASS includes the data registers.  Requiring a data register guarantees
394
   that a `moveq' will be used.
395
 
396
   If X is a `const_double', by returning `NO_REGS' you can force X into a
397
   memory constant.  This is useful on certain machines where immediate
398
   floating values cannot be loaded into certain kinds of registers.  */
399
#define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
400
 
401
/* A C expression for the maximum number of consecutive registers of
402
   class CLASS needed to hold a value of mode MODE.
403
 
404
   This is closely related to the macro `HARD_REGNO_NREGS'.  In fact, the value
405
   of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of
406
   `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS.
407
 
408
   This macro helps control the handling of multiple-word values in
409
   the reload pass.  */
410
#define CLASS_MAX_NREGS(CLASS, MODE) HARD_REGNO_NREGS (0, MODE)
411
 
412
/*}}}*/ 
413
/*{{{  CONSTANTS.  */
414
 
415
/* A C expression that defines the machine-dependent operand constraint letters
416
   (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
417
   If C is one of those letters, the expression should check that VALUE, an
418
   integer, is in the appropriate range and return 1 if so, 0 otherwise.  If C
419
   is not one of those letters, the value should be 0 regardless of VALUE.  */
420
#define CONST_OK_FOR_LETTER_P(VALUE, C)                         \
421
 (  (C) == 'I' ? IN_RANGE (VALUE,    0,       15)                \
422
  : (C) == 'J' ? IN_RANGE (VALUE,  -16,       -1)               \
423
  : (C) == 'K' ? IN_RANGE (VALUE,   16,       31)               \
424
  : (C) == 'L' ? IN_RANGE (VALUE,    0,       (1 <<  8) - 1)     \
425
  : (C) == 'M' ? IN_RANGE (VALUE,    0,       (1 << 20) - 1)     \
426
  : (C) == 'P' ? IN_RANGE (VALUE,  -(1 << 8), (1 <<  8) - 1)    \
427
  : 0)
428
 
429
/* A C expression that defines the machine-dependent operand constraint letters
430
   (`G', `H') that specify particular ranges of `const_double' values.
431
 
432
   If C is one of those letters, the expression should check that VALUE, an RTX
433
   of code `const_double', is in the appropriate range and return 1 if so, 0
434
   otherwise.  If C is not one of those letters, the value should be 0
435
   regardless of VALUE.
436
 
437
   `const_double' is used for all floating-point constants and for `DImode'
438
   fixed-point constants.  A given letter can accept either or both kinds of
439
   values.  It can use `GET_MODE' to distinguish between these kinds.  */
440
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
441
 
442
/* A C expression that defines the optional machine-dependent constraint
443
   letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
444
   types of operands, usually memory references, for the target machine.
445
   Normally this macro will not be defined.  If it is required for a particular
446
   target machine, it should return 1 if VALUE corresponds to the operand type
447
   represented by the constraint letter C.  If C is not defined as an extra
448
   constraint, the value returned should be 0 regardless of VALUE.
449
 
450
   For example, on the ROMP, load instructions cannot have their output in r0
451
   if the memory reference contains a symbolic address.  Constraint letter `Q'
452
   is defined as representing a memory address that does *not* contain a
453
   symbolic address.  An alternative is specified with a `Q' constraint on the
454
   input and `r' on the output.  The next alternative specifies `m' on the
455
   input and a register class that does not include r0 on the output.  */
456
#define EXTRA_CONSTRAINT(VALUE, C) \
457
   ((C) == 'Q' ? (GET_CODE (VALUE) == MEM && GET_CODE (XEXP (VALUE, 0)) == SYMBOL_REF) : 0)
458
 
459
/*}}}*/ 
460
/*{{{  Basic Stack Layout.  */
461
 
462
/* Define this macro if pushing a word onto the stack moves the stack pointer
463
   to a smaller address.  */
464
#define STACK_GROWS_DOWNWARD 1
465
 
466
/* Define this to macro nonzero if the addresses of local variable slots
467
   are at negative offsets from the frame pointer.  */
468
#define FRAME_GROWS_DOWNWARD 1
469
 
470
/* Offset from the frame pointer to the first local variable slot to be
471
   allocated.
472
 
473
   If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the
474
   first slot's length from `STARTING_FRAME_OFFSET'.  Otherwise, it is found by
475
   adding the length of the first slot to the value `STARTING_FRAME_OFFSET'.  */
476
/* #define STARTING_FRAME_OFFSET -4 */
477
#define STARTING_FRAME_OFFSET 0
478
 
479
/* Offset from the stack pointer register to the first location at which
480
   outgoing arguments are placed.  If not specified, the default value of zero
481
   is used.  This is the proper value for most machines.
482
 
483
   If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
484
   location at which outgoing arguments are placed.  */
485
#define STACK_POINTER_OFFSET 0
486
 
487
/* Offset from the argument pointer register to the first argument's address.
488
   On some machines it may depend on the data type of the function.
489
 
490
   If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
491
   argument's address.  */
492
#define FIRST_PARM_OFFSET(FUNDECL) 0
493
 
494
/* A C expression whose value is RTL representing the location of the incoming
495
   return address at the beginning of any function, before the prologue.  This
496
   RTL is either a `REG', indicating that the return value is saved in `REG',
497
   or a `MEM' representing a location in the stack.
498
 
499
   You only need to define this macro if you want to support call frame
500
   debugging information like that provided by DWARF 2.  */
501
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, RETURN_POINTER_REGNUM)
502
 
503
/*}}}*/ 
504
/*{{{  Register That Address the Stack Frame.  */
505
 
506
/* The register number of the arg pointer register, which is used to access the
507
   function's argument list.  On some machines, this is the same as the frame
508
   pointer register.  On some machines, the hardware determines which register
509
   this is.  On other machines, you can choose any register you wish for this
510
   purpose.  If this is not the same register as the frame pointer register,
511
   then you must mark it as a fixed register according to `FIXED_REGISTERS', or
512
   arrange to be able to eliminate it.  */
513
#define ARG_POINTER_REGNUM 20
514
 
515
/*}}}*/ 
516
/*{{{  Eliminating the Frame Pointer and the Arg Pointer.  */
517
 
518
/* A C expression which is nonzero if a function must have and use a frame
519
   pointer.  This expression is evaluated in the reload pass.  If its value is
520
   nonzero the function will have a frame pointer.
521
 
522
   The expression can in principle examine the current function and decide
523
   according to the facts, but on most machines the constant 0 or the constant
524
   1 suffices.  Use 0 when the machine allows code to be generated with no
525
   frame pointer, and doing so saves some time or space.  Use 1 when there is
526
   no possible advantage to avoiding a frame pointer.
527
 
528
   In certain cases, the compiler does not know how to produce valid code
529
   without a frame pointer.  The compiler recognizes those cases and
530
   automatically gives the function a frame pointer regardless of what
531
   `FRAME_POINTER_REQUIRED' says.  You don't need to worry about them.
532
 
533
   In a function that does not require a frame pointer, the frame pointer
534
   register can be allocated for ordinary usage, unless you mark it as a fixed
535
   register.  See `FIXED_REGISTERS' for more information.  */
536
/* #define FRAME_POINTER_REQUIRED 0 */
537
#define FRAME_POINTER_REQUIRED \
538
     (flag_omit_frame_pointer == 0 || current_function_pretend_args_size > 0)
539
 
540
/* If defined, this macro specifies a table of register pairs used to eliminate
541
   unneeded registers that point into the stack frame.  If it is not defined,
542
   the only elimination attempted by the compiler is to replace references to
543
   the frame pointer with references to the stack pointer.
544
 
545
   The definition of this macro is a list of structure initializations, each of
546
   which specifies an original and replacement register.
547
 
548
   On some machines, the position of the argument pointer is not known until
549
   the compilation is completed.  In such a case, a separate hard register must
550
   be used for the argument pointer.  This register can be eliminated by
551
   replacing it with either the frame pointer or the argument pointer,
552
   depending on whether or not the frame pointer has been eliminated.
553
 
554
   In this case, you might specify:
555
        #define ELIMINABLE_REGS  \
556
        {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
557
         {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
558
         {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
559
 
560
   Note that the elimination of the argument pointer with the stack pointer is
561
   specified first since that is the preferred elimination.  */
562
 
563
#define ELIMINABLE_REGS                         \
564
{                                               \
565
  {ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM}, \
566
  {ARG_POINTER_REGNUM,   FRAME_POINTER_REGNUM}, \
567
  {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}  \
568
}
569
 
570
/* A C expression that returns nonzero if the compiler is allowed to try to
571
   replace register number FROM with register number TO.  This macro
572
   need only be defined if `ELIMINABLE_REGS' is defined, and will usually be
573
   the constant 1, since most of the cases preventing register elimination are
574
   things that the compiler already knows about.  */
575
 
576
#define CAN_ELIMINATE(FROM, TO)                                         \
577
 ((TO) == FRAME_POINTER_REGNUM || ! frame_pointer_needed)
578
 
579
/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It specifies the
580
   initial difference between the specified pair of registers.  This macro must
581
   be defined if `ELIMINABLE_REGS' is defined.  */
582
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
583
     (OFFSET) = fr30_compute_frame_size (FROM, TO)
584
 
585
/*}}}*/ 
586
/*{{{  Passing Function Arguments on the Stack.  */
587
 
588
/* If defined, the maximum amount of space required for outgoing arguments will
589
   be computed and placed into the variable
590
   `current_function_outgoing_args_size'.  No space will be pushed onto the
591
   stack for each call; instead, the function prologue should increase the
592
   stack frame size by this amount.
593
 
594
   Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is not
595
   proper.  */
596
#define ACCUMULATE_OUTGOING_ARGS 1
597
 
598
/* A C expression that should indicate the number of bytes of its own arguments
599
   that a function pops on returning, or 0 if the function pops no arguments
600
   and the caller must therefore pop them all after the function returns.
601
 
602
   FUNDECL is a C variable whose value is a tree node that describes the
603
   function in question.  Normally it is a node of type `FUNCTION_DECL' that
604
   describes the declaration of the function.  From this it is possible to
605
   obtain the DECL_ATTRIBUTES of the function.
606
 
607
   FUNTYPE is a C variable whose value is a tree node that describes the
608
   function in question.  Normally it is a node of type `FUNCTION_TYPE' that
609
   describes the data type of the function.  From this it is possible to obtain
610
   the data types of the value and arguments (if known).
611
 
612
   When a call to a library function is being considered, FUNTYPE will contain
613
   an identifier node for the library function.  Thus, if you need to
614
   distinguish among various library functions, you can do so by their names.
615
   Note that "library function" in this context means a function used to
616
   perform arithmetic, whose name is known specially in the compiler and was
617
   not mentioned in the C code being compiled.
618
 
619
   STACK-SIZE is the number of bytes of arguments passed on the stack.  If a
620
   variable number of bytes is passed, it is zero, and argument popping will
621
   always be the responsibility of the calling function.
622
 
623
   On the VAX, all functions always pop their arguments, so the definition of
624
   this macro is STACK-SIZE.  On the 68000, using the standard calling
625
   convention, no functions pop their arguments, so the value of the macro is
626
   always 0 in this case.  But an alternative calling convention is available
627
   in which functions that take a fixed number of arguments pop them but other
628
   functions (such as `printf') pop nothing (the caller pops all).  When this
629
   convention is in use, FUNTYPE is examined to determine whether a function
630
   takes a fixed number of arguments.  */
631
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
632
 
633
/*}}}*/ 
634
/*{{{  Function Arguments in Registers.  */
635
 
636
/* The number of register assigned to holding function arguments.  */
637
 
638
#define FR30_NUM_ARG_REGS        4
639
 
640
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)                    \
641
  (  (NAMED) == 0                    ? NULL_RTX                  \
642
   : targetm.calls.must_pass_in_stack (MODE, TYPE) ? NULL_RTX   \
643
   : (CUM) >= FR30_NUM_ARG_REGS      ? NULL_RTX                 \
644
   : gen_rtx_REG (MODE, CUM + FIRST_ARG_REGNUM))
645
 
646
/* A C type for declaring a variable that is used as the first argument of
647
   `FUNCTION_ARG' and other related values.  For some target machines, the type
648
   `int' suffices and can hold the number of bytes of argument so far.
649
 
650
   There is no need to record in `CUMULATIVE_ARGS' anything about the arguments
651
   that have been passed on the stack.  The compiler has other variables to
652
   keep track of that.  For target machines on which all arguments are passed
653
   on the stack, there is no need to store anything in `CUMULATIVE_ARGS';
654
   however, the data structure must exist and should not be empty, so use
655
   `int'.  */
656
/* On the FR30 this value is an accumulating count of the number of argument
657
   registers that have been filled with argument values, as opposed to say,
658
   the number of bytes of argument accumulated so far.  */
659
#define CUMULATIVE_ARGS int
660
 
661
/* A C statement (sans semicolon) for initializing the variable CUM for the
662
   state at the beginning of the argument list.  The variable has type
663
   `CUMULATIVE_ARGS'.  The value of FNTYPE is the tree node for the data type
664
   of the function which will receive the args, or 0 if the args are to a
665
   compiler support library function.  The value of INDIRECT is nonzero when
666
   processing an indirect call, for example a call through a function pointer.
667
   The value of INDIRECT is zero for a call to an explicitly named function, a
668
   library function call, or when `INIT_CUMULATIVE_ARGS' is used to find
669
   arguments for the function being compiled.
670
 
671
   When processing a call to a compiler support library function, LIBNAME
672
   identifies which one.  It is a `symbol_ref' rtx which contains the name of
673
   the function, as a string.  LIBNAME is 0 when an ordinary C function call is
674
   being processed.  Thus, each time this macro is called, either LIBNAME or
675
   FNTYPE is nonzero, but never both of them at once.  */
676
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
677
  (CUM) = 0
678
 
679
/* A C statement (sans semicolon) to update the summarizer variable CUM to
680
   advance past an argument in the argument list.  The values MODE, TYPE and
681
   NAMED describe that argument.  Once this is done, the variable CUM is
682
   suitable for analyzing the *following* argument with `FUNCTION_ARG', etc.
683
 
684
   This macro need not do anything if the argument in question was passed on
685
   the stack.  The compiler knows how to track the amount of stack space used
686
   for arguments without any special help.  */
687
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                    \
688
  (CUM) += (NAMED) * fr30_num_arg_regs (MODE, TYPE)
689
 
690
/* A C expression that is nonzero if REGNO is the number of a hard register in
691
   which function arguments are sometimes passed.  This does *not* include
692
   implicit arguments such as the static chain and the structure-value address.
693
   On many machines, no registers can be used for this purpose since all
694
   function arguments are pushed on the stack.  */
695
#define FUNCTION_ARG_REGNO_P(REGNO) \
696
  ((REGNO) >= FIRST_ARG_REGNUM && ((REGNO) < FIRST_ARG_REGNUM + FR30_NUM_ARG_REGS))
697
 
698
/*}}}*/ 
699
/*{{{  How Scalar Function Values are Returned.  */
700
 
701
#define FUNCTION_VALUE(VALTYPE, FUNC) \
702
     gen_rtx_REG (TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM)
703
 
704
/* A C expression to create an RTX representing the place where a library
705
   function returns a value of mode MODE.  If the precise function being called
706
   is known, FUNC is a tree node (`FUNCTION_DECL') for it; otherwise, FUNC is a
707
   null pointer.  This makes it possible to use a different value-returning
708
   convention for specific functions when all their calls are known.
709
 
710
   Note that "library function" in this context means a compiler support
711
   routine, used to perform arithmetic, whose name is known specially by the
712
   compiler and was not mentioned in the C code being compiled.
713
 
714
   The definition of `LIBRARY_VALUE' need not be concerned aggregate data
715
   types, because none of the library functions returns such types.  */
716
#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RETURN_VALUE_REGNUM)
717
 
718
/* A C expression that is nonzero if REGNO is the number of a hard register in
719
   which the values of called function may come back.  */
720
 
721
#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
722
 
723
/*}}}*/ 
724
/*{{{  How Large Values are Returned.  */
725
 
726
/* Define this macro to be 1 if all structure and union return values must be
727
   in memory.  Since this results in slower code, this should be defined only
728
   if needed for compatibility with other compilers or with an ABI.  If you
729
   define this macro to be 0, then the conventions used for structure and union
730
   return values are decided by the `RETURN_IN_MEMORY' macro.
731
 
732
   If not defined, this defaults to the value 1.  */
733
#define DEFAULT_PCC_STRUCT_RETURN 1
734
 
735
/*}}}*/ 
736
/*{{{  Generating Code for Profiling.  */
737
 
738
/* A C statement or compound statement to output to FILE some assembler code to
739
   call the profiling subroutine `mcount'.  Before calling, the assembler code
740
   must load the address of a counter variable into a register where `mcount'
741
   expects to find the address.  The name of this variable is `LP' followed by
742
   the number LABELNO, so you would generate the name using `LP%d' in a
743
   `fprintf'.
744
 
745
   The details of how the address should be passed to `mcount' are determined
746
   by your operating system environment, not by GCC.  To figure them out,
747
   compile a small program for profiling using the system's installed C
748
   compiler and look at the assembler code that results.  */
749
#define FUNCTION_PROFILER(FILE, LABELNO)        \
750
{                                               \
751
  fprintf (FILE, "\t mov rp, r1\n" );           \
752
  fprintf (FILE, "\t ldi:32 mcount, r0\n" );    \
753
  fprintf (FILE, "\t call @r0\n" );             \
754
  fprintf (FILE, ".word\tLP%d\n", LABELNO);     \
755
}
756
 
757
/*}}}*/ 
758
/*{{{  Trampolines for Nested Functions.  */
759
 
760
/* On the FR30, the trampoline is:
761
 
762
   nop
763
   ldi:32 STATIC, r12
764
   nop
765
   ldi:32 FUNCTION, r0
766
   jmp    @r0
767
 
768
   The no-ops are to guarantee that the static chain and final
769
   target are 32 bit aligned within the trampoline.  That allows us to
770
   initialize those locations with simple SImode stores.   The alternative
771
   would be to use HImode stores.  */
772
 
773
/* A C statement to output, on the stream FILE, assembler code for a block of
774
   data that contains the constant parts of a trampoline.  This code should not
775
   include a label--the label is taken care of automatically.  */
776
#define TRAMPOLINE_TEMPLATE(FILE)                                               \
777
{                                                                               \
778
  fprintf (FILE, "\tnop\n");                                                    \
779
  fprintf (FILE, "\tldi:32\t#0, %s\n", reg_names [STATIC_CHAIN_REGNUM]);        \
780
  fprintf (FILE, "\tnop\n");                                                    \
781
  fprintf (FILE, "\tldi:32\t#0, %s\n", reg_names [COMPILER_SCRATCH_REGISTER]);  \
782
  fprintf (FILE, "\tjmp\t@%s\n", reg_names [COMPILER_SCRATCH_REGISTER]);        \
783
}
784
 
785
/* A C expression for the size in bytes of the trampoline, as an integer.  */
786
#define TRAMPOLINE_SIZE 18
787
 
788
/* We want the trampoline to be aligned on a 32bit boundary so that we can
789
   make sure the location of the static chain & target function within
790
   the trampoline is also aligned on a 32bit boundary.  */
791
#define TRAMPOLINE_ALIGNMENT 32
792
 
793
/* A C statement to initialize the variable parts of a trampoline.  ADDR is an
794
   RTX for the address of the trampoline; FNADDR is an RTX for the address of
795
   the nested function; STATIC_CHAIN is an RTX for the static chain value that
796
   should be passed to the function when it is called.  */
797
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN)                       \
798
do                                                                              \
799
{                                                                               \
800
  emit_move_insn (gen_rtx_MEM (SImode, plus_constant (ADDR, 4)), STATIC_CHAIN);\
801
  emit_move_insn (gen_rtx_MEM (SImode, plus_constant (ADDR, 12)), FNADDR);      \
802
} while (0);
803
 
804
/*}}}*/ 
805
/*{{{  Addressing Modes.  */
806
 
807
/* A C expression that is 1 if the RTX X is a constant which is a valid
808
   address.  On most machines, this can be defined as `CONSTANT_P (X)', but a
809
   few machines are more restrictive in which constant addresses are supported.
810
 
811
   `CONSTANT_P' accepts integer-values expressions whose values are not
812
   explicitly known, such as `symbol_ref', `label_ref', and `high' expressions
813
   and `const' arithmetic expressions, in addition to `const_int' and
814
   `const_double' expressions.  */
815
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
816
 
817
/* A number, the maximum number of registers that can appear in a valid memory
818
   address.  Note that it is up to you to specify a value equal to the maximum
819
   number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept.  */
820
#define MAX_REGS_PER_ADDRESS 1
821
 
822
/* A C compound statement with a conditional `goto LABEL;' executed if X (an
823
   RTX) is a legitimate memory address on the target machine for a memory
824
   operand of mode MODE.  */
825
 
826
/* On the FR30 we only have one real addressing mode - an address in a
827
   register.  There are three special cases however:
828
 
829
   * indexed addressing using small positive offsets from the stack pointer
830
 
831
   * indexed addressing using small signed offsets from the frame pointer
832
 
833
   * register plus register addressing using R13 as the base register.
834
 
835
   At the moment we only support the first two of these special cases.  */
836
 
837
#ifdef REG_OK_STRICT
838
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                        \
839
  do                                                                    \
840
    {                                                                   \
841
      if (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))                 \
842
        goto LABEL;                                                     \
843
      if (GET_CODE (X) == PLUS                                          \
844
          && ((MODE) == SImode || (MODE) == SFmode)                     \
845
          && XEXP (X, 0) == stack_pointer_rtx                            \
846
          && GET_CODE (XEXP (X, 1)) == CONST_INT                        \
847
          && IN_RANGE (INTVAL (XEXP (X, 1)), 0, (1 <<  6) - 4))          \
848
        goto LABEL;                                                     \
849
      if (GET_CODE (X) == PLUS                                          \
850
          && ((MODE) == SImode || (MODE) == SFmode)                     \
851
          && XEXP (X, 0) == frame_pointer_rtx                            \
852
          && GET_CODE (XEXP (X, 1)) == CONST_INT                        \
853
          && IN_RANGE (INTVAL (XEXP (X, 1)), -(1 << 9), (1 <<  9) - 4)) \
854
        goto LABEL;                                                     \
855
    }                                                                   \
856
  while (0)
857
#else
858
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                        \
859
  do                                                                    \
860
    {                                                                   \
861
      if (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))                 \
862
        goto LABEL;                                                     \
863
      if (GET_CODE (X) == PLUS                                          \
864
          && ((MODE) == SImode || (MODE) == SFmode)                     \
865
          && XEXP (X, 0) == stack_pointer_rtx                            \
866
          && GET_CODE (XEXP (X, 1)) == CONST_INT                        \
867
          && IN_RANGE (INTVAL (XEXP (X, 1)), 0, (1 <<  6) - 4))          \
868
        goto LABEL;                                                     \
869
      if (GET_CODE (X) == PLUS                                          \
870
          && ((MODE) == SImode || (MODE) == SFmode)                     \
871
          && GET_CODE (XEXP (X, 0)) == REG \
872
          && (REGNO (XEXP (X, 0)) == FRAME_POINTER_REGNUM \
873
           || REGNO (XEXP (X, 0)) == ARG_POINTER_REGNUM) \
874
          && GET_CODE (XEXP (X, 1)) == CONST_INT                        \
875
          && IN_RANGE (INTVAL (XEXP (X, 1)), -(1 << 9), (1 <<  9) - 4)) \
876
        goto LABEL;                                                     \
877
    }                                                                   \
878
  while (0)
879
#endif
880
 
881
/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
882
   use as a base register.  For hard registers, it should always accept those
883
   which the hardware permits and reject the others.  Whether the macro accepts
884
   or rejects pseudo registers must be controlled by `REG_OK_STRICT' as
885
   described above.  This usually requires two variant definitions, of which
886
   `REG_OK_STRICT' controls the one actually used.  */
887
#ifdef REG_OK_STRICT
888
#define REG_OK_FOR_BASE_P(X) (((unsigned) REGNO (X)) <= STACK_POINTER_REGNUM)
889
#else
890
#define REG_OK_FOR_BASE_P(X) 1
891
#endif
892
 
893
/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
894
   use as an index register.
895
 
896
   The difference between an index register and a base register is that the
897
   index register may be scaled.  If an address involves the sum of two
898
   registers, neither one of them scaled, then either one may be labeled the
899
   "base" and the other the "index"; but whichever labeling is used must fit
900
   the machine's constraints of which registers may serve in each capacity.
901
   The compiler will try both labelings, looking for one that is valid, and
902
   will reload one or both registers only if neither labeling works.  */
903
#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
904
 
905
/* A C statement or compound statement with a conditional `goto LABEL;'
906
   executed if memory address X (an RTX) can have different meanings depending
907
   on the machine mode of the memory reference it is used for or if the address
908
   is valid for some modes but not others.
909
 
910
   Autoincrement and autodecrement addresses typically have mode-dependent
911
   effects because the amount of the increment or decrement is the size of the
912
   operand being addressed.  Some machines have other mode-dependent addresses.
913
   Many RISC machines have no mode-dependent addresses.
914
 
915
   You may assume that ADDR is a valid address for the machine.  */
916
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
917
 
918
/* A C expression that is nonzero if X is a legitimate constant for an
919
   immediate operand on the target machine.  You can assume that X satisfies
920
   `CONSTANT_P', so you need not check this.  In fact, `1' is a suitable
921
   definition for this macro on machines where anything `CONSTANT_P' is valid.  */
922
#define LEGITIMATE_CONSTANT_P(X) 1
923
 
924
/*}}}*/ 
925
/*{{{  Describing Relative Costs of Operations */
926
 
927
/* Define this macro as a C expression which is nonzero if accessing less than
928
   a word of memory (i.e. a `char' or a `short') is no faster than accessing a
929
   word of memory, i.e., if such access require more than one instruction or if
930
   there is no difference in cost between byte and (aligned) word loads.
931
 
932
   When this macro is not defined, the compiler will access a field by finding
933
   the smallest containing object; when it is defined, a fullword load will be
934
   used if alignment permits.  Unless bytes accesses are faster than word
935
   accesses, using word accesses is preferable since it may eliminate
936
   subsequent memory access if subsequent accesses occur to other fields in the
937
   same word of the structure, but to different bytes.  */
938
#define SLOW_BYTE_ACCESS 1
939
 
940
/*}}}*/ 
941
/*{{{  Dividing the output into sections.  */
942
 
943
/* A C expression whose value is a string containing the assembler operation
944
   that should precede instructions and read-only data.  Normally `".text"' is
945
   right.  */
946
#define TEXT_SECTION_ASM_OP "\t.text"
947
 
948
/* A C expression whose value is a string containing the assembler operation to
949
   identify the following data as writable initialized data.  Normally
950
   `".data"' is right.  */
951
#define DATA_SECTION_ASM_OP "\t.data"
952
 
953
/* If defined, a C expression whose value is a string containing the
954
   assembler operation to identify the following data as
955
   uninitialized global data.  If not defined, and neither
956
   `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
957
   uninitialized global data will be output in the data section if
958
   `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
959
   used.  */
960
#define BSS_SECTION_ASM_OP "\t.section .bss"
961
 
962
/*}}}*/ 
963
/*{{{  The Overall Framework of an Assembler File.  */
964
 
965
/* A C string constant describing how to begin a comment in the target
966
   assembler language.  The compiler assumes that the comment will end at the
967
   end of the line.  */
968
#define ASM_COMMENT_START ";"
969
 
970
/* A C string constant for text to be output before each `asm' statement or
971
   group of consecutive ones.  Normally this is `"#APP"', which is a comment
972
   that has no effect on most assemblers but tells the GNU assembler that it
973
   must check the lines that follow for all valid assembler constructs.  */
974
#define ASM_APP_ON "#APP\n"
975
 
976
/* A C string constant for text to be output after each `asm' statement or
977
   group of consecutive ones.  Normally this is `"#NO_APP"', which tells the
978
   GNU assembler to resume making the time-saving assumptions that are valid
979
   for ordinary compiler output.  */
980
#define ASM_APP_OFF "#NO_APP\n"
981
 
982
/*}}}*/ 
983
/*{{{  Output and Generation of Labels.  */
984
 
985
/* Globalizing directive for a label.  */
986
#define GLOBAL_ASM_OP "\t.globl "
987
 
988
/*}}}*/ 
989
/*{{{  Output of Assembler Instructions.  */
990
 
991
/* A C compound statement to output to stdio stream STREAM the assembler syntax
992
   for an instruction operand X.  X is an RTL expression.
993
 
994
   CODE is a value that can be used to specify one of several ways of printing
995
   the operand.  It is used when identical operands must be printed differently
996
   depending on the context.  CODE comes from the `%' specification that was
997
   used to request printing of the operand.  If the specification was just
998
   `%DIGIT' then CODE is 0; if the specification was `%LTR DIGIT' then CODE is
999
   the ASCII code for LTR.
1000
 
1001
   If X is a register, this macro should print the register's name.  The names
1002
   can be found in an array `reg_names' whose type is `char *[]'.  `reg_names'
1003
   is initialized from `REGISTER_NAMES'.
1004
 
1005
   When the machine description has a specification `%PUNCT' (a `%' followed by
1006
   a punctuation character), this macro is called with a null pointer for X and
1007
   the punctuation character for CODE.  */
1008
#define PRINT_OPERAND(STREAM, X, CODE)  fr30_print_operand (STREAM, X, CODE)
1009
 
1010
/* A C expression which evaluates to true if CODE is a valid punctuation
1011
   character for use in the `PRINT_OPERAND' macro.  If
1012
   `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no punctuation
1013
   characters (except for the standard one, `%') are used in this way.  */
1014
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) (CODE == '#')
1015
 
1016
/* A C compound statement to output to stdio stream STREAM the assembler syntax
1017
   for an instruction operand that is a memory reference whose address is X.  X
1018
   is an RTL expression.  */
1019
 
1020
#define PRINT_OPERAND_ADDRESS(STREAM, X) fr30_print_operand_address (STREAM, X)
1021
 
1022
/* If defined, C string expressions to be used for the `%R', `%L', `%U', and
1023
   `%I' options of `asm_fprintf' (see `final.c').  These are useful when a
1024
   single `md' file must support multiple assembler formats.  In that case, the
1025
   various `tm.h' files can define these macros differently.
1026
 
1027
   USER_LABEL_PREFIX is defined in svr4.h.  */
1028
#define REGISTER_PREFIX "%"
1029
#define LOCAL_LABEL_PREFIX "."
1030
#define USER_LABEL_PREFIX ""
1031
#define IMMEDIATE_PREFIX ""
1032
 
1033
/*}}}*/ 
1034
/*{{{  Output of Dispatch Tables.  */
1035
 
1036
/* This macro should be provided on machines where the addresses in a dispatch
1037
   table are relative to the table's own address.
1038
 
1039
   The definition should be a C statement to output to the stdio stream STREAM
1040
   an assembler pseudo-instruction to generate a difference between two labels.
1041
   VALUE and REL are the numbers of two internal labels.  The definitions of
1042
   these labels are output using `(*targetm.asm_out.internal_label)', and they must be
1043
   printed in the same way here.  For example,
1044
 
1045
        fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL)  */
1046
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
1047
fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
1048
 
1049
/* This macro should be provided on machines where the addresses in a dispatch
1050
   table are absolute.
1051
 
1052
   The definition should be a C statement to output to the stdio stream STREAM
1053
   an assembler pseudo-instruction to generate a reference to a label.  VALUE
1054
   is the number of an internal label whose definition is output using
1055
   `(*targetm.asm_out.internal_label)'.  For example,
1056
 
1057
        fprintf (STREAM, "\t.word L%d\n", VALUE)  */
1058
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
1059
fprintf (STREAM, "\t.word .L%d\n", VALUE)
1060
 
1061
/*}}}*/ 
1062
/*{{{  Assembler Commands for Alignment.  */
1063
 
1064
/* A C statement to output to the stdio stream STREAM an assembler command to
1065
   advance the location counter to a multiple of 2 to the POWER bytes.  POWER
1066
   will be a C expression of type `int'.  */
1067
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
1068
  fprintf ((STREAM), "\t.p2align %d\n", (POWER))
1069
 
1070
/*}}}*/ 
1071
/*{{{  Miscellaneous Parameters.  */
1072
 
1073
/* An alias for a machine mode name.  This is the machine mode that elements of
1074
   a jump-table should have.  */
1075
#define CASE_VECTOR_MODE SImode
1076
 
1077
/* The maximum number of bytes that a single instruction can move quickly from
1078
   memory to memory.  */
1079
#define MOVE_MAX 8
1080
 
1081
/* A C expression which is nonzero if on this machine it is safe to "convert"
1082
   an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
1083
   than INPREC) by merely operating on it as if it had only OUTPREC bits.
1084
 
1085
   On many machines, this expression can be 1.
1086
 
1087
   When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for
1088
   which `MODES_TIEABLE_P' is 0, suboptimal code can result.  If this is the
1089
   case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve
1090
   things.  */
1091
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
1092
 
1093
/* An alias for the machine mode for pointers.  On most machines, define this
1094
   to be the integer mode corresponding to the width of a hardware pointer;
1095
   `SImode' on 32-bit machine or `DImode' on 64-bit machines.  On some machines
1096
   you must define this to be one of the partial integer modes, such as
1097
   `PSImode'.
1098
 
1099
   The width of `Pmode' must be at least as large as the value of
1100
   `POINTER_SIZE'.  If it is not equal, you must define the macro
1101
   `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to `Pmode'.  */
1102
#define Pmode SImode
1103
 
1104
/* An alias for the machine mode used for memory references to functions being
1105
   called, in `call' RTL expressions.  On most machines this should be
1106
   `QImode'.  */
1107
#define FUNCTION_MODE QImode
1108
 
1109
/* If cross-compiling, don't require stdio.h etc to build libgcc.a.  */
1110
#if defined CROSS_COMPILE && ! defined inhibit_libc
1111
#define inhibit_libc
1112
#endif
1113
 
1114
/*}}}*/ 
1115
/*{{{  Exported variables */
1116
 
1117
/* Define the information needed to generate branch and scc insns.  This is
1118
   stored from the compare operation.  Note that we can't use "rtx" here
1119
   since it hasn't been defined!  */
1120
 
1121
extern struct rtx_def * fr30_compare_op0;
1122
extern struct rtx_def * fr30_compare_op1;
1123
 
1124
/*}}}*/ 
1125
 
1126
/* Local Variables: */
1127
/* folded-file: t   */
1128
/* End:             */

powered by: WebSVN 2.1.0

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