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