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

Subversion Repositories scarts

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Target Definitions for MorphoRISC1
2
   Copyright (C) 2005 Free Software Foundation, Inc.
3
   Contributed by Red Hat, Inc.
4
 
5
   This file is part of GCC.
6
 
7
   GCC is free software; you can redistribute it and/or modify it
8
   under the terms of the GNU General Public License as published
9
   by the Free Software Foundation; either version 2, or (at your
10
   option) any later version.
11
 
12
   GCC is distributed in the hope that it will be useful, but WITHOUT
13
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15
   License for more details.
16
 
17
   You should have received a copy of the GNU General Public License
18
   along with GCC; see the file COPYING.  If not, write to the Free
19
   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20
   02110-1301, USA.  */
21
 
22
extern struct rtx_def * mt_ucmpsi3_libcall;
23
 
24
enum processor_type
25
{
26
  PROCESSOR_MS1_64_001,
27
  PROCESSOR_MS1_16_002,
28
  PROCESSOR_MS1_16_003,
29
  PROCESSOR_MS2
30
};
31
 
32
enum epilogue_type
33
{
34
  EH_EPILOGUE,
35
  NORMAL_EPILOGUE
36
};
37
 
38
extern enum processor_type mt_cpu;
39
 
40
 
41
/* A C string constant that tells the GCC driver program options to pass to
42
   the assembler.  */
43
#undef  ASM_SPEC
44
#define ASM_SPEC "%{march=*} %{!march=*: -march=ms1-16-002}"
45
 
46
/* A string to pass to at the end of the command given to the linker.  */
47
#undef  LIB_SPEC
48
#define LIB_SPEC "--start-group -lc -lsim --end-group \
49
%{msim: ; \
50
march=ms1-64-001:-T 64-001.ld%s; \
51
march=ms1-16-002:-T 16-002.ld%s; \
52
march=ms1-16-003:-T 16-003.ld%s; \
53
march=ms2:-T ms2.ld%s; \
54
         :-T 16-002.ld}"
55
 
56
/* A string to pass at the very beginning of the command given to the
57
   linker.  */
58
#undef  STARTFILE_SPEC
59
#define STARTFILE_SPEC "%{msim:crt0.o%s;\
60
march=ms1-64-001:%{!mno-crt0:crt0-64-001.o%s} startup-64-001.o%s; \
61
march=ms1-16-002:%{!mno-crt0:crt0-16-002.o%s} startup-16-002.o%s; \
62
march=ms1-16-003:%{!mno-crt0:crt0-16-003.o%s} startup-16-003.o%s; \
63
march=ms2:%{!mno-crt0:crt0-ms2.o%s} startup-ms2.o%s; \
64
         :%{!mno-crt0:crt0-16-002.o%s} startup-16-002.o%s} \
65
crti.o%s crtbegin.o%s"
66
 
67
/* A string to pass at the end of the command given to the linker.  */
68
#undef  ENDFILE_SPEC
69
#define ENDFILE_SPEC "%{msim:exit.o%s; \
70
march=ms1-64-001:exit-64-001.o%s; \
71
march=ms1-16-002:exit-16-002.o%s; \
72
march=ms1-16-003:exit-16-003.o%s; \
73
march=ms2:exit-ms2.o%s; \
74
         :exit-16-002.o%s} \
75
 crtend.o%s crtn.o%s"
76
 
77
/* Run-time target specifications.  */
78
 
79
#define TARGET_CPU_CPP_BUILTINS()               \
80
  do                                            \
81
    {                                           \
82
      builtin_define_with_int_value ("__mt__", mt_cpu); \
83
      builtin_assert ("machine=mt");            \
84
    }                                           \
85
  while (0)
86
 
87
#define TARGET_MS1_64_001 (mt_cpu == PROCESSOR_MS1_64_001)
88
#define TARGET_MS1_16_002 (mt_cpu == PROCESSOR_MS1_16_002)
89
#define TARGET_MS1_16_003 (mt_cpu == PROCESSOR_MS1_16_003)
90
#define TARGET_MS2 (mt_cpu == PROCESSOR_MS2)
91
 
92
#define TARGET_VERSION  fprintf (stderr, " (mt)");
93
 
94
#define OVERRIDE_OPTIONS mt_override_options ()
95
 
96
#define CAN_DEBUG_WITHOUT_FP 1
97
 
98
 
99
/* Storage Layout.  */
100
 
101
#define BITS_BIG_ENDIAN 0
102
 
103
#define BYTES_BIG_ENDIAN 1
104
 
105
#define WORDS_BIG_ENDIAN 1
106
 
107
#define UNITS_PER_WORD 4
108
 
109
/* A macro to update MODE and UNSIGNEDP when an object whose type is TYPE and
110
   which has the specified mode and signedness is to be stored in a register.
111
   This macro is only called when TYPE is a scalar type.
112
 
113
   On most RISC machines, which only have operations that operate on a full
114
   register, define this macro to set M to `word_mode' if M is an integer mode
115
   narrower than `BITS_PER_WORD'.  In most cases, only integer modes should be
116
   widened because wider-precision floating-point operations are usually more
117
   expensive than their narrower counterparts.
118
 
119
   For most machines, the macro definition does not change UNSIGNEDP.  However,
120
   some machines, have instructions that preferentially handle either signed or
121
   unsigned quantities of certain modes.  For example, on the DEC Alpha, 32-bit
122
   loads from memory and 32-bit add instructions sign-extend the result to 64
123
   bits.  On such machines, set UNSIGNEDP according to which kind of extension
124
   is more efficient.
125
 
126
   Do not define this macro if it would never modify MODE.  */
127
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)                       \
128
  do                                                            \
129
    {                                                           \
130
      if (GET_MODE_CLASS (MODE) == MODE_INT                     \
131
          && GET_MODE_SIZE (MODE) < 4)                          \
132
        (MODE) = SImode;                                        \
133
    }                                                           \
134
  while (0)
135
 
136
/* Normal alignment required for function parameters on the stack, in bits.
137
   All stack parameters receive at least this much alignment regardless of data
138
   type.  On most machines, this is the same as the size of an integer.  */
139
#define PARM_BOUNDARY 32
140
 
141
/* Define this macro to the minimum alignment enforced by hardware for
142
   the stack pointer on this machine.  The definition is a C
143
   expression for the desired alignment (measured in bits).  This
144
   value is used as a default if PREFERRED_STACK_BOUNDARY is not
145
   defined.  On most machines, this should be the same as
146
   PARM_BOUNDARY.  */
147
#define STACK_BOUNDARY 32
148
 
149
/* Alignment required for a function entry point, in bits.  */
150
#define FUNCTION_BOUNDARY 32
151
 
152
/* Biggest alignment that any data type can require on this machine,
153
   in bits.  */
154
#define BIGGEST_ALIGNMENT 32
155
 
156
/* If defined, a C expression to compute the alignment for a variable
157
   in the static store.  TYPE is the data type, and ALIGN is the
158
   alignment that the object would ordinarily have.  The value of this
159
   macro is used instead of that alignment to align the object.
160
 
161
   If this macro is not defined, then ALIGN is used.  */
162
#define DATA_ALIGNMENT(TYPE, ALIGN)             \
163
  (TREE_CODE (TYPE) == ARRAY_TYPE               \
164
   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode    \
165
   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
166
 
167
/* If defined, a C expression to compute the alignment given to a constant that
168
   is being placed in memory.  CONSTANT is the constant and ALIGN is the
169
   alignment that the object would ordinarily have.  The value of this macro is
170
   used instead of that alignment to align the object.
171
 
172
   If this macro is not defined, then ALIGN is used.
173
 
174
   The typical use of this macro is to increase alignment for string constants
175
   to be word aligned so that `strcpy' calls that copy constants can be done
176
   inline.  */
177
#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \
178
  (TREE_CODE (EXP) == STRING_CST        \
179
   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
180
 
181
/* Number of bits which any structure or union's size must be a multiple of.
182
   Each structure or union's size is rounded up to a multiple of this.
183
 
184
   If you do not define this macro, the default is the same as `BITS_PER_UNIT'.  */
185
#define STRUCTURE_SIZE_BOUNDARY 32
186
 
187
/* Define this macro to be the value 1 if instructions will fail to work if
188
   given data not on the nominal alignment.  If instructions will merely go
189
   slower in that case, define this macro as 0.  */
190
#define STRICT_ALIGNMENT 1
191
 
192
/* Define this if you wish to imitate the way many other C compilers handle
193
   alignment of bitfields and the structures that contain them.  */
194
#define PCC_BITFIELD_TYPE_MATTERS 1
195
 
196
/* Layout of Source Language Data Types.  */
197
 
198
#define INT_TYPE_SIZE 32
199
 
200
#define SHORT_TYPE_SIZE 16
201
 
202
#define LONG_TYPE_SIZE 32
203
 
204
#define LONG_LONG_TYPE_SIZE 64
205
 
206
#define CHAR_TYPE_SIZE 8
207
 
208
#define FLOAT_TYPE_SIZE 32
209
 
210
#define DOUBLE_TYPE_SIZE 64
211
 
212
#define LONG_DOUBLE_TYPE_SIZE 64
213
 
214
#define DEFAULT_SIGNED_CHAR 1
215
 
216
/* Register Basics.  */
217
 
218
/* General purpose registers.  */
219
#define GPR_FIRST       0               /* First gpr */
220
#define GPR_LAST        15              /* Last possible gpr */
221
 
222
#define GPR_R0          0               /* Always 0 */
223
#define GPR_R7          7               /* Used as a scratch register */
224
#define GPR_R8          8               /* Used as a scratch register */
225
#define GPR_R9          9               /* Used as a scratch register */
226
#define GPR_R10         10              /* Used as a scratch register */
227
#define GPR_R11         11              /* Used as a scratch register */
228
#define GPR_FP          12              /* Frame pointer */
229
#define GPR_SP          13              /* Stack pointer */
230
#define GPR_LINK        14              /* Saved return address as
231
                                           seen  by the caller */
232
#define GPR_INTERRUPT_LINK 15           /* hold return addres for interrupts */
233
 
234
/* Argument register that is eliminated in favor of the frame and/or stack
235
   pointer.  Also add register to point to where the return address is
236
   stored.  */
237
#define SPECIAL_REG_FIRST               (GPR_LAST + 1)
238
#define SPECIAL_REG_LAST                (SPECIAL_REG_FIRST)
239
#define ARG_POINTER_REGNUM              (SPECIAL_REG_FIRST + 0)
240
#define SPECIAL_REG_P(R)                ((R) == SPECIAL_REG_FIRST)
241
 
242
/* The first/last register that can contain the arguments to a function.  */
243
#define FIRST_ARG_REGNUM        1
244
#define LAST_ARG_REGNUM         4
245
 
246
/* The register used to hold functions return value */
247
#define RETVAL_REGNUM           11
248
 
249
#define FIRST_PSEUDO_REGISTER (GPR_FIRST + 17)
250
 
251
#define IS_PSEUDO_P(R)  (REGNO (R) >= FIRST_PSEUDO_REGISTER)
252
 
253
/* R0           always has the value 0
254
   R10          static link
255
   R12  FP      pointer to active frame
256
   R13  SP      pointer to top of stack
257
   R14  RA      return address
258
   R15  IRA     interrupt return address.  */
259
#define FIXED_REGISTERS { 1, 0, 0, 0, 0, 0, 0, 0, \
260
                          0, 0, 0, 0, 1, 1, 1, 1, \
261
                          1                       \
262
                         }
263
 
264
/* Like `FIXED_REGISTERS' but has 1 for each register that is clobbered (in
265
   general) by function calls as well as for fixed registers.  This macro
266
   therefore identifies the registers that are not available for general
267
   allocation of values that must live across function calls.  */
268
#define CALL_USED_REGISTERS     { 1, 1, 1, 1, 1, 0, 0, 1, \
269
                                  1, 1, 1, 1, 1, 1, 1, 1, \
270
                                  1                       \
271
                                }
272
 
273
 
274
/* How Values Fit in Registers.  */
275
 
276
#define HARD_REGNO_NREGS(REGNO, MODE)                           \
277
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
278
 
279
#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
280
 
281
/* A C expression that is nonzero if a value of mode MODE1 is
282
   accessible in mode MODE2 without copying.  */
283
#define MODES_TIEABLE_P(MODE1, MODE2) 1
284
 
285
/* Register Classes.  */
286
 
287
enum reg_class
288
{
289
  NO_REGS,
290
  ALL_REGS,
291
  LIM_REG_CLASSES
292
};
293
 
294
#define   GENERAL_REGS  ALL_REGS
295
 
296
#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
297
 
298
#define REG_CLASS_NAMES {"NO_REGS", "ALL_REGS" }
299
 
300
#define REG_CLASS_CONTENTS \
301
   {                                                                    \
302
     { 0x0, 0x0 },                                                      \
303
     { (((1 << (GPR_LAST + 1)) - 1) & ~(1 << GPR_FIRST)), 0x0 },        \
304
   }
305
 
306
/* A C expression whose value is a register class containing hard register
307
   REGNO.  In general there is more than one such class; choose a class which
308
   is "minimal", meaning that no smaller class also contains the register.  */
309
#define REGNO_REG_CLASS(REGNO) GENERAL_REGS
310
 
311
#define BASE_REG_CLASS GENERAL_REGS
312
 
313
#define INDEX_REG_CLASS NO_REGS
314
 
315
#define REG_CLASS_FROM_LETTER(CHAR) NO_REGS
316
 
317
#define REGNO_OK_FOR_BASE_P(NUM) 1
318
 
319
#define REGNO_OK_FOR_INDEX_P(NUM) 1
320
 
321
/* A C expression that places additional restrictions on the register class to
322
   use when it is necessary to copy value X into a register in class CLASS.
323
   The value is a register class; perhaps CLASS, or perhaps another, smaller
324
   class.  On many machines, the following definition is safe:
325
 
326
        #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
327
*/
328
#define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
329
 
330
#define SECONDARY_RELOAD_CLASS(CLASS,MODE,X) \
331
  mt_secondary_reload_class((CLASS), (MODE), (X))
332
 
333
/* A C expression for the maximum number of consecutive registers of
334
   class CLASS needed to hold a value of mode MODE.  */
335
#define CLASS_MAX_NREGS(CLASS, MODE) \
336
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
337
 
338
/* For MorphoRISC1:
339
 
340
   `I'  is used for the range of constants an arithmetic insn can
341
        actually contain (16 bits signed integers).
342
 
343
   `J'  is used for the range which is just zero (ie, $r0).
344
 
345
   `K'  is used for the range of constants a logical insn can actually
346
        contain (16 bit zero-extended integers).
347
 
348
   `L'  is used for the range of constants that be loaded with lui
349
        (ie, the bottom 16 bits are zero).
350
 
351
   `M'  is used for the range of constants that take two words to load
352
        (ie, not matched by `I', `K', and `L').
353
 
354
   `N'  is used for negative 16 bit constants other than -65536.
355
 
356
   `O'  is a 15 bit signed integer.
357
 
358
   `P'  is used for positive 16 bit constants.  */
359
 
360
#define SMALL_INT(X) ((unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000)
361
#define SMALL_INT_UNSIGNED(X) ((unsigned HOST_WIDE_INT) (INTVAL (X)) < 0x10000)
362
 
363
/* A C expression that defines the machine-dependent operand
364
   constraint letters that specify particular ranges of integer
365
   values.  If C is one of those letters, the expression should check
366
   that VALUE, an integer, is in the appropriate range and return 1 if
367
   so, 0 otherwise.  If C is not one of those letters, the value
368
   should be 0 regardless of VALUE.  */
369
#define CONST_OK_FOR_LETTER_P(VALUE, C)                                 \
370
  ((C) == 'I' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000) \
371
   : (C) == 'J' ? ((VALUE) == 0)                                        \
372
   : (C) == 'K' ? ((unsigned HOST_WIDE_INT) (VALUE) < 0x10000)          \
373
   : (C) == 'L' ? (((VALUE) & 0x0000ffff) == 0                          \
374
                   && (((VALUE) & ~2147483647) == 0                     \
375
                       || ((VALUE) & ~2147483647) == ~2147483647))      \
376
   : (C) == 'M' ? ((((VALUE) & ~0x0000ffff) != 0)                       \
377
                   && (((VALUE) & ~0x0000ffff) != ~0x0000ffff)          \
378
                   && (((VALUE) & 0x0000ffff) != 0                      \
379
                       || (((VALUE) & ~2147483647) != 0                 \
380
                           && ((VALUE) & ~2147483647) != ~2147483647))) \
381
   : (C) == 'N' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0xffff) < 0xffff) \
382
   : (C) == 'O' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x4000) < 0x8000) \
383
   : (C) == 'P' ? ((VALUE) != 0 && (((VALUE) & ~0x0000ffff) == 0))      \
384
   : 0)
385
 
386
/* A C expression that defines the machine-dependent operand constraint letters
387
   (`G', `H') that specify particular ranges of `const_double' values.  */
388
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
389
 
390
/* Most negative value represent on mt */
391
#define MT_MIN_INT 0x80000000
392
 
393
/* Basic Stack Layout.  */
394
 
395
enum save_direction
396
{
397
  FROM_PROCESSOR_TO_MEM,
398
  FROM_MEM_TO_PROCESSOR
399
};
400
 
401
/* Tell prologue and epilogue if register REGNO should be saved / restored.
402
   The return address and frame pointer are treated separately.
403
   Don't consider them here.  */
404
#define MUST_SAVE_REGISTER(regno)                               \
405
  (   (regno) != GPR_LINK                                       \
406
   && (regno) != GPR_FP                                         \
407
   && (regno) != GPR_SP                                         \
408
   && (regno) != GPR_R0                                         \
409
   &&   (( regs_ever_live [regno] && ! call_used_regs [regno] ) \
410
       /* Save ira register in an interrupt handler.  */        \
411
        || (interrupt_handler && (regno) == GPR_INTERRUPT_LINK) \
412
       /* Save any register used in an interrupt handler.  */   \
413
        || (interrupt_handler && regs_ever_live [regno])        \
414
       /* Save call clobbered registers in non-leaf interrupt   \
415
          handlers.  */                                         \
416
        || (interrupt_handler && call_used_regs[regno]          \
417
           && !current_function_is_leaf)                        \
418
        ||(current_function_calls_eh_return                     \
419
           && (regno == GPR_R7 || regno == GPR_R8))             \
420
        )                                                       \
421
  )
422
 
423
#define STACK_GROWS_DOWNWARD 1
424
 
425
/* Offset from the frame pointer to the first local variable slot to be
426
   allocated.
427
 
428
   If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
429
   subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
430
   Otherwise, it is found by adding the length of the first slot to
431
   the value `STARTING_FRAME_OFFSET'.  */
432
#define STARTING_FRAME_OFFSET current_function_outgoing_args_size
433
 
434
/* Offset from the argument pointer register to the first argument's address.
435
   On some machines it may depend on the data type of the function.
436
 
437
   If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first
438
   argument's address.  */
439
#define FIRST_PARM_OFFSET(FUNDECL) 0
440
 
441
#define RETURN_ADDR_RTX(COUNT, FRAMEADDR)                               \
442
    mt_return_addr_rtx (COUNT)
443
 
444
/* A C expression whose value is RTL representing the location of the incoming
445
   return address at the beginning of any function, before the prologue.  This
446
   RTL is either a `REG', indicating that the return value is saved in `REG',
447
   or a `MEM' representing a location in the stack.
448
 
449
   You only need to define this macro if you want to support call frame
450
   debugging information like that provided by DWARF 2.  */
451
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, GPR_LINK)
452
 
453
/* A C expression whose value is an integer giving the offset, in bytes, from
454
   the value of the stack pointer register to the top of the stack frame at the
455
   beginning of any function, before the prologue.  The top of the frame is
456
   defined to be the value of the stack pointer in the previous frame, just
457
   before the call instruction.
458
 
459
   You only need to define this macro if you want to support call frame
460
   debugging information like that provided by DWARF 2.  */
461
#define INCOMING_FRAME_SP_OFFSET 0
462
 
463
#define STACK_POINTER_REGNUM GPR_SP
464
 
465
#define FRAME_POINTER_REGNUM GPR_FP
466
 
467
/* The register number of the arg pointer register, which is used to
468
   access the function's argument list.  */
469
#define ARG_POINTER_REGNUM              (SPECIAL_REG_FIRST + 0)
470
 
471
/* Register numbers used for passing a function's static chain pointer.  */
472
#define STATIC_CHAIN_REGNUM 10
473
 
474
/* A C expression which is nonzero if a function must have and use a frame
475
   pointer.  */
476
#define FRAME_POINTER_REQUIRED 0
477
 
478
/* Structure to be filled in by compute_frame_size with register
479
   save masks, and offsets for the current function.  */
480
 
481
struct mt_frame_info
482
{
483
  unsigned int total_size;      /* # Bytes that the entire frame takes up.  */
484
  unsigned int pretend_size;    /* # Bytes we push and pretend caller did.  */
485
  unsigned int args_size;       /* # Bytes that outgoing arguments take up.  */
486
  unsigned int extra_size;
487
  unsigned int reg_size;        /* # Bytes needed to store regs.  */
488
  unsigned int var_size;        /* # Bytes that variables take up.  */
489
  unsigned int frame_size;      /* # Bytes in current frame.  */
490
  unsigned int reg_mask;        /* Mask of saved registers.  */
491
  unsigned int save_fp;         /* Nonzero if frame pointer must be saved.  */
492
  unsigned int save_lr;         /* Nonzero if return pointer must be saved.  */
493
  int          initialized;     /* Nonzero if frame size already calculated.  */
494
};
495
 
496
extern struct mt_frame_info current_frame_info;
497
 
498
/* If defined, this macro specifies a table of register pairs used to eliminate
499
   unneeded registers that point into the stack frame.  */
500
#define ELIMINABLE_REGS                                                 \
501
{                                                                       \
502
  {ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM},                         \
503
  {ARG_POINTER_REGNUM,   FRAME_POINTER_REGNUM},                         \
504
  {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}                          \
505
}
506
 
507
/* A C expression that returns non-zero if the compiler is allowed to try to
508
   replace register number FROM with register number TO.  */
509
#define CAN_ELIMINATE(FROM, TO)                                         \
510
 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM          \
511
  ? ! frame_pointer_needed                                              \
512
  : 1)
513
 
514
/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'.  It
515
   specifies the initial difference between the specified pair of
516
   registers.  This macro must be defined if `ELIMINABLE_REGS' is
517
   defined.  */
518
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
519
  (OFFSET) = mt_initial_elimination_offset (FROM, TO)
520
 
521
/* If defined, the maximum amount of space required for outgoing
522
   arguments will be computed and placed into the variable
523
   `current_function_outgoing_args_size'.  */
524
#define ACCUMULATE_OUTGOING_ARGS 1
525
 
526
/* Define this if it is the responsibility of the caller to
527
   allocate the area reserved for arguments passed in registers.  */
528
#define OUTGOING_REG_PARM_STACK_SPACE
529
 
530
/* The number of register assigned to holding function arguments.  */
531
#define MT_NUM_ARG_REGS        4
532
 
533
/* Define this if it is the responsibility of the caller to allocate
534
   the area reserved for arguments passed in registers.  */
535
#define REG_PARM_STACK_SPACE(FNDECL) (MT_NUM_ARG_REGS * UNITS_PER_WORD)
536
 
537
/* Define this macro if `REG_PARM_STACK_SPACE' is defined, but the stack
538
   parameters don't skip the area specified by it.  */
539
#define STACK_PARMS_IN_REG_PARM_AREA
540
 
541
/* A C expression that should indicate the number of bytes of its own
542
   arguments that a function pops on returning, or 0 if the function
543
   pops no arguments and the caller must therefore pop them all after
544
   the function returns.  */
545
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
546
 
547
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
548
   mt_function_arg (& (CUM), (MODE), (TYPE), (NAMED), FALSE)
549
 
550
#define CUMULATIVE_ARGS int
551
 
552
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
553
    mt_init_cumulative_args (& (CUM), FNTYPE, LIBNAME, FNDECL, FALSE)
554
 
555
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                    \
556
    mt_function_arg_advance (&CUM, MODE, TYPE, NAMED)
557
 
558
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE)                               \
559
    mt_function_arg_boundary (MODE, TYPE)
560
 
561
#define FUNCTION_ARG_REGNO_P(REGNO)                                     \
562
  ((REGNO) >= FIRST_ARG_REGNUM && ((REGNO) <= LAST_ARG_REGNUM))
563
 
564
#define RETURN_VALUE_REGNUM     RETVAL_REGNUM
565
 
566
#define FUNCTION_VALUE(VALTYPE, FUNC) \
567
   mt_function_value (VALTYPE, TYPE_MODE(VALTYPE), FUNC)
568
 
569
#define LIBCALL_VALUE(MODE) \
570
   mt_function_value (NULL_TREE, MODE, NULL_TREE)
571
 
572
#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
573
 
574
/* A C expression which can inhibit the returning of certain function
575
   values in registers, based on the type of value.  */
576
#define RETURN_IN_MEMORY(TYPE) (int_size_in_bytes (TYPE) > UNITS_PER_WORD)
577
 
578
/* Define this macro to be 1 if all structure and union return values must be
579
   in memory.  */
580
#define DEFAULT_PCC_STRUCT_RETURN 0
581
 
582
/* Define this macro as a C expression that is nonzero if the return
583
   instruction or the function epilogue ignores the value of the stack
584
   pointer; in other words, if it is safe to delete an instruction to
585
   adjust the stack pointer before a return from the function.  */
586
#define EXIT_IGNORE_STACK 1
587
 
588
#define EPILOGUE_USES(REGNO) mt_epilogue_uses(REGNO)
589
 
590
/* Define this macro if the function epilogue contains delay slots to which
591
   instructions from the rest of the function can be "moved".  */
592
#define DELAY_SLOTS_FOR_EPILOGUE 1
593
 
594
/* A C expression that returns 1 if INSN can be placed in delay slot number N
595
   of the epilogue.  */
596
#define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN, N) 0
597
 
598
#define FUNCTION_PROFILER(FILE, LABELNO) gcc_unreachable ()
599
 
600
/* Trampolines are not implemented.  */
601
#define TRAMPOLINE_SIZE 0
602
 
603
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN)
604
 
605
/* ?? What is this -- aldyh ?? */
606
#define UCMPSI3_LIBCALL         "__ucmpsi3"
607
 
608
/* Addressing Modes.  */
609
 
610
/* A C expression that is 1 if the RTX X is a constant which is a valid
611
   address.  */
612
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
613
 
614
/* A number, the maximum number of registers that can appear in a valid memory
615
   address.  Note that it is up to you to specify a value equal to the maximum
616
   number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept.  */
617
#define MAX_REGS_PER_ADDRESS 1
618
 
619
#ifdef REG_OK_STRICT
620
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
621
{                                               \
622
  if (mt_legitimate_address_p (MODE, X, 1))     \
623
    goto ADDR;                                  \
624
}
625
#else
626
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
627
{                                               \
628
  if (mt_legitimate_address_p (MODE, X, 0))     \
629
    goto ADDR;                                  \
630
}
631
#endif
632
 
633
#ifdef REG_OK_STRICT
634
#define REG_OK_FOR_BASE_P(X) mt_reg_ok_for_base_p (X, 1)
635
#else
636
#define REG_OK_FOR_BASE_P(X) mt_reg_ok_for_base_p (X, 0)
637
#endif
638
 
639
#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
640
 
641
#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) {}
642
 
643
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
644
 
645
#define LEGITIMATE_CONSTANT_P(X) 1
646
 
647
/* A C expression for the cost of moving data of mode M between a register and
648
   memory.  A value of 2 is the default; this cost is relative to those in
649
   `REGISTER_MOVE_COST'.
650
 
651
   If moving between registers and memory is more expensive than between two
652
   registers, you should define this macro to express the relative cost.  */
653
#define MEMORY_MOVE_COST(M,C,I) 10
654
 
655
/* Define this macro as a C expression which is nonzero if accessing less than
656
   a word of memory (i.e. a `char' or a `short') is no faster than accessing a
657
   word of memory.  */
658
#define SLOW_BYTE_ACCESS 1
659
 
660
#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1
661
 
662
#define TEXT_SECTION_ASM_OP ".text"
663
 
664
#define DATA_SECTION_ASM_OP ".data"
665
 
666
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
667
 
668
/* A C string constant for text to be output before each `asm' statement or
669
   group of consecutive ones.  Normally this is `"#APP"', which is a comment
670
   that has no effect on most assemblers but tells the GNU assembler that it
671
   must check the lines that follow for all valid assembler constructs.  */
672
#define ASM_APP_ON "#APP\n"
673
 
674
/* A C string constant for text to be output after each `asm' statement or
675
   group of consecutive ones.  Normally this is `"#NO_APP"', which tells the
676
   GNU assembler to resume making the time-saving assumptions that are valid
677
   for ordinary compiler output.  */
678
#define ASM_APP_OFF "#NO_APP\n"
679
 
680
/* This is how to output an assembler line defining a `char' constant.  */
681
#define ASM_OUTPUT_CHAR(FILE, VALUE)                    \
682
  do                                                    \
683
    {                                                   \
684
      fprintf (FILE, "\t.byte\t");                      \
685
      output_addr_const (FILE, (VALUE));                \
686
      fprintf (FILE, "\n");                             \
687
    }                                                   \
688
  while (0)
689
 
690
/* This is how to output an assembler line defining a `short' constant.  */
691
#define ASM_OUTPUT_SHORT(FILE, VALUE)                   \
692
  do                                                    \
693
    {                                                   \
694
      fprintf (FILE, "\t.hword\t");                     \
695
      output_addr_const (FILE, (VALUE));                \
696
      fprintf (FILE, "\n");                             \
697
    }                                                   \
698
  while (0)
699
 
700
/* This is how to output an assembler line defining an `int' constant.
701
   We also handle symbol output here.  */
702
#define ASM_OUTPUT_INT(FILE, VALUE)                     \
703
  do                                                    \
704
    {                                                   \
705
      fprintf (FILE, "\t.word\t");                      \
706
      output_addr_const (FILE, (VALUE));                \
707
      fprintf (FILE, "\n");                             \
708
    }                                                   \
709
  while (0)
710
 
711
/* A C statement to output to the stdio stream STREAM an assembler instruction
712
   to assemble a single byte containing the number VALUE.
713
 
714
   This declaration must be present.  */
715
#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
716
  fprintf (STREAM, "\t%s\t0x%x\n", ASM_BYTE_OP, (VALUE))
717
 
718
/* Globalizing directive for a label.  */
719
#define GLOBAL_ASM_OP "\t.globl "
720
 
721
#define REGISTER_NAMES                                                  \
722
{ "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",                       \
723
  "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15",                 \
724
  "ap" }
725
 
726
/* If defined, a C initializer for an array of structures containing a name and
727
   a register number.  This macro defines additional names for hard registers,
728
   thus allowing the `asm' option in declarations to refer to registers using
729
   alternate names.  */
730
#define ADDITIONAL_REGISTER_NAMES \
731
{ { "FP", 12}, {"SP", 13}, {"RA", 14}, {"IRA", 15} }
732
 
733
/* Define this macro if you are using an unusual assembler that requires
734
   different names for the machine instructions.
735
 
736
   The definition is a C statement or statements which output an assembler
737
   instruction opcode to the stdio stream STREAM.  The macro-operand PTR is a
738
   variable of type `char *' which points to the opcode name in its "internal"
739
   form--the form that is written in the machine description.  The definition
740
   should output the opcode name to STREAM, performing any translation you
741
   desire, and increment the variable PTR to point at the end of the opcode so
742
   that it will not be output twice.  */
743
#define ASM_OUTPUT_OPCODE(STREAM, PTR) \
744
   (PTR) = mt_asm_output_opcode (STREAM, PTR)
745
 
746
#define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
747
  mt_final_prescan_insn (INSN, OPVEC, NOPERANDS)
748
 
749
#define PRINT_OPERAND(STREAM, X, CODE) mt_print_operand (STREAM, X, CODE)
750
 
751
/* A C expression which evaluates to true if CODE is a valid punctuation
752
   character for use in the `PRINT_OPERAND' macro.  */
753
/* #:  Print nop for delay slot.  */
754
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '#')
755
 
756
#define PRINT_OPERAND_ADDRESS(STREAM, X) mt_print_operand_address (STREAM, X)
757
 
758
/* If defined, C string expressions to be used for the `%R', `%L', `%U', and
759
   `%I' options of `asm_fprintf' (see `final.c').  These are useful when a
760
   single `md' file must support multiple assembler formats.  In that case, the
761
   various `tm.h' files can define these macros differently.
762
 
763
   USER_LABEL_PREFIX is defined in svr4.h.  */
764
#define REGISTER_PREFIX     "%"
765
#define LOCAL_LABEL_PREFIX  "."
766
#define USER_LABEL_PREFIX   ""
767
#define IMMEDIATE_PREFIX    ""
768
 
769
/* This macro should be provided on machines where the addresses in a dispatch
770
   table are relative to the table's own address.
771
 
772
   The definition should be a C statement to output to the stdio stream STREAM
773
   an assembler pseudo-instruction to generate a difference between two labels.
774
   VALUE and REL are the numbers of two internal labels.  The definitions of
775
   these labels are output using `targetm.asm_out.internal_label', and they
776
   must be printed in the same way here.  */
777
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
778
fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
779
 
780
/* This macro should be provided on machines where the addresses in a dispatch
781
   table are absolute.
782
 
783
   The definition should be a C statement to output to the stdio stream STREAM
784
   an assembler pseudo-instruction to generate a reference to a label.  VALUE
785
   is the number of an internal label whose definition is output using
786
   `targetm.asm_out.internal_label'.  */
787
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
788
fprintf (STREAM, "\t.word .L%d\n", VALUE)
789
 
790
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (GPR_LINK)
791
 
792
#define EH_RETURN_DATA_REGNO(N) \
793
  ((N) == 0 ? GPR_R7 : (N) == 1 ? GPR_R8 : INVALID_REGNUM)
794
 
795
#define EH_RETURN_STACKADJ_REGNO        GPR_R11
796
#define EH_RETURN_STACKADJ_RTX          \
797
        gen_rtx_REG (SImode, EH_RETURN_STACKADJ_REGNO)
798
#define EH_RETURN_HANDLER_REGNO         GPR_R10
799
#define EH_RETURN_HANDLER_RTX           \
800
        gen_rtx_REG (SImode, EH_RETURN_HANDLER_REGNO)
801
 
802
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
803
  fprintf ((STREAM), "\t.p2align %d\n", (POWER))
804
 
805
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
806
 
807
#ifndef DWARF2_DEBUGGING_INFO
808
#define DWARF2_DEBUGGING_INFO
809
#endif
810
 
811
/* Define this macro if GCC should produce dwarf version 2-style
812
   line numbers.  This usually requires extending the assembler to
813
   support them, and #defining DWARF2_LINE_MIN_INSN_LENGTH in the
814
   assembler configuration header files.  */
815
#define DWARF2_ASM_LINE_DEBUG_INFO 1
816
 
817
/* An alias for a machine mode name.  This is the machine mode that
818
   elements of a jump-table should have.  */
819
#define CASE_VECTOR_MODE SImode
820
 
821
/* Define this macro if operations between registers with integral
822
   mode smaller than a word are always performed on the entire
823
   register.  Most RISC machines have this property and most CISC
824
   machines do not.  */
825
#define WORD_REGISTER_OPERATIONS
826
 
827
/* The maximum number of bytes that a single instruction can move quickly from
828
   memory to memory.  */
829
#define MOVE_MAX 4
830
 
831
/* A C expression which is nonzero if on this machine it is safe to "convert"
832
   an integer of INPREC bits to one of OUTPREC bits (where OUTPREC is smaller
833
   than INPREC) by merely operating on it as if it had only OUTPREC bits.
834
 
835
   On many machines, this expression can be 1.
836
 
837
   When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes for
838
   which `MODES_TIEABLE_P' is 0, suboptimal code can result.  If this is the
839
   case, making `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve
840
   things.  */
841
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
842
 
843
#define Pmode SImode
844
 
845
/* An alias for the machine mode used for memory references to functions being
846
   called, in `call' RTL expressions.  On most machines this should be
847
   `QImode'.  */
848
#define FUNCTION_MODE QImode
849
 
850
#define HANDLE_SYSV_PRAGMA 1
851
 
852
/* Indicate how many instructions can be issued at the same time.  */
853
#define ISSUE_RATE 1
854
 
855
/* Define the information needed to generate branch and scc insns.  This is
856
   stored from the compare operation.  Note that we can't use "rtx" here
857
   since it hasn't been defined!  */
858
 
859
extern struct rtx_def * mt_compare_op0;
860
extern struct rtx_def * mt_compare_op1;
861
 

powered by: WebSVN 2.1.0

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