]> gcc.gnu.org Git - gcc.git/blob - gcc/config/1750a/1750a.h
rtl.h (addr_diff_vec_flags): New typedef.
[gcc.git] / gcc / config / 1750a / 1750a.h
1 /* Definitions of target machine for GNU compiler.
2 Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
3 Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de)
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 1, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22
23 /* Names to predefine in the preprocessor for this target machine. */
24
25 /* See tm-sun3.h, tm-sun2.h, tm-isi68.h for different CPP_PREDEFINES. */
26 #define CPP_PREDEFINES ""
27
28 /* Print subsidiary information on the compiler version in use. */
29 #ifdef IEEE
30 #define TARGET_VERSION fprintf (stderr, " (1750A, IEEE syntax)");
31 #else
32 #define TARGET_VERSION fprintf (stderr, " (MIL-STD-1750A)");
33 #endif
34
35 /* Run-time compilation parameters selecting different hardware subsets. */
36
37 #define TARGET_SWITCHES \
38 { {"vaxc-alignment", 2}, \
39 { "", TARGET_DEFAULT}}
40
41 /* Default target_flags if no switches specified. */
42
43 #ifndef TARGET_DEFAULT
44 #define TARGET_DEFAULT 1
45 #endif
46
47 /*****************************************************************************/
48
49 /* SPECIAL ADDITION FOR MIL-STD-1750A by O.M.Kellogg, 15-Apr-1993 */
50 /* See file aux-output.c for the actual data instances. */
51 struct datalabel_array {
52 char *name;
53 char value[14];
54 int size;
55 };
56 struct jumplabel_array {
57 int pc;
58 int num;
59 };
60 enum section { Init, Normal, Konst, Static };
61 #define DATALBL_ARRSIZ 256
62 #define JMPLBL_ARRSIZ 256
63 #ifndef __datalbl
64 extern struct datalabel_array datalbl[];
65 extern struct jumplabel_array jmplbl[];
66 extern int datalbl_ndx, jmplbl_ndx, label_pending, program_counter;
67 extern enum section current_section;
68 extern char *sectname[4];
69 extern char *xstrdup(), *float_label();
70 extern struct rtx_def *function_arg ();
71 extern char *movcnt_regno_adjust ();
72 extern char *mod_regno_adjust ();
73 extern char *branch_or_jump ();
74 #endif
75 /*--------------------------------------------------------------------*/
76
77 /* target machine storage layout */
78
79 /* Define this if most significant bit is lowest numbered
80 in instructions that operate on numbered bit-fields.
81 Though 1750 actually counts bits in big-endian fashion, the sign bit
82 is still the most significant bit, which is leftmost. Therefore leaving
83 this little-endian. Adjust short before assembler output when needed:
84 e.g. in QImode, a GCC bit n is a 1750 bit (15-n). */
85 #define BITS_BIG_ENDIAN 0
86
87 /* Define this if most significant byte of a word is the lowest numbered. */
88 /* For 1750 we can decide arbitrarily
89 since there are no machine instructions for them. */
90 #define BYTES_BIG_ENDIAN 0
91
92 /* Define this if most significant word of a multiword value is lowest
93 numbered.
94 True for 1750. */
95 #define WORDS_BIG_ENDIAN 1
96
97 /* number of bits in an addressable storage unit */
98 #define BITS_PER_UNIT 16
99
100 /* Width in bits of a "word", which is the contents of a machine register.
101 Note that this is not necessarily the width of data type `int';
102 if using 16-bit ints on a 68000, this would still be 32.
103 But on a machine with 16-bit registers, this would be 16. */
104 #define BITS_PER_WORD 16
105
106 /* Width of a word, in units (bytes). */
107 #define UNITS_PER_WORD 1
108
109 /* Width in bits of a pointer.
110 See also the macro `Pmode' defined below. */
111 #define POINTER_SIZE 16
112
113 #define PTRDIFF_TYPE "int"
114
115 /* Type to use for `size_t'. If undefined, uses `long unsigned int'. */
116 #define SIZE_TYPE "int"
117
118 /* 1750a preliminary
119 #define TARGET_FLOAT_FORMAT UNKNOWN_FLOAT_FORMAT
120 */
121
122 /* Allocation boundary (in *bits*) for storing pointers in memory. */
123 #define POINTER_BOUNDARY 16
124
125 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
126 /* 1750: should have had to make this 32 when BITS_PER_WORD is 32. */
127 #define PARM_BOUNDARY 16
128
129 /* Boundary (in *bits*) on which stack pointer should be aligned. */
130 #define STACK_BOUNDARY 16
131
132 /* Allocation boundary (in *bits*) for the code of a function. */
133 #define FUNCTION_BOUNDARY 16
134
135 /* Alignment of field after `int : 0' in a structure. */
136 #define EMPTY_FIELD_BOUNDARY 16
137
138 /* No data type wants to be aligned rounder than this. */
139 #define BIGGEST_ALIGNMENT 16
140
141 /* Define this to 1 if move instructions will actually fail to work
142 when given unaligned data. */
143 #define STRICT_ALIGNMENT 0
144
145 /* Define number of bits in most basic integer type.
146 (If undefined, default is BITS_PER_WORD).
147 #define INT_TYPE_SIZE 16 */
148
149 /* Define number of bits in short integer type.
150 (If undefined, default is half of BITS_PER_WORD). */
151 #define SHORT_TYPE_SIZE 16
152
153 /* Define number of bits in long integer type.
154 (If undefined, default is BITS_PER_WORD). */
155 #define LONG_TYPE_SIZE 32
156
157 /* Define number of bits in long long integer type.
158 (If undefined, default is twice BITS_PER_WORD). */
159 /* 1750 PRELIMINARY : no processor support for `long long', therefore
160 need to check out the long-long opencodings ! */
161 #define LONG_LONG_TYPE_SIZE 64
162
163 /* Define number of bits in char type.
164 (If undefined, default is one fourth of BITS_PER_WORD). */
165 #define CHAR_TYPE_SIZE 16
166
167 /* Define number of bits in float type.
168 (If undefined, default is BITS_PER_WORD). */
169 #define FLOAT_TYPE_SIZE 32
170
171 /* Define number of bits in double type.
172 (If undefined, default is twice BITS_PER_WORD). */
173 #define DOUBLE_TYPE_SIZE 48
174
175 /*****************************************************************************/
176
177 /* Standard register usage. */
178
179 /* Number of actual hardware registers.
180 The hardware registers are assigned numbers for the compiler
181 from 0 to just below FIRST_PSEUDO_REGISTER.
182 All registers that the compiler knows about must be given numbers,
183 even those that are not normally considered general registers. */
184 #define FIRST_PSEUDO_REGISTER 16
185
186 /* 1 for registers that have pervasive standard uses
187 and are not available for the register allocator.
188 R15 is the 1750A stack pointer. R14 is the frame pointer. */
189
190 #define FIXED_REGISTERS \
191 { 0, 0, 0, 0, 0, 0, 0, 0, \
192 0, 0, 0, 0, 0, 0, 1, 1 }
193
194 /* 1 for registers not available across function calls.
195 These must include the FIXED_REGISTERS and also any
196 registers that can be used without being saved.
197 The latter must include the registers where values are returned
198 and the register where structure-value addresses are passed.
199 Aside from that, you can include as many other registers as you like.
200 1750: return value in R0 foll. (depending on size of retval).
201 Should be possible to refine this (how many regs are actually used) */
202
203 #define CALL_USED_REGISTERS \
204 { 1, 1, 1, 1, 1, 1, 1, 1, \
205 1, 1, 1, 1, 1, 1, 1, 1 }
206
207 /* Order in which to allocate registers. Each register must be
208 listed once, even those in FIXED_REGISTERS. List frame pointer
209 late and fixed registers last. Note that, in general, we prefer
210 registers listed in CALL_USED_REGISTERS, keeping the others
211 available for storage of persistent values. */
212
213 /* #define REG_ALLOC_ORDER \
214 { 2, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
215 */
216
217 /* Return number of consecutive hard regs needed starting at reg REGNO
218 to hold something of mode MODE.
219 This is ordinarily the length in words of a value of mode MODE
220 but can be less for certain modes in special long registers.
221 All 1750 registers are one word long. */
222 #define HARD_REGNO_NREGS(REGNO, MODE) \
223 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
224
225 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
226 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
227
228 /* Value is 1 if it is a good idea to tie two pseudo registers
229 when one has mode MODE1 and one has mode MODE2.
230 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
231 for any hard reg, then this must be 0 for correct output. */
232 #define MODES_TIEABLE_P(MODE1, MODE2) 1
233
234 /* Specify the registers used for certain standard purposes.
235 The values of these macros are register numbers. */
236
237 /* 1750A pc isn't overloaded on a register. */
238 /* #define PC_REGNUM */
239
240 /* Register to use for pushing function arguments. */
241 #define STACK_POINTER_REGNUM 15
242
243 /* Base register for access to local variables of the function. */
244 #define FRAME_POINTER_REGNUM 14
245
246 /* Value should be nonzero if functions must have frame pointers.
247 Zero means the frame pointer need not be set up (and parms
248 may be accessed via the stack pointer) in functions that seem suitable.
249 This is computed in `reload', in reload1.c. */
250 #define FRAME_POINTER_REQUIRED 0
251
252 /* Base register for access to arguments of the function. */
253 #define ARG_POINTER_REGNUM 14
254
255 /* Define this if successive args to a function occupy decreasing addresses
256 on the stack.
257 #define ARGS_GROW_DOWNWARD
258 */
259
260 /* Register in which static-chain is passed to a function. */
261 #define STATIC_CHAIN_REGNUM 13
262
263 /* Place in which caller passes the structure value address.
264 0 means push the value on the stack like an argument.
265 #define STRUCT_VALUE 0
266 */
267
268 /* Register in which address to store a structure value
269 arrives in the function.
270 #define STRUCT_VALUE_INCOMING 0
271 */
272
273 /* Register in which address to store a structure value
274 is passed to a function. */
275 #define STRUCT_VALUE_REGNUM 12
276
277 /* Define this to be 1 if all structure return values must be in memory. */
278 #define DEFAULT_PCC_STRUCT_RETURN 0
279
280 /*****************************************************************************/
281
282 /* Define the classes of registers for register constraints in the
283 machine description. Also define ranges of constants.
284
285 One of the classes must always be named ALL_REGS and include all hard regs.
286 If there is more than one class, another class must be named NO_REGS
287 and contain no registers.
288
289 The name GENERAL_REGS must be the name of a class (or an alias for
290 another name such as ALL_REGS). This is the class of registers
291 that is allowed by "g" or "r" in a register constraint.
292 Also, registers outside this class are allocated only when
293 instructions express preferences for them.
294
295 The classes must be numbered in nondecreasing order; that is,
296 a larger-numbered class must never be contained completely
297 in a smaller-numbered class.
298
299 For any two classes, it is very desirable that there be another
300 class that represents their union. */
301
302 /* 1750 note: The names (BASE_REGS/INDEX_REGS) are used in their *gcc sense*
303 (i.e. *opposite* to the MIL-STD-1750A defined meanings). This means that
304 R1..R15 are called "base" regs and R12..R15 are "index" regs.
305 Index reg mode (in the gcc sense) is not yet implemented (these are the
306 1750 "Base with Index Reg" instructions, LBX etc. See 1750.md)
307
308 Here's an example to drive this point home: in "LBX B12,R5"
309 B12 shall be called the "index" reg and R5 shall be the "base" reg.
310 This naming inversion is due to the GCC defined capabilities of
311 "Base" vs. "Index" regs. */
312
313 enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
314
315 #define N_REG_CLASSES (int) LIM_REG_CLASSES
316
317 /* Since GENERAL_REGS is the same class as ALL_REGS,
318 don't give it a different class number; just make it an alias. */
319 #define GENERAL_REGS ALL_REGS
320
321 /* Give names of register classes as strings for dump file. */
322
323 #define REG_CLASS_NAMES \
324 { "NO_REGS", "R2", "R0_1", "INDEX_REGS", "BASE_REGS", "ALL_REGS" }
325
326 /* Define which registers fit in which classes.
327 This is an initializer for a vector of HARD_REG_SET
328 of length N_REG_CLASSES.
329 1750 "index" (remember, in the *GCC* sense!) regs are R12 through R15.
330 The only 1750 register not usable as BASE_REG is R0. */
331
332 #define REG_CLASS_CONTENTS {0, 0x0004, 0x0003, 0xf000, 0xfffe, 0xffff}
333
334 /* The same information, inverted:
335 Return the class number of the smallest class containing
336 reg number REGNO. This could be a conditional expression
337 or could index an array. */
338 #define REGNO_REG_CLASS(REGNO) ((REGNO) == 2 ? R2 : (REGNO) == 0 ? R0_1 : \
339 (REGNO) >= 12 ? INDEX_REGS : (REGNO) > 0 ? BASE_REGS : ALL_REGS)
340
341 /* The class value for index registers, and the one for base regs. */
342
343 #define BASE_REG_CLASS BASE_REGS
344 #define INDEX_REG_CLASS INDEX_REGS
345
346 /* Get reg_class from a letter such as appears in the machine description.
347 For the 1750, we have 'z' for R0_1, 't' for R2, 'b' for gcc Base regs
348 and 'x' for gcc Index regs. */
349
350 #define REG_CLASS_FROM_LETTER(C) ((C) == 't' ? R2 : \
351 (C) == 'z' ? R0_1 : \
352 (C) == 'b' ? BASE_REGS : \
353 (C) == 'x' ? INDEX_REGS : NO_REGS)
354
355 /* The letters I,J,K,.. to P in a register constraint string
356 can be used to stand for particular ranges of immediate operands.
357 This macro defines what the ranges are.
358 C is the letter, and VALUE is a constant value.
359 Return 1 if VALUE is in the range specified by C.
360
361 For the 1750A,
362 `I' is used for ISP mode instructions,
363 `J' is used for ISN mode instructions,
364 `K' is used for the STC instruction's constant range,
365 `L' is used for unsigned 8-bit address displacements in instructions
366 of addressing mode "Base Relative",
367 `M' is for IM mode instructions et al.,
368 `O' is a synonym for (const_int 0). */
369
370 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
371 ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 16 : \
372 (C) == 'J' ? (VALUE) < 0 && (VALUE) >= -16 : \
373 (C) == 'K' ? (VALUE) >= 0 && (VALUE) <= 15 : \
374 (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 0xFF : \
375 (C) == 'M' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF : \
376 (C) == 'O' ? (VALUE) == 0 : 0)
377
378 /* Similar, but for floating constants, and defining letter 'G'.
379 Here VALUE is the CONST_DOUBLE rtx itself. */
380 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
381 ((C) == 'G' ? ((VALUE) == CONST0_RTX (HFmode) \
382 || (VALUE) == CONST0_RTX (TQFmode)) : 0)
383
384 /* Optional extra constraints for this machine.
385
386 For the 1750, `Q' means that this is a memory operand consisting
387 of the sum of an Index Register (in the GCC sense, i.e. R12..R15)
388 and a constant in the range 0..255. This constraint is used for
389 the Base Register with Offset address mode instructions (LB,STB,AB,..) */
390
391 #define EXTRA_CONSTRAINT(OP, C) \
392 ((C) == 'Q' && b_mode_operand (OP))
393
394 /* Given an rtx X being reloaded into a reg required to be
395 in class CLASS, return the class of reg to actually use.
396 In general this is just CLASS; but on some machines
397 in some cases it is preferable to use a more restrictive class. */
398
399 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
400
401 /* Return the maximum number of consecutive registers
402 needed to represent mode MODE in a register of class CLASS.
403 On the 1750A, this is the size of MODE in words,
404 since class doesn't make any difference. */
405 #define CLASS_MAX_NREGS(CLASS,MODE) GET_MODE_SIZE(MODE)
406
407 /*****************************************************************************/
408
409 /* Stack layout; function entry, exit and calling. */
410
411 /* Define this if pushing a word on the stack
412 makes the stack pointer a smaller address. */
413 #define STACK_GROWS_DOWNWARD 1
414
415 /* Define this if the nominal address of the stack frame
416 is at the high-address end of the local variables;
417 goes at a more negative offset in the frame.
418 #define FRAME_GROWS_DOWNWARD
419 */
420
421 /* Offset within stack frame to start allocating local variables at.
422 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
423 first local allocated. Otherwise, it is the offset to the BEGINNING
424 of the first local allocated.
425 */
426 #define STARTING_FRAME_OFFSET 1
427
428 /* This is the default anyway:
429 #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) FRAMEADDR
430 */
431
432 /* If we generate an insn to push BYTES bytes,
433 this says how many the stack pointer really advances by.
434 1750 note: what GCC calls a "byte" is really a 16-bit word,
435 because BITS_PER_UNIT is 16. */
436
437 #define PUSH_ROUNDING(BYTES) (BYTES)
438
439 /* Define this macro if functions should assume that stack space has
440 been allocated for arguments even when their values are passed in
441 registers.
442 Size, in bytes, of the area reserved for arguments passed in
443 registers for the function represented by FNDECL.
444 #define REG_PARM_STACK_SPACE(FNDECL) 14 */
445
446 /* Define this if it is the responsibility of the caller to allocate
447 the area reserved for arguments passed in registers.
448 #define OUTGOING_REG_PARM_STACK_SPACE */
449
450 /* Offset of first parameter from the argument pointer register value.
451 1750 note:
452 Parameters appear in reversed order on the frame (so when they are
453 popped, they come off in the normal left-to-right order.)
454 Computed as follows:
455 one word for the caller's (PC+1) (i.e. the return address)
456 plus total size of called function's "auto" variables
457 plus one word for the caller's frame pointer (i.e. the old FP) */
458
459 #define FIRST_PARM_OFFSET(FNDECL) \
460 (1 + get_frame_size() + 1)
461
462 /* Value is 1 if returning from a function call automatically
463 pops the arguments described by the number-of-args field in the call.
464 FUNDECL is the declaration node of the function (as a tree),
465 FUNTYPE is the data type of the function (as a tree),
466 or for a library call it is an identifier node for the subroutine name.
467 */
468
469 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
470
471 /* Define how to find the value returned by a function.
472 VALTYPE is the data type of the value (as a tree).
473 If the precise function being called is known, FUNC is its FUNCTION_DECL;
474 otherwise, FUNC is 0. */
475
476 #define FUNCTION_VALUE(VALTYPE, FUNC) \
477 gen_rtx(REG,TYPE_MODE(VALTYPE),0)
478
479 /* Define how to find the value returned by a library function
480 assuming the value has mode MODE. */
481 /* 1750 note: no libcalls yet */
482
483 #define LIBCALL_VALUE(MODE) printf("LIBCALL_VALUE called!\n"), \
484 gen_rtx(REG,MODE,0)
485
486 /* 1 if N is a possible register number for a function value. */
487
488 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
489
490 /* 1 if the tree TYPE should be returned in memory instead of in regs.
491 #define RETURN_IN_MEMORY(TYPE) \
492 (int_size_in_bytes(TYPE) > 12)
493 */
494
495 /* Define this if PCC uses the nonreentrant convention for returning
496 structure and union values.
497 #define PCC_STATIC_STRUCT_RETURN */
498
499 /* 1 if N is a possible register number for function argument passing. */
500
501 #define FUNCTION_ARG_REGNO_P(N) ((N) < 12)
502
503 /*****************************************************************************/
504
505 /* Define a data type for recording info about an argument list
506 during the scan of that argument list. This data type should
507 hold all necessary information about the function itself
508 and about the args processed so far, enough to enable macros
509 such as FUNCTION_ARG to determine where the next arg should go.
510
511 For 1750A, this is a single integer, which is a number of words
512 of arguments scanned so far. */
513
514 #define CUMULATIVE_ARGS int
515
516 /* Initialize a variable CUM of type CUMULATIVE_ARGS
517 for a call to a function whose data type is FNTYPE.
518 For a library call, FNTYPE is 0.
519
520 For 1750A, the offset starts at 0. */
521
522 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) ((CUM) = 0)
523
524 /* Update the data in CUM to advance over an argument
525 of mode MODE and data type TYPE.
526 (TYPE is null for libcalls where that information may not be available.)
527
528 1750 note: "int_size_in_bytes()" returns a unit relative to
529 BITS_PER_UNIT, so in our case not bytes, but 16-bit words. */
530
531 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
532 ((CUM) += (MODE) == BLKmode ? int_size_in_bytes(TYPE) : GET_MODE_SIZE(MODE))
533
534 /* Define where to put the arguments to a function.
535 Value is zero to push the argument on the stack,
536 or a hard register in which to store the argument.
537
538 MODE is the argument's machine mode.
539 TYPE is the data type of the argument (as a tree).
540 This is null for libcalls where that information may
541 not be available.
542 CUM is a variable of type CUMULATIVE_ARGS which gives info about
543 the preceding args and about the function being called.
544 NAMED is nonzero if this argument is a named parameter
545 (otherwise it is an extra parameter matching an ellipsis). */
546
547 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) function_arg (CUM,MODE,TYPE,NAMED)
548
549 /* Define the following macro if function calls on the target machine
550 do not preserve any registers; in other words, if `CALL_USED_REGISTERS'
551 has 1 for all registers. This macro enables `-fcaller-saves' by
552 default. Eventually that option will be enabled by default on all
553 machines and both the option and this macro will be eliminated. */
554
555 #define DEFAULT_CALLER_SAVES
556
557
558 /* This macro generates the assembly code for function entry.
559 FILE is a stdio stream to output the code to.
560 SIZE is an int: how many units of temporary storage to allocate.
561 Refer to the array `regs_ever_live' to determine which registers
562 to save; `regs_ever_live[I]' is nonzero if register number I
563 is ever used in the function. This macro is responsible for
564 knowing which registers should not be saved even if used. */
565
566
567 #define FUNCTION_PROLOGUE(FILE, SIZE) { \
568 if (flag_verbose_asm) \
569 { \
570 int regno, regs_used = 0; \
571 fprintf (FILE, "\t; registers used: "); \
572 for (regno = 0; regno < 14; regno++) \
573 if (regs_ever_live[regno]) \
574 { \
575 fprintf (FILE, " %s", reg_names[regno]); \
576 regs_used++; \
577 } \
578 if (regs_used == 0) \
579 fprintf (FILE, "(none)"); \
580 } \
581 if (SIZE > 0) \
582 { \
583 fprintf (FILE, "\n\t%s\tr15,%d", \
584 (SIZE <= 16 ? "sisp" : "sim"), SIZE); \
585 if (flag_verbose_asm) \
586 fprintf (FILE, " ; reserve local-variable space"); \
587 } \
588 if (frame_pointer_needed) \
589 { \
590 fprintf(FILE, "\n\tpshm\tr14,r14"); \
591 if (flag_verbose_asm) \
592 fprintf (FILE, " ; push old frame"); \
593 fprintf (FILE, "\n\tlr\tr14,r15"); \
594 if (flag_verbose_asm) \
595 fprintf (FILE, " ; set new frame"); \
596 } \
597 fprintf (FILE, "\n"); \
598 program_counter = 0; \
599 jmplbl_ndx = -1; \
600 }
601
602 /************* 1750: PROFILER HANDLING NOT YET DONE !!!!!!! *************/
603 /* Output assembler code to FILE to increment profiler label # LABELNO
604 for profiling a function entry. */
605
606 #define FUNCTION_PROFILER(FILE, LABELNO) \
607 fprintf (FILE, "; got into FUNCTION_PROFILER with label # %d\n", (LABELNO))
608
609 /* Output assembler code to FILE to initialize this source file's
610 basic block profiling info, if that has not already been done. */
611 #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
612 fprintf (FILE, "; got into FUNCTION_BLOCK_PROFILER with label # %d\n",LABELNO)
613
614 /* Output assembler code to FILE to increment the entry-count for
615 the BLOCKNO'th basic block in this source file. */
616 #define BLOCK_PROFILER(FILE, BLOCKNO) \
617 fprintf (FILE, "; got into BLOCK_PROFILER with block # %d\n",BLOCKNO)
618
619 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
620 the stack pointer does not matter. The value is tested only in
621 functions that have frame pointers.
622 No definition is equivalent to always zero. */
623
624 #define EXIT_IGNORE_STACK 0
625
626 /* This macro generates the assembly code for function exit,
627 on machines that need it. If FUNCTION_EPILOGUE is not defined
628 then individual return instructions are generated for each
629 return statement. Args are same as for FUNCTION_PROLOGUE.
630
631 The function epilogue should not depend on the current stack pointer!
632 It should use the frame pointer only. This is mandatory because
633 of alloca; we also take advantage of it to omit stack adjustments
634 before returning. */
635
636 #define FUNCTION_EPILOGUE(FILE, SIZE) { \
637 if (frame_pointer_needed) \
638 { \
639 fprintf (FILE, "\tlr\tr15,r14"); \
640 if (flag_verbose_asm) \
641 fprintf (FILE, " ; set stack ptr to frame ptr"); \
642 fprintf (FILE, "\n\tpopm\tr14,r14"); \
643 if (flag_verbose_asm) \
644 fprintf (FILE, " ; restore previous frame ptr"); \
645 fprintf (FILE, "\n"); \
646 } \
647 if (SIZE > 0) \
648 { \
649 fprintf (FILE, "\t%s\tr15,%d", \
650 (SIZE <= 16 ? "aisp" : "aim"), SIZE); \
651 if (flag_verbose_asm) \
652 fprintf (FILE, " ; free up local-var space"); \
653 fprintf (FILE, "\n"); \
654 } \
655 fprintf (FILE, "\turs\tr15\n\n"); \
656 }
657
658 /* If the memory address ADDR is relative to the frame pointer,
659 correct it to be relative to the stack pointer instead.
660 This is for when we don't use a frame pointer.
661 ADDR should be a variable name.
662
663 #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH)
664 */
665
666 /* Store in the variable DEPTH the initial difference between the
667 frame pointer reg contents and the stack pointer reg contents,
668 as of the start of the function body. This depends on the layout
669 of the fixed parts of the stack frame and on how registers are saved.
670 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) DEPTH = 0
671 */
672
673 #define ELIMINABLE_REGS { \
674 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
675 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
676 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } }
677
678 #define CAN_ELIMINATE(FROM, TO) 1
679
680 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
681 OFFSET = (TO == STACK_POINTER_REGNUM) ? -1 : 0
682
683
684 /* Output assembler code for a block containing the constant parts
685 of a trampoline, leaving space for the variable parts. */
686
687 #define TRAMPOLINE_TEMPLATE(FILE) fprintf(FILE,"TRAMPOLINE_TEMPLATE called\n")
688
689 /* Length in units of the trampoline for entering a nested function. */
690
691 #define TRAMPOLINE_SIZE 2
692
693 /* Emit RTL insns to initialize the variable parts of a trampoline.
694 FNADDR is an RTX for the address of the function's pure code.
695 CXT is an RTX for the static chain value for the function. */
696
697 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) printf("INITIALIZE_TRAMPO called\n")
698 /* { \
699 emit_move_insn (gen_rtx (MEM, QImode, plus_constant (TRAMP, 1)), CXT); \
700 emit_move_insn (gen_rtx (MEM, QImode, plus_constant (TRAMP, 6)), FNADDR); \
701 } */
702
703
704 /*****************************************************************************/
705
706 /* Addressing modes, and classification of registers for them. */
707
708 /* 1750 doesn't have a lot of auto-incr./decr. - just for the stack ptr. */
709
710 /* #define HAVE_POST_INCREMENT just for R15 (stack pointer) */
711 /* #define HAVE_POST_DECREMENT */
712 /* #define HAVE_PRE_DECREMENT just for R15 (stack pointer) */
713 /* #define HAVE_PRE_INCREMENT */
714
715 /* Macros to check register numbers against specific register classes. */
716
717 /* These assume that REGNO is a hard or pseudo reg number.
718 They give nonzero only if REGNO is a hard reg of the suitable class
719 or a pseudo reg currently allocated to a suitable hard reg.
720 Since they use reg_renumber, they are safe only once reg_renumber
721 has been allocated, which happens in local-alloc.c.
722 1750 note: The words BASE and INDEX are used in their GCC senses:
723 The "Index Registers", R12 through R15, are used in the 1750
724 instructions LB,STB,AB,SBB,MB,DB,LBX,STBX,...
725 */
726
727 #define REGNO_OK_FOR_BASE_P(REGNO) \
728 ((REGNO) > 0 && (REGNO) <= 15 || \
729 reg_renumber[REGNO] > 0 && reg_renumber[REGNO] <= 15)
730 #define REGNO_OK_FOR_INDEX_P(REGNO) \
731 ((REGNO) >= 12 && (REGNO) <= 15 || \
732 reg_renumber[REGNO] >= 12 && reg_renumber[REGNO] <= 15)
733
734 /* Now macros that check whether X is a register and also,
735 strictly, whether it is in a specified class.
736
737 /* 1 if X is an address register */
738
739 #define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))
740
741 /* Maximum number of registers that can appear in a valid memory address. */
742 #define MAX_REGS_PER_ADDRESS 1
743
744 /* Recognize any constant value that is a valid address. */
745
746 #define CONSTANT_ADDRESS_P(X) CONSTANT_P(X)
747
748 /* Nonzero if the constant value X is a legitimate general operand.
749 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
750
751 #define LEGITIMATE_CONSTANT_P(X) 1
752
753 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
754 and check its validity for a certain class.
755 We have two alternate definitions for each of them.
756 The usual definition accepts all pseudo regs; the other rejects
757 them unless they have been allocated suitable hard regs.
758 The symbol REG_OK_STRICT causes the latter definition to be used.
759
760 Most source files want to accept pseudo regs in the hope that
761 they will get allocated to the class that the insn wants them to be in.
762 Source files for reload pass need to be strict.
763 After reload, it makes no difference, since pseudo regs have
764 been eliminated by then. */
765
766 #ifdef REG_OK_STRICT
767
768 /* Nonzero if X is a hard reg that can be used as an index. */
769 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P(REGNO(X))
770 /* Nonzero if X is a hard reg that can be used as a base reg. */
771 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P(REGNO(X))
772
773 #else
774
775 /* Nonzero if X is a hard reg that can be used as an index
776 or if it is a pseudo reg. */
777 #define REG_OK_FOR_INDEX_P(X) (REGNO (X) >= 12)
778 /* Nonzero if X is a hard reg that can be used as a base reg
779 or if it is a pseudo reg. */
780 #define REG_OK_FOR_BASE_P(X) (REGNO (X) > 0)
781
782 #endif
783
784
785 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
786 that is a valid memory address for an instruction.
787 The MODE argument is the machine mode for the MEM expression
788 that wants to use this address.
789 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS.
790
791 1750 note: Currently we don't implement address expressions that use
792 GCC "Index"-class regs. To be expanded to handle the 1750 "Base with Index"
793 instructions (see also MAX_REGS_PER_ADDRESS and others). */
794
795 #define GO_IF_BASED_ADDRESS(X, ADDR) { \
796 if ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P(X))) \
797 goto ADDR; \
798 if (GET_CODE (X) == PLUS) \
799 { register rtx x0 = XEXP(X,0), x1 = XEXP(X,1); \
800 if ((REG_P(x0) && REG_OK_FOR_BASE_P(x0) && CONSTANT_ADDRESS_P(x1)) \
801 || (REG_P(x1) && REG_OK_FOR_BASE_P(x1) && CONSTANT_ADDRESS_P(x0))) \
802 goto ADDR; } }
803
804 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) { \
805 if (CONSTANT_ADDRESS_P(X)) goto ADDR; \
806 GO_IF_BASED_ADDRESS(X,ADDR) }
807
808
809 /* Try machine-dependent ways of modifying an illegitimate address
810 to be legitimate. If we find one, return the new, valid address.
811 This macro is used in only one place: `memory_address' in explow.c.
812
813 OLDX is the address as it was before break_out_memory_refs was called.
814 In some cases it is useful to look at this to decide what needs to be done.
815
816 MODE and WIN are passed so that this macro can use
817 GO_IF_LEGITIMATE_ADDRESS.
818
819 It is always safe for this macro to do nothing. It exists to recognize
820 opportunities to optimize the output. */
821
822 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)
823
824 /* Go to LABEL if ADDR (a legitimate address expression)
825 has an effect that depends on the machine mode it is used for.
826 On the 68000, only predecrement and postincrement address depend thus
827 (the amount of decrement or increment being the length of the operand). */
828 /* 1750: not used. */
829
830 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
831
832 /*****************************************************************************/
833
834 /* Specify the machine mode that this machine uses
835 for the index in the tablejump instruction. */
836 #define CASE_VECTOR_MODE QImode
837
838 /* Define as C expression which evaluates to nonzero if the tablejump
839 instruction expects the table to contain offsets from the address of the
840 table.
841 Do not define this if the table should contain absolute addresses. */
842 /* #define CASE_VECTOR_PC_RELATIVE 1 */
843
844 /* Specify the tree operation to be used to convert reals to integers. */
845 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
846
847 /* This is the kind of divide that is easiest to do in the general case. */
848 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
849
850 /* Define this as 1 if `char' should by default be signed; else as 0. */
851 #define DEFAULT_SIGNED_CHAR 1
852
853 /* Max number of bytes we can move from memory to memory
854 in one reasonably fast instruction. */
855 #define MOVE_MAX 65536
856
857 /* MOVE_RATIO is the number of move instructions that is better than a
858 block move. */
859 #define MOVE_RATIO 4
860
861 /* Define this if zero-extension is slow (more than one real instruction). */
862 /* #define SLOW_ZERO_EXTEND */
863
864 /* Nonzero if access to memory by bytes is slow and undesirable. */
865 #define SLOW_BYTE_ACCESS 0
866
867 /* Define if shifts truncate the shift count
868 which implies one can omit a sign-extension or zero-extension
869 of a shift count. */
870 /* #define SHIFT_COUNT_TRUNCATED 1 */
871
872 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
873 is done just by pretending it is already truncated. */
874 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
875
876 /* We assume that the store-condition-codes instructions store 0 for false
877 and some other value for true. This is the value stored for true. */
878
879 #define STORE_FLAG_VALUE 1
880
881 /* When a prototype says `char' or `short', really pass an `int'.
882 1750: for now, `char' is 16 bits wide anyway.
883 #define PROMOTE_PROTOTYPES */
884
885 /* Specify the machine mode that pointers have.
886 After generation of rtl, the compiler makes no further distinction
887 between pointers and any other objects of this machine mode. */
888 #define Pmode QImode
889
890 /* A function address in a call instruction
891 is a 16-bit address (for indexing purposes) */
892 #define FUNCTION_MODE QImode
893
894 /* Compute the cost of computing a constant rtl expression RTX
895 whose rtx-code is CODE. The body of this macro is a portion
896 of a switch statement. If the code is computed here,
897 return it with a return statement. Otherwise, break from the switch. */
898
899 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
900 case CONST_INT: \
901 return (INTVAL(RTX) >= -16 && INTVAL(RTX) <= 16) ? 1 : 3; \
902 case CONST: \
903 case LABEL_REF: \
904 case SYMBOL_REF: \
905 return 3; \
906 case CONST_DOUBLE: \
907 return 4;
908
909 #define ADDRESS_COST(ADDRESS) (memop_valid (ADDRESS) ? 3 : 10)
910
911 #define REGISTER_MOVE_COST(FROM,TO) 2
912
913 #define MEMORY_MOVE_COST(M) 4
914
915 /* Tell final.c how to eliminate redundant test instructions. */
916
917 /* Here we define machine-dependent flags and fields in cc_status
918 (see `conditions.h'). */
919 /* MIL-STD-1750: none -- just has the garden variety C,P,Z,N flags. */
920
921 /* Store in cc_status the expressions
922 that the condition codes will describe
923 after execution of an instruction whose pattern is EXP.
924 Do not alter them if the instruction would not alter the cc's.
925 1750: See file out-1750a.c for notice_update_cc(). */
926
927 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP)
928
929 /**********************************************/
930 /* Produce debugging info in the DWARF format
931 #define DWARF_DEBUGGING_INFO
932 */
933
934 /*****************************************************************************/
935
936 /* Control the assembler format that we output. */
937
938 /* Output at beginning of assembler file. */
939
940 #define ASM_FILE_START(FILE) { \
941 char *p, name[40]; \
942 if ((p = (char *)strrchr(main_input_filename,'/')) != NULL ? 1 : \
943 (p = (char *)strrchr(main_input_filename,']')) != NULL) \
944 p++; \
945 else \
946 p = main_input_filename; \
947 strcpy(name,p); \
948 if (p = (char *)strchr(name,'.')) \
949 *p = '\0'; \
950 fprintf(FILE,"\tname %s\n",name); \
951 fprintf(FILE,"\tnolist\n\tinclude \"ms1750.inc\"\n\tlist\n\n"); \
952 fprintf(FILE,"\tglobal\t__main\n\n"); }
953
954 /* Output at end of assembler file.
955 For 1750, we copy the data labels accrued in datalbl[] from the Constants
956 section (Konst) to the Writable-Data section (Static). */
957
958 #define ASM_FILE_END(FILE) \
959 do { \
960 if (datalbl_ndx >= 0) { \
961 int i, cum_size=0; \
962 fprintf(FILE,"\n\tstatic\ninit_srel\n"); \
963 for (i = 0; i <= datalbl_ndx; i++) { \
964 if (datalbl[i].name == NULL) \
965 { \
966 fprintf(stderr, "asm_file_end internal datalbl err\n"); \
967 exit (0); \
968 } \
969 fprintf(FILE,"%s \tblock %d\n", \
970 datalbl[i].name,datalbl[i].size); \
971 cum_size += datalbl[i].size; \
972 } \
973 fprintf(FILE,"\n\tinit\n"); \
974 fprintf(FILE,"\tlim\tr0,init_srel\n"); /* destin. */ \
975 fprintf(FILE,"\tlim\tr1,%d\n",cum_size); /* count */ \
976 fprintf(FILE,"\tlim\tr2,K%s\n",datalbl[0].name); /* source */ \
977 fprintf(FILE,"\tmov\tr0,r2\n"); \
978 fprintf(FILE,"\n\tnormal\n"); \
979 datalbl_ndx = -1; /* reset stuff */ \
980 for (i = 0; i < DATALBL_ARRSIZ; i++) \
981 datalbl[i].size = 0; \
982 } \
983 fprintf(FILE,"\n\tend\n"); \
984 } while (0)
985
986 /* Output to assembler file text saying following lines
987 may contain character constants, extra white space, comments, etc. */
988
989 #define ASM_APP_ON "; ASM_APP_ON\n"
990
991 /* Output to assembler file text saying following lines
992 no longer contain unusual constructs. */
993
994 #define ASM_APP_OFF "; ASM_APP_OFF\n"
995
996
997 #define EXTRA_SECTIONS in_readonly_data
998
999 #define EXTRA_SECTION_FUNCTIONS \
1000 void const_section() \
1001 { \
1002 fprintf(asm_out_file,"\tkonst\n"); \
1003 current_section = Konst; \
1004 } \
1005 check_section(sect) \
1006 enum section sect; \
1007 { \
1008 if (current_section != sect) { \
1009 fprintf(asm_out_file,"\t%s\n",sectname[(int)sect]); \
1010 current_section = sect; \
1011 } \
1012 switch (sect) { \
1013 case Init: \
1014 case Normal: \
1015 in_section = in_text; \
1016 break; \
1017 case Static: \
1018 in_section = in_data; \
1019 break; \
1020 case Konst: \
1021 in_section = in_readonly_data; \
1022 break; \
1023 } \
1024 }
1025
1026
1027 /* Function that switches to the read-only data section (optional) */
1028 #define READONLY_DATA_SECTION const_section
1029
1030 /* Output before program init section */
1031 #define INIT_SECTION_ASM_OP "\n\tinit ; init_section\n"
1032
1033 /* Output before program text section */
1034 #define TEXT_SECTION_ASM_OP "\n\tnormal ; text_section\n"
1035
1036 /* Output before writable data.
1037 1750 Note: This is actually read-only data. The copying from read-only
1038 to writable memory is done elsewhere (in ASM_FILE_END.)
1039 */
1040 #define DATA_SECTION_ASM_OP "\n\tkonst ; data_section\n"
1041
1042 /* How to refer to registers in assembler output.
1043 This sequence is indexed by compiler's hard-register-number (see above). */
1044
1045 #define REGISTER_NAMES \
1046 { "0", "1", "2", "3", "4", "5", "6", "7", \
1047 "8", "9","10","11","12","13","14","15" }
1048
1049 /* How to renumber registers for dbx and gdb. */
1050
1051 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1052
1053 /****************** Assembler output formatting **********************/
1054
1055 #define ASM_IDENTIFY_GCC(FILE) fputs ("; gcc2_compiled:\n", FILE)
1056
1057 #define ASM_COMMENT_START ";"
1058
1059 #define ASM_OUTPUT_FUNNAM(FILE,NAME) \
1060 fprintf(FILE,"%s\n",NAME)
1061
1062 #define ASM_OUTPUT_OPCODE(FILE,PTR) do { \
1063 while (*(PTR) != '\0' && *(PTR) != ' ') { \
1064 putc (*(PTR), FILE); \
1065 (PTR)++; \
1066 } \
1067 while (*(PTR) == ' ') \
1068 (PTR)++; \
1069 putc ('\t', FILE); \
1070 program_counter += 2; \
1071 } while (0)
1072
1073 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
1074 fprintf(FILE,"%s\n",NAME)
1075
1076 /* This is how to output the definition of a user-level label named NAME,
1077 such as the label on a static function or variable NAME. */
1078 /* 1750 note: Labels are prefixed with a 'K'. This is because handling
1079 has been changed for labels to be output in the "Constants" section
1080 (named "Konst"), and special initialization code takes care of copying
1081 the Const-section data into the writable data section (named "Static").
1082 In the Static section we therefore have the true label names (i.e.
1083 not prefixed with 'K'). */
1084
1085 #define ASM_OUTPUT_LABEL(FILE,NAME) \
1086 do { if (NAME[0] == '.') { \
1087 fprintf(stderr,"Oops! label %s can't begin with '.'\n",NAME); \
1088 abort(); \
1089 } \
1090 else { \
1091 check_section(Konst); \
1092 fprintf(FILE,"K%s\n",NAME); \
1093 fflush(FILE); \
1094 datalbl[++datalbl_ndx].name = (char *)xstrdup (NAME);\
1095 datalbl[datalbl_ndx].size = 0; \
1096 label_pending = 1; \
1097 } \
1098 } while (0)
1099
1100
1101 /* This is how to output a command to make the user-level label named NAME
1102 defined for reference from other files. */
1103
1104 #define ASM_GLOBALIZE_LABEL(FILE,NAME) do { \
1105 fprintf (FILE, "\tglobal %s\t; export\n", NAME); \
1106 } while (0)
1107
1108 /* The prefix to add to user-visible assembler symbols. */
1109
1110 #define USER_LABEL_PREFIX ""
1111
1112 /* This is how to output an internal numbered label where
1113 PREFIX is the class of label and NUM is the number within the class. */
1114
1115 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
1116 do { \
1117 if (strcmp(PREFIX,"LC") == 0) { \
1118 label_pending = 1; \
1119 datalbl[++datalbl_ndx].name = (char *) malloc (9); \
1120 sprintf(datalbl[datalbl_ndx].name,"LC%d",NUM); \
1121 datalbl[datalbl_ndx].size = 0; \
1122 check_section(Konst); \
1123 fprintf(FILE,"K%s%d\n",PREFIX,NUM); \
1124 } \
1125 else if (find_jmplbl(NUM) < 0) { \
1126 jmplbl[++jmplbl_ndx].num = NUM; \
1127 jmplbl[jmplbl_ndx].pc = program_counter; \
1128 fprintf(FILE, "%s%d\n", PREFIX, NUM); \
1129 } \
1130 fflush(FILE); \
1131 } while (0)
1132
1133
1134 /* This is how to store into the string LABEL
1135 the symbol_ref name of an internal numbered label where
1136 PREFIX is the class of label and NUM is the number within the class.
1137 This is suitable for output with `assemble_name'. */
1138
1139 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
1140 sprintf (LABEL, "%s%d", PREFIX, NUM)
1141
1142 /* Output at the end of a jump table.
1143 1750: To be uncommented when we can put jump tables in Konst.
1144 #define ASM_OUTPUT_CASE_END(FILE,NUM,INSN) \
1145 fprintf (FILE, "\tnormal\t; case_end\n")
1146 */
1147
1148 /* Currently, it is not possible to put jump tables in section Konst.
1149 This is because there is a one-to-one relation between sections Konst
1150 and Static (i.e., all Konst data are copied to Static, and the order
1151 of data is the same between the two sections.) However, jump tables are
1152 not copied to Static, which destroys the equivalence between Konst and
1153 Static. When a more intelligent Konst-to-Static copying mechanism is
1154 implemented (i.e. one that excludes the copying of jumptables), then
1155 ASM_OUTPUT_CASE_END shall be defined, and JUMP_LABELS_IN_TEXT_SECTION
1156 shall be undefined. */
1157
1158 #define JUMP_TABLES_IN_TEXT_SECTION 1
1159
1160 /* This is how to output an assembler line defining a 1750A `float'
1161 constant. */
1162
1163 #define ASM_OUTPUT_SHORT_FLOAT(FILE,VALUE) \
1164 do { \
1165 if (label_pending) { \
1166 label_pending = 0; \
1167 sprintf (datalbl[datalbl_ndx].value, "%lf", (double) VALUE); \
1168 } \
1169 datalbl[datalbl_ndx].size += 2; \
1170 fprintf (FILE, "\tdataf\t%lf\n",VALUE); \
1171 } while(0)
1172
1173 /* This is how to output an assembler line defining a 1750A `double'
1174 constant. */
1175
1176 #define ASM_OUTPUT_THREE_QUARTER_FLOAT(FILE,VALUE) \
1177 do { \
1178 if (label_pending) { \
1179 label_pending = 0; \
1180 sprintf (datalbl[datalbl_ndx].value, "%lf", VALUE); \
1181 } \
1182 datalbl[datalbl_ndx].size += 3; \
1183 fprintf(FILE,"\tdataef\t%lf\n",VALUE); \
1184 } while (0)
1185
1186 /* This is how to output an assembler line defining a string constant. */
1187
1188 #define ASM_OUTPUT_ASCII(FILE, PTR, LEN) do { \
1189 int i; \
1190 if (label_pending) \
1191 label_pending = 0; \
1192 datalbl[datalbl_ndx].size += LEN; \
1193 for (i = 0; i < LEN; i++) { \
1194 if ((i % 15) == 0) { \
1195 if (i != 0) \
1196 fprintf(FILE,"\n"); \
1197 fprintf(FILE,"\tdata\t"); \
1198 } \
1199 else \
1200 fprintf(FILE,","); \
1201 if (PTR[i] >= 32 && PTR[i] < 127) \
1202 fprintf(FILE,"'%c'",PTR[i]); \
1203 else \
1204 fprintf(FILE,"%d",PTR[i]); \
1205 } \
1206 fprintf(FILE,"\n"); \
1207 } while (0)
1208
1209 /* This is how to output an assembler line defining a `char', `short', or
1210 `int' constant.
1211 1750 NOTE: The reason why this macro also outputs `short' and `int'
1212 constants is that for the 1750, BITS_PER_UNIT is 16 (as opposed to the
1213 usual 8.) This behavior is different from the usual, where
1214 ASM_OUTPUT_CHAR only outputs character constants. The name
1215 of this macro should perhaps be `ASM_OUTPUT_QUARTER_INT' or so.
1216 */
1217
1218 #define ASM_OUTPUT_CHAR(FILE,VALUE) do { \
1219 if (label_pending) \
1220 label_pending = 0; \
1221 datalbl[datalbl_ndx].size++; \
1222 fprintf(FILE, "\tdata\t"); \
1223 output_addr_const(FILE, VALUE); \
1224 fprintf(FILE, "\n"); \
1225 } while (0)
1226
1227 /* This is how to output an assembler line defining a `long int' constant.
1228 1750 NOTE: The reason why this macro outputs `long' instead of `short'
1229 constants is that for the 1750, BITS_PER_UNIT is 16 (as opposed to the
1230 usual 8.) The name of this macro should perhaps be `ASM_OUTPUT_HALF_INT'.
1231 */
1232
1233 #define ASM_OUTPUT_SHORT(FILE,VALUE) do { \
1234 if (label_pending) \
1235 label_pending = 0; \
1236 datalbl[datalbl_ndx].size += 2; \
1237 fprintf(FILE, "\tdatal\t%d\n",INTVAL(VALUE)); \
1238 } while (0)
1239
1240 /* This is how to output an assembler line for a numeric constant byte. */
1241
1242 #define ASM_OUTPUT_BYTE(FILE,VALUE) do { \
1243 if (label_pending) \
1244 label_pending = 0; \
1245 datalbl[datalbl_ndx].size++; \
1246 fprintf(FILE, "\tdata\t#%x\n", VALUE); \
1247 } while (0)
1248
1249 /* This is how to output an insn to push a register on the stack.
1250 It need not be very fast code. */
1251
1252 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
1253 fprintf (FILE, "\tPSHM R%s,R%s\n", reg_names[REGNO])
1254
1255 /* This is how to output an insn to pop a register from the stack.
1256 It need not be very fast code. */
1257
1258 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
1259 fprintf (FILE, "\tPOPM R%s,R%s\n", reg_names[REGNO])
1260
1261 /* This is how to output an element of a case-vector that is absolute. */
1262
1263 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1264 fprintf (FILE, "\tdata\tL%d ;addr_vec_elt\n", VALUE)
1265
1266 /* This is how to output an element of a case-vector that is relative. */
1267
1268 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1269 fprintf (FILE, "\tdata\tL%d-L%d ;addr_diff_elt\n", VALUE,REL)
1270
1271 /* This is how to output an assembler line
1272 that says to advance the location counter
1273 to a multiple of 2**LOG bytes. */
1274
1275 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1276 fprintf(FILE,"; in ASM_OUTPUT_ALIGN: pwr_of_2_bytcnt=%d\n",LOG)
1277
1278 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1279 fprintf(FILE,"; in ASM_OUTPUT_SKIP: size=%d\n",SIZE)
1280
1281 /* This says how to output an assembler line
1282 to define a global common symbol. */
1283
1284 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) do { \
1285 check_section(Static); \
1286 fprintf (FILE, "\tcommon %s,%d\n", NAME, SIZE); \
1287 } while (0)
1288
1289 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) do { \
1290 fprintf (FILE, "\tglobal %s\t; import\n", NAME); \
1291 } while (0)
1292
1293 /* This says how to output an assembler line
1294 to define a local common symbol. */
1295
1296 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) do { \
1297 check_section (Static); \
1298 fprintf(FILE,"%s \tblock %d\t; local common\n",NAME,SIZE); \
1299 } while (0)
1300
1301 /* Store in OUTPUT a string (made with alloca) containing
1302 an assembler-name for a local static variable named NAME.
1303 LABELNO is an integer which is different for each call. */
1304
1305 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
1306 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
1307 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
1308
1309 #define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) do { \
1310 fprintf(FILE, "\tinit\n\t"); assemble_name(FILE, NAME); \
1311 fprintf(FILE," ;constructor\n"); } while (0)
1312
1313 #define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) do { \
1314 fprintf(FILE, "\tinit\n\t"); assemble_name(FILE, NAME); \
1315 fprintf(FILE," ;destructor\n"); } while (0)
1316
1317 /* Define the parentheses used to group arithmetic operations
1318 in assembler code. */
1319
1320 #define ASM_OPEN_PAREN "("
1321 #define ASM_CLOSE_PAREN ")"
1322
1323 /* Define results of standard character escape sequences. */
1324 #define TARGET_BELL 007
1325 #define TARGET_BS 010
1326 #define TARGET_TAB 011
1327 #define TARGET_NEWLINE 012
1328 #define TARGET_VT 013
1329 #define TARGET_FF 014
1330 #define TARGET_CR 015
1331
1332
1333 /* Print operand X (an rtx) in assembler syntax to file FILE.
1334 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
1335 For `%' followed by punctuation, CODE is the punctuation and X is null.
1336 1750 note: there are three special CODE characters:
1337 'D', 'E': print a reference to a floating point constant (D=double,
1338 E=single precision) label name
1339 'F': print a label defining a floating-point constant value
1340 'J': print the absolute value of a negative INT_CONST
1341 (this is used in LISN/CISN/MISN/SISP and others)
1342 'Q': print a 1750 Base-Register-with-offset instruction's operands
1343 */
1344
1345 /* 1750A: see file aux-output.c */
1346 #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE,X,CODE)
1347 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE,ADDR)
1348
This page took 0.105639 seconds and 6 git commands to generate.