|
|
1.1 root 1: /* Definitions of target machine for GNU compiler. Convex version.
2: Copyright (C) 1989 Free Software Foundation, Inc.
3:
4: This file is part of GNU CC.
5:
6: GNU CC is distributed in the hope that it will be useful,
7: but WITHOUT ANY WARRANTY. No author or distributor
8: accepts responsibility to anyone for the consequences of using it
9: or for whether it serves any particular purpose or works at all,
10: unless he says so in writing. Refer to the GNU CC General Public
11: License for full details.
12:
13: Everyone is granted permission to copy, modify and redistribute
14: GNU CC, but only under the conditions described in the
15: GNU CC General Public License. A copy of this license is
16: supposed to have been given to you along with GNU CC so you
17: can know your rights and responsibilities. It should be in a
18: file named COPYING. Among other things, the copyright notice
19: and this notice must be preserved on all copies. */
20:
21:
22: /* Names to predefine in the preprocessor for this target machine. */
23:
24: #define CPP_PREDEFINES "-Dconvex -Dunix"
25:
26: /* Print subsidiary information on the compiler version in use. */
27:
28: #define TARGET_VERSION fprintf (stderr, " (convex)");
29:
30: /* Run-time compilation parameters selecting different hardware subsets. */
31:
32: extern int target_flags;
33:
34: /* Macros used in the machine description to test the flags. */
35:
36: /*
37: -mc1 avoid C2-only instructions; default on C1 host
38: -mc2 use C2-only instructions; default on C2 host
39: -margcount use standard calling sequence, with arg count word
40: -mnoargcount don't push arg count (it's in the symbol table) (usually)
41: */
42:
43: #define TARGET_C1 (target_flags & 1)
44: #define TARGET_C2 (target_flags & 2)
45: #define TARGET_ARGCOUNT (target_flags & 4)
46:
47: /* Macro to define tables used to set the flags.
48: This is a list in braces of pairs in braces,
49: each pair being { "NAME", VALUE }
50: where VALUE is the bits to set or minus the bits to clear.
51: An empty string NAME is used to identify the default VALUE. */
52:
53: #define TARGET_SWITCHES \
54: { { "c1", 1 }, \
55: { "c2", 2 }, \
56: { "noc1", -1 }, \
57: { "noc2", -2 }, \
58: { "argcount", 4 }, \
59: { "noargcount", -4 }, \
60: { "", TARGET_DEFAULT }}
61:
62: /* Default target_flags if no switches specified. */
63:
64: #define TARGET_DEFAULT 0
65:
66: /* Pick a target if none was specified */
67:
68: #define OVERRIDE_OPTIONS override_options ();
69:
70: /* Allow $ in identifiers */
71:
72: #define DOLLARS_IN_IDENTIIFERS 1
73:
74: /* Target machine storage layout */
75:
76: /* Define this if most significant bit is lowest numbered
77: in instructions that operate on numbered bit-fields. */
78: #define BITS_BIG_ENDIAN
79:
80: /* Define this if most significant byte of a word is the lowest numbered. */
81: #define BYTES_BIG_ENDIAN
82:
83: /* Define this if most significant word of a multiword number is numbered. */
84: /* #define WORDS_BIG_ENDIAN */
85:
86: /* Number of bits in an addressible storage unit */
87: #define BITS_PER_UNIT 8
88:
89: /* Width in bits of a "word", which is the contents of a machine register.
90: Note that this is not necessarily the width of data type `int';
91: if using 16-bit ints on a 68000, this would still be 32.
92: But on a machine with 16-bit registers, this would be 16. */
93: #define BITS_PER_WORD 32
94:
95: /* Width of a word, in units (bytes). */
96: #define UNITS_PER_WORD 4
97:
98: /* Width in bits of a pointer.
99: See also the macro `Pmode' defined below. */
100: #define POINTER_SIZE 32
101:
102: /* Allocation boundary (in *bits*) for storing pointers in memory. */
103: #define POINTER_BOUNDARY 32
104:
105: /* Allocation boundary (in *bits*) for storing arguments in argument list. */
106: #define PARM_BOUNDARY 32
107:
108: /* Boundary (in *bits*) on which stack pointer should be aligned. */
109: #define STACK_BOUNDARY 32
110:
111: /* Allocation boundary (in *bits*) for the code of a function. */
112: #define FUNCTION_BOUNDARY 16
113:
114: /* Alignment of field after `int : 0' in a structure. */
115: #define EMPTY_FIELD_BOUNDARY 32
116:
117: /* Every structure's size must be a multiple of this. */
118: #define STRUCTURE_SIZE_BOUNDARY 8
119:
120: /* No data type wants to be aligned rounder than this. */
121: /* beware of doubles in structs -- 64 is incompatible with pcc */
122: #define BIGGEST_ALIGNMENT 32
123:
124: /* Define this if move instructions will actually fail to work
125: when given unaligned data. */
126: /* #define STRICT_ALIGNMENT */
127:
128: /* Standard register usage. */
129:
130: /* Number of actual hardware registers.
131: The hardware registers are assigned numbers for the compiler
132: from 0 to just below FIRST_PSEUDO_REGISTER.
133: All registers that the compiler knows about must be given numbers,
134: even those that are not normally considered general registers. */
135: #define FIRST_PSEUDO_REGISTER 16
136:
137: /* 1 for registers that have pervasive standard uses
138: and are not available for the register allocator.
139: For Convex, these are AP, FP, and SP. */
140: #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1}
141:
142: /* 1 for registers not available across function calls.
143: These must include the FIXED_REGISTERS and also any
144: registers that can be used without being saved.
145: The latter must include the registers where values are returned
146: and the register where structure-value addresses are passed.
147: Aside from that, you can include as many other registers as you like. */
148: #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
149:
150: /* Return number of consecutive hard regs needed starting at reg REGNO
151: to hold something of mode MODE.
152: This is ordinarily the length in words of a value of mode MODE
153: but can be less for certain modes in special long registers.
154: On Convex, all values fit in one register. */
155: #define HARD_REGNO_NREGS(REGNO, MODE) 1
156:
157: /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
158: On Convex, S registers can hold any type, A registers can any nonfloat */
159: #define HARD_REGNO_MODE_OK(REGNO, MODE) \
160: ((REGNO) < 8 || ((MODE) != SFmode && (MODE) != DFmode && (MODE) != DImode))
161:
162: /* Value is 1 if it is a good idea to tie two pseudo registers
163: when one has mode MODE1 and one has mode MODE2.
164: If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
165: for any hard reg, then this must be 0 for correct output. */
166: #define MODES_TIEABLE_P(MODE1, MODE2) \
167: (((MODE1) == SFmode || (MODE1) == DFmode || (MODE1) == DImode) \
168: == ((MODE2) == SFmode || (MODE2) == DFmode || (MODE2) == DImode))
169:
170: /* Specify the registers used for certain standard purposes.
171: The values of these macros are register numbers. */
172:
173: /* Register to use for pushing function arguments. */
174: #define STACK_POINTER_REGNUM 8
175:
176: /* Base register for access to local variables of the function. */
177: #define FRAME_POINTER_REGNUM 15
178:
179: /* Value should be nonzero if functions must have frame pointers.
180: Zero means the frame pointer need not be set up (and parms
181: may be accessed via the stack pointer) in functions that seem suitable.
182: This is computed in `reload', in reload1.c. */
183: #define FRAME_POINTER_REQUIRED 1
184:
185: /* Base register for access to arguments of the function. */
186: #define ARG_POINTER_REGNUM 14
187:
188: /* Register in which static-chain is passed to a function. */
189: #define STATIC_CHAIN_REGNUM 10
190:
191: /* Register in which address to store a structure value
192: is passed to a function. */
193: #define STRUCT_VALUE_REGNUM 9
194:
195: /* Define the classes of registers for register constraints in the
196: machine description. Also define ranges of constants.
197:
198: One of the classes must always be named ALL_REGS and include all hard regs.
199: If there is more than one class, another class must be named NO_REGS
200: and contain no registers.
201:
202: The name GENERAL_REGS must be the name of a class (or an alias for
203: another name such as ALL_REGS). This is the class of registers
204: that is allowed by "g" or "r" in a register constraint.
205: Also, registers outside this class are allocated only when
206: instructions express preferences for them.
207:
208: The classes must be numbered in nondecreasing order; that is,
209: a larger-numbered class must never be contained completely
210: in a smaller-numbered class.
211:
212: For any two classes, it is very desirable that there be another
213: class that represents their union. */
214:
215: /* Convex has classes A (address) and S (scalar). Seems to work
216: better to put S first, here and in the md. */
217:
218: enum reg_class { NO_REGS, S_REGS, A_REGS, ALL_REGS, LIM_REG_CLASSES };
219:
220: #define N_REG_CLASSES (int) LIM_REG_CLASSES
221:
222: /* Since GENERAL_REGS is the same class as ALL_REGS,
223: don't give it a different class number; just make it an alias. */
224:
225: #define GENERAL_REGS ALL_REGS
226:
227: /* Give names of register classes as strings for dump file. */
228:
229: #define REG_CLASS_NAMES \
230: {"NO_REGS", "S_REGS", "A_REGS", "ALL_REGS" }
231:
232: /* Define which registers fit in which classes.
233: This is an initializer for a vector of HARD_REG_SET
234: of length N_REG_CLASSES. */
235:
236: #define REG_CLASS_CONTENTS {0, 0x00ff, 0xff00, 0xffff}
237:
238: /* The same information, inverted:
239: Return the class number of the smallest class containing
240: reg number REGNO. This could be a conditional expression
241: or could index an array. */
242:
243: #define S_REGNO_P(REGNO) ((REGNO) < 8)
244: #define A_REGNO_P(REGNO) ((REGNO) >= 8)
245:
246: #define REGNO_REG_CLASS(REGNO) \
247: (S_REGNO_P (REGNO) ? S_REGS : A_REGS)
248:
249: /* The class value for index registers, and the one for base regs. */
250:
251: #define INDEX_REG_CLASS A_REGS
252: #define BASE_REG_CLASS A_REGS
253:
254: /* Get reg_class from a letter such as appears in the machine description. */
255: /* S regs use the letter 'd' because 's' is taken. */
256:
257: #define REG_CLASS_FROM_LETTER(C) \
258: ((C) == 'a' ? A_REGS : (C) == 'd' ? S_REGS : NO_REGS)
259:
260: /* The letters I, J, K, L and M in a register constraint string
261: can be used to stand for particular ranges of immediate operands.
262: This macro defines what the ranges are.
263: C is the letter, and VALUE is a constant value.
264: Return 1 if VALUE is in the range specified by C. */
265:
266: /* Convex uses only I:
267: 32-bit value with sign bit off, usable as immediate in DImode logical
268: instructions and, or, xor */
269:
270: #define CONST_OK_FOR_LETTER_P(VALUE, C) ((VALUE) >= 0)
271:
272: /* Similar, but for floating constants, and defining letters G and H.
273: Here VALUE is the CONST_DOUBLE rtx itself. */
274: /* Convex uses only G:
275: value usable in ld.d (low word 0) or ld.l (high word all sign) */
276:
277: #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
278: (LD_D_P (VALUE) || LD_L_P (VALUE))
279:
280: #define LD_D_P(X) (CONST_DOUBLE_HIGH (X) == 0)
281: #define LD_L_P(X) (CONST_DOUBLE_HIGH (X) >= 0 ? \
282: CONST_DOUBLE_LOW (X) == 0 : CONST_DOUBLE_LOW (X) == -1)
283:
284: /* Given an rtx X being reloaded into a reg required to be
285: in class CLASS, return the class of reg to actually use.
286: In general this is just CLASS; but on some machines
287: in some cases it is preferable to use a more restrictive class. */
288:
289: #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
290:
291: /* Return the maximum number of consecutive registers
292: needed to represent mode MODE in a register of class CLASS. */
293: #define CLASS_MAX_NREGS(CLASS, MODE) 1
294:
295: /* Stack layout; function entry, exit and calling. */
296:
297: /* Define this if pushing a word on the stack
298: makes the stack pointer a smaller address. */
299: #define STACK_GROWS_DOWNWARD
300:
301: /* Define this if the nominal address of the stack frame
302: is at the high-address end of the local variables;
303: that is, each additional local variable allocated
304: goes at a more negative offset in the frame. */
305: #define FRAME_GROWS_DOWNWARD
306:
307: /* Offset within stack frame to start allocating local variables at.
308: If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
309: first local allocated. Otherwise, it is the offset to the BEGINNING
310: of the first local allocated. */
311: #define STARTING_FRAME_OFFSET 0
312:
313: /* If we generate an insn to push BYTES bytes,
314: this says how many the stack pointer really advances by. */
315: #define PUSH_ROUNDING(BYTES) (BYTES)
316:
317: /* Offset of first parameter from the argument pointer register value. */
318: #define FIRST_PARM_OFFSET(FNDECL) 0
319:
320: /* Value is 1 if returning from a function call automatically
321: pops the arguments described by the number-of-args field in the call.
322: FUNTYPE is the data type of the function (as a tree),
323: or for a library call it is an identifier node for the subroutine name. */
324: /* The standard Convex call, with arg count word, includes popping the
325: args as part of the call template. We optionally omit the arg count
326: word and let gcc combine the arg pops. */
327: #define RETURN_POPS_ARGS(FUNTYPE) TARGET_ARGCOUNT
328:
329: /* Define how to find the value returned by a function.
330: VALTYPE is the data type of the value (as a tree).
331: If the precise function being called is known, FUNC is its FUNCTION_DECL;
332: otherwise, FUNC is 0. */
333:
334: /* On Convex the return value is in S0 regardless. */
335:
336: #define FUNCTION_VALUE(VALTYPE, FUNC) \
337: gen_rtx (REG, TYPE_MODE (VALTYPE), 0)
338:
339: /* Define how to find the value returned by a library function
340: assuming the value has mode MODE. */
341:
342: /* On Convex the return value is in S0 regardless. */
343:
344: #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)
345:
346: /* 1 if N is a possible register number for a function value.
347: On the Convex, S0 is the only register thus used. */
348:
349: #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
350:
351: /* 1 if N is a possible register number for function argument passing. */
352:
353: #define FUNCTION_ARG_REGNO_P(N) 0
354:
355: /* Define a data type for recording info about an argument list
356: during the scan of that argument list. This data type should
357: hold all necessary information about the function itself
358: and about the args processed so far, enough to enable macros
359: such as FUNCTION_ARG to determine where the next arg should go.
360:
361: On the vax, this is a single integer, which is a number of bytes
362: of arguments scanned so far. */
363:
364: #define CUMULATIVE_ARGS int
365:
366: /* Initialize a variable CUM of type CUMULATIVE_ARGS
367: for a call to a function whose data type is FNTYPE.
368: For a library call, FNTYPE is 0.
369:
370: On Convex, the offset starts at 0. */
371:
372: #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE) \
373: ((CUM) = 0)
374:
375: /* Update the data in CUM to advance over an argument
376: of mode MODE and data type TYPE.
377: (TYPE is null for libcalls where that information may not be available.) */
378:
379: #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
380: ((CUM) += ((MODE) != BLKmode \
381: ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
382: : (int_size_in_bytes (TYPE) + 3) & ~3))
383:
384: /* Define where to put the arguments to a function.
385: Value is zero to push the argument on the stack,
386: or a hard register in which to store the argument.
387:
388: MODE is the argument's machine mode.
389: TYPE is the data type of the argument (as a tree).
390: This is null for libcalls where that information may
391: not be available.
392: CUM is a variable of type CUMULATIVE_ARGS which gives info about
393: the preceding args and about the function being called.
394: NAMED is nonzero if this argument is a named parameter
395: (otherwise it is an extra parameter matching an ellipsis). */
396:
397: /* On Convex, all args are pushed. */
398:
399: #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
400:
401: /* This macro generates the assembly code for function entry.
402: FILE is a stdio stream to output the code to.
403: SIZE is an int: how many units of temporary storage to allocate.
404: Refer to the array `regs_ever_live' to determine which registers
405: to save; `regs_ever_live[I]' is nonzero if register number I
406: is ever used in the function. This macro is responsible for
407: knowing which registers should not be saved even if used. */
408:
409: #define FUNCTION_PROLOGUE(FILE, SIZE) \
410: { if ((SIZE) != 0) fprintf (FILE, "\tsub.w #%d,sp\n", (SIZE));}
411:
412: /* Output assembler code to FILE to increment profiler label # LABELNO
413: for profiling a function entry. */
414:
415: #define FUNCTION_PROFILER(FILE, LABELNO) \
416: fprintf (FILE, "\tldea LP%d,a1\n\tcallq mcount\n", (LABELNO));
417:
418: /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
419: the stack pointer does not matter. The value is tested only in
420: functions that have frame pointers.
421: No definition is equivalent to always zero. */
422:
423: #define EXIT_IGNORE_STACK 1
424:
425: /* This macro generates the assembly code for function exit,
426: on machines that need it. If FUNCTION_EPILOGUE is not defined
427: then individual return instructions are generated for each
428: return statement. Args are same as for FUNCTION_PROLOGUE. */
429:
430: /* #define FUNCTION_EPILOGUE(FILE, SIZE) */
431:
432: /* If the memory address ADDR is relative to the frame pointer,
433: correct it to be relative to the stack pointer instead.
434: This is for when we don't use a frame pointer.
435: ADDR should be a variable name. */
436:
437: #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) abort ();
438:
439: /* Addressing modes, and classification of registers for them. */
440:
441: /* #define HAVE_POST_INCREMENT */
442: /* #define HAVE_POST_DECREMENT */
443:
444: /* #define HAVE_PRE_DECREMENT */
445: /* #define HAVE_PRE_INCREMENT */
446:
447: /* Macros to check register numbers against specific register classes. */
448:
449: /* These assume that REGNO is a hard or pseudo reg number.
450: They give nonzero only if REGNO is a hard reg of the suitable class
451: or a pseudo reg currently allocated to a suitable hard reg.
452: Since they use reg_renumber, they are safe only once reg_renumber
453: has been allocated, which happens in local-alloc.c. */
454:
455: #define REGNO_OK_FOR_INDEX_P(regno) \
456: (((regno) ^ 010) < 8 || ((reg_renumber[regno] ^ 010) & -8) == 0)
457: #define REGNO_OK_FOR_BASE_P(regno) \
458: (((regno) ^ 010) < 8 || ((reg_renumber[regno] ^ 010) & -8) == 0)
459:
460: /* Maximum number of registers that can appear in a valid memory address. */
461:
462: #define MAX_REGS_PER_ADDRESS 1
463:
464: /* 1 if X is an rtx for a constant that is a valid address. */
465:
466: #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
467:
468: /* Nonzero if the constant value X is a legitimate general operand.
469: It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
470:
471: /* For convex, any single-word constant is ok; the only contexts
472: allowing general_operand of mode DI or DF are movdi and movdf. */
473:
474: #define LEGITIMATE_CONSTANT_P(X) \
475: (GET_CODE (X) != CONST_DOUBLE ? 1 : (LD_D_P (X) || LD_L_P (X)))
476:
477: /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
478: and check its validity for a certain class.
479: We have two alternate definitions for each of them.
480: The usual definition accepts all pseudo regs; the other rejects
481: them unless they have been allocated suitable hard regs.
482: The symbol REG_OK_STRICT causes the latter definition to be used.
483:
484: Most source files want to accept pseudo regs in the hope that
485: they will get allocated to the class that the insn wants them to be in.
486: Source files for reload pass need to be strict.
487: After reload, it makes no difference, since pseudo regs have
488: been eliminated by then. */
489:
490: #ifndef REG_OK_STRICT
491:
492: /* Nonzero if X is a hard reg that can be used as an index
493: or if it is a pseudo reg. */
494: #define REG_OK_FOR_INDEX_P(X) (REGNO (X) >= 8)
495: /* Nonzero if X is a hard reg that can be used as a base reg
496: or if it is a pseudo reg. */
497: #define REG_OK_FOR_BASE_P(X) (REGNO (X) >= 8)
498:
499: #else
500:
501: /* Nonzero if X is a hard reg that can be used as an index. */
502: #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
503: /* Nonzero if X is a hard reg that can be used as a base reg. */
504: #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
505:
506: #endif
507:
508: /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
509: that is a valid memory address for an instruction.
510: The MODE argument is the machine mode for the MEM expression
511: that wants to use this address.
512:
513: For Convex, valid addresses are
514: indirectable or (MEM indirectable)
515: where indirectable is
516: const, reg, (PLUS reg const) */
517:
518: /* 1 if X is an address that we could indirect through. */
519: #define INDIRECTABLE_ADDRESS_P(X) \
520: (CONSTANT_ADDRESS_P (X) \
521: || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \
522: || (GET_CODE (X) == PLUS \
523: && GET_CODE (XEXP (X, 0)) == REG \
524: && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
525: && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
526: || (GET_CODE (X) == PLUS \
527: && GET_CODE (XEXP (X, 1)) == REG \
528: && REG_OK_FOR_BASE_P (XEXP (X, 1)) \
529: && CONSTANT_ADDRESS_P (XEXP (X, 0))))
530:
531: /* Go to ADDR if X is a valid address. */
532: #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
533: { register rtx xfoob = (X); \
534: if (GET_CODE (xfoob) == REG) goto ADDR; \
535: if (INDIRECTABLE_ADDRESS_P (xfoob)) goto ADDR; \
536: xfoob = XEXP (X, 0); \
537: if (GET_CODE (X) == MEM && INDIRECTABLE_ADDRESS_P (xfoob)) \
538: goto ADDR; \
539: if (GET_CODE (X) == PRE_DEC && REG_P (xfoob) \
540: && REGNO (xfoob) == STACK_POINTER_REGNUM) \
541: goto ADDR; }
542:
543: /* Try machine-dependent ways of modifying an illegitimate address
544: to be legitimate. If we find one, return the new, valid address.
545: This macro is used in only one place: `memory_address' in explow.c.
546:
547: OLDX is the address as it was before break_out_memory_refs was called.
548: In some cases it is useful to look at this to decide what needs to be done.
549:
550: MODE and WIN are passed so that this macro can use
551: GO_IF_LEGITIMATE_ADDRESS.
552:
553: It is always safe for this macro to do nothing. It exists to recognize
554: opportunities to optimize the output.
555:
556: For Convex, nothing needs to be done. */
557:
558: #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
559:
560: /* Go to LABEL if ADDR (a legitimate address expression)
561: has an effect that depends on the machine mode it is used for. */
562:
563: #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
564:
565: /* Specify the machine mode that this machine uses
566: for the index in the tablejump instruction. */
567: #define CASE_VECTOR_MODE SImode
568:
569: /* Define this if the case instruction expects the table
570: to contain offsets from the address of the table.
571: Do not define this if the table should contain absolute addresses. */
572: /* #define CASE_VECTOR_PC_RELATIVE */
573:
574: /* Define this if the case instruction drops through after the table
575: when the index is out of range. Don't define it if the case insn
576: jumps to the default label instead. */
577: /* #define CASE_DROPS_THROUGH */
578:
579: /* Specify the tree operation to be used to convert reals to integers. */
580: #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
581:
582: /* This is the kind of divide that is easiest to do in the general case. */
583: #define EASY_DIV_EXPR TRUNC_DIV_EXPR
584:
585: /* Define this as 1 if `char' should by default be signed; else as 0. */
586: #define DEFAULT_SIGNED_CHAR 1
587:
588: /* This flag, if defined, says the same insns that convert to a signed fixnum
589: also convert validly to an unsigned one. */
590: #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
591:
592: /* Max number of bytes we can move from memory to memory
593: in one reasonably fast instruction. */
594: #define MOVE_MAX 8
595:
596: /* Define this if zero-extension is slow (more than one real instruction). */
597: /* #define SLOW_ZERO_EXTEND */
598:
599: /* Nonzero if access to memory by bytes is slow and undesirable. */
600: #define SLOW_BYTE_ACCESS 0
601:
602: /* Define if shifts truncate the shift count
603: which implies one can omit a sign-extension or zero-extension
604: of a shift count. */
605: #define SHIFT_COUNT_TRUNCATED
606:
607: /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
608: is done just by pretending it is already truncated. */
609: #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
610:
611: /* On Convex, it is as good to call a constant function address as to
612: call an address kept in a register. */
613: #define NO_FUNCTION_CSE
614:
615: /* When a prototype says `char' or `short', really pass an `int'. */
616: #define PROMOTE_PROTOTYPES
617:
618: /* Specify the machine mode that pointers have.
619: After generation of rtl, the compiler makes no further distinction
620: between pointers and any other objects of this machine mode. */
621: #define Pmode SImode
622:
623: /* A function address in a call instruction
624: is a byte address (for indexing purposes)
625: so give the MEM rtx a byte's mode. */
626: #define FUNCTION_MODE QImode
627:
628: /* Compute the cost of computing a constant rtl expression RTX
629: whose rtx-code is CODE. The body of this macro is a portion
630: of a switch statement. If the code is computed here,
631: return it with a return statement. Otherwise, break from the switch. */
632:
633: #define CONST_COSTS(RTX,CODE) \
634: case CONST: \
635: case LABEL_REF: \
636: case SYMBOL_REF: \
637: case CONST_INT: \
638: return 0; \
639: case CONST_DOUBLE: \
640: return 2;
641:
642: /* Check a `double' value for validity for a particular machine mode. */
643:
644: #define CHECK_FLOAT_VALUE(mode, d) \
645: if ((mode) == SFmode) \
646: { \
647: if ((d) > 1.7014117331926443e+38) \
648: { error ("magnitude of constant too large for `float'"); \
649: (d) = 1.7014117331926443e+38; } \
650: else if ((d) < -1.7014117331926443e+38) \
651: { error ("magnitude of constant too large for `float'"); \
652: (d) = -1.7014117331926443e+38; } \
653: else if (((d) > 0) && ((d) < 2.9387358770557188e-39)) \
654: { warning ("`float' constant truncated to zero"); \
655: (d) = 0.0; } \
656: else if (((d) < 0) && ((d) > -2.9387358770557188e-39)) \
657: { warning ("`float' constant truncated to zero"); \
658: (d) = 0.0; } \
659: }
660:
661: /* Tell final.c how to eliminate redundant test instructions. */
662:
663: /* Here we define machine-dependent flags and fields in cc_status
664: (see `conditions.h'). No extra ones are needed for convex. */
665:
666: /* Store in cc_status the expressions
667: that the condition codes will describe
668: after execution of an instruction whose pattern is EXP.
669: Do not alter them if the instruction would not alter the cc's. */
670:
671: #define NOTICE_UPDATE_CC(EXP,INSN) {CC_STATUS_INIT;}
672:
673: /* Control the assembler format that we output. */
674:
675: /* Output at beginning of assembler file. */
676:
677: #define ASM_FILE_START(FILE) fprintf (FILE, ";NO_APP\n")
678:
679: /* Output to assembler file text saying following lines
680: may contain character constants, extra white space, comments, etc. */
681:
682: #define ASM_APP_ON ";APP\n"
683:
684: /* Output to assembler file text saying following lines
685: no longer contain unusual constructs. */
686:
687: #define ASM_APP_OFF ";NO_APP\n"
688:
689: /* Alignment with Convex's assembler goes like this:
690: .text will allow .align 1 or .align 2
691: .data allows 1,2,4,8 (at least; but those are all we need).
692: there is no .lcomm, must use explicit decls in .bss instead.
693: .text and .data have subsections, each starts on an 8-byte boundary.
694: So, since alignment is worth having,
695: use ".text <n>" for 2**<n>-byte aligned text section --
696: this assumes that all lengths are multiples of their alignment.
697: use .align in .text if possible, and it's always possible in .data.
698: gcc arranges that everything in .bss is a multiple of 8, so it
699: stays aligned.
700: This is all handled in two routines in output-convex.c. */
701:
702: extern char *set_section ();
703: extern char *align_section ();
704:
705: /* Output before read-only data. */
706:
707: #define TEXT_SECTION_ASM_OP set_section (".text")
708:
709: /* Output before writable data. */
710:
711: #define DATA_SECTION_ASM_OP set_section (".data")
712:
713: /* How to refer to registers in assembler output.
714: This sequence is indexed by compiler's hard-register-number (see above). */
715:
716: #define REGISTER_NAMES \
717: {"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
718: "sp", "a1", "a2", "a3", "a4", "a5", "ap", "fp"}
719:
720: /* This is BSD, so it wants DBX format. */
721:
722: #define DBX_DEBUGGING_INFO
723:
724: /* How to renumber registers for dbx and gdb. */
725:
726: #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
727:
728: /* Do not break .stabs pseudos into continuations. */
729:
730: #define DBX_CONTIN_LENGTH 0
731:
732: /* This is the char to use for continuation (in case we need to turn
733: continuation back on). */
734:
735: #define DBX_CONTIN_CHAR '?'
736:
737: /* Don't use the `xsfoo;' construct in DBX output; this system
738: doesn't support it. */
739:
740: #define DBX_NO_XREFS
741:
742: /* This is how to output the definition of a user-level label named NAME,
743: such as the label on a static function or variable NAME. */
744:
745: #define ASM_OUTPUT_LABEL(FILE,NAME) \
746: do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
747:
748: /* This is how to output a command to make the user-level label named NAME
749: defined for reference from other files. */
750:
751: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
752: do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
753:
754: /* This is how to output a reference to a user-level label named NAME. */
755:
756: #define ASM_OUTPUT_LABELREF(FILE,NAME) \
757: fprintf (FILE, "_%s", NAME)
758:
759: /* This is how to output an internal numbered label where
760: PREFIX is the class of label and NUM is the number within the class. */
761:
762: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
763: fprintf (FILE, "%s%d:\n", PREFIX, NUM)
764:
765: /* Put case tables in .text 2, where they will be word-aligned */
766:
767: #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
768: fprintf (FILE, ".text 2\n"); \
769: ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
770:
771: #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
772: fprintf (FILE, ".text\n");
773:
774: /* This is how to store into the string LABEL
775: the symbol_ref name of an internal numbered label where
776: PREFIX is the class of label and NUM is the number within the class.
777: This is suitable for output with `assemble_name'. */
778:
779: #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
780: sprintf (LABEL, "*%s%d", PREFIX, NUM)
781:
782: /* This is how to output an assembler line defining a `double' constant.
783: USE HEX until gcc is modified not to call this with DImode constants. */
784:
785: #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
786: fprintf (FILE, "\tds.l 0x%016llx\n", (VALUE))
787:
788: /* This is how to output an assembler line defining a `float' constant. */
789:
790: #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
791: fprintf (FILE, "\tds.s %.9#g\n", (VALUE))
792:
793: /* This is how to output an assembler line defining an `int' constant. */
794:
795: #define ASM_OUTPUT_INT(FILE,VALUE) \
796: ( fprintf (FILE, "\tds.w "), \
797: output_addr_const (FILE, (VALUE)), \
798: fprintf (FILE, "\n"))
799:
800: /* Likewise for `char' and `short' constants. */
801:
802: #define ASM_OUTPUT_SHORT(FILE,VALUE) \
803: ( fprintf (FILE, "\tds.h "), \
804: output_addr_const (FILE, (VALUE)), \
805: fprintf (FILE, "\n"))
806:
807: #define ASM_OUTPUT_CHAR(FILE,VALUE) \
808: ( fprintf (FILE, "\tds.b "), \
809: output_addr_const (FILE, (VALUE)), \
810: fprintf (FILE, "\n"))
811:
812: /* This is how to output an assembler line for a numeric constant byte. */
813:
814: #define ASM_OUTPUT_BYTE(FILE,VALUE) \
815: fprintf (FILE, "\tds.b %#x\n", (VALUE))
816:
817: /* This is how to output a string */
818:
819: #define ASM_OUTPUT_ASCII(FILE,STR,SIZE) do { \
820: int i; \
821: fprintf (FILE, "\tds.b \""); \
822: for (i = 0; i < (SIZE); i++) { \
823: register int c = (STR)[i] & 0377; \
824: if (c >= ' ' && c < 0177 && c != '\\' && c != '"') \
825: putc (c, FILE); \
826: else \
827: fprintf (FILE, "\\%03o", c);} \
828: fprintf (FILE, "\"\n");} while (0)
829:
830: /* This is how to output an insn to push a register on the stack.
831: It need not be very fast code. */
832:
833: #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
834: fprintf (FILE, "\tpsh.%c %s\n", \
835: S_REGNO_P (REGNO) ? 'l' : 'w', \
836: reg_names[REGNO])
837:
838: /* This is how to output an insn to pop a register from the stack.
839: It need not be very fast code. */
840:
841: #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
842: fprintf (FILE, "\tpop.%c %s\n", \
843: S_REGNO_P (REGNO) ? 'l' : 'w', \
844: reg_names[REGNO])
845:
846: /* This is how to output an element of a case-vector that is absolute. */
847:
848: #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
849: fprintf (FILE, "\tds.w L%d\n", VALUE)
850:
851: /* This is how to output an element of a case-vector that is relative.
852: (not used on Convex) */
853:
854: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
855: fprintf (FILE, "\tds.w L%d-L%d\n", VALUE, REL)
856:
857: /* This is how to output an assembler line
858: that says to advance the location counter
859: to a multiple of 2**LOG bytes. */
860:
861: #define ASM_OUTPUT_ALIGN(FILE,LOG) \
862: fprintf (FILE, align_section (LOG));
863:
864: /* This is how to output an assembler line
865: that says to advance the location counter by SIZE bytes. */
866:
867: #define ASM_OUTPUT_SKIP(FILE,SIZE) \
868: fprintf (FILE, "\tds.b %d(0)\n", (SIZE))
869:
870: /* This says how to output an assembler line
871: to define a global common symbol. */
872:
873: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
874: ( fputs (".comm ", (FILE)), \
875: assemble_name ((FILE), (NAME)), \
876: fprintf ((FILE), ",%d\n", (ROUNDED)))
877:
878: /* This says how to output an assembler line
879: to define a local common symbol. */
880:
881: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
882: ( fprintf ((FILE), "%s\n", set_section (".bss")), \
883: assemble_name ((FILE), (NAME)), \
884: fprintf ((FILE), ":\tbs.b %d\n", (ROUNDED)), \
885: fprintf ((FILE), "%s\n", set_section (0)))
886:
887: /* Store in OUTPUT a string (made with alloca) containing
888: an assembler-name for a local static variable named NAME.
889: LABELNO is an integer which is different for each call. */
890:
891: #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
892: ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
893: sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
894:
895: /* Define the parentheses used to group arithmetic operations
896: in assembler code. */
897:
898: #define ASM_OPEN_PAREN "("
899: #define ASM_CLOSE_PAREN ")"
900:
901: /* Define results of standard character escape sequences. */
902: #define TARGET_BELL 007
903: #define TARGET_BS 010
904: #define TARGET_TAB 011
905: #define TARGET_NEWLINE 012
906: #define TARGET_VT 013
907: #define TARGET_FF 014
908: #define TARGET_CR 015
909:
910: /* Print an instruction operand X on file FILE.
911: CODE is the code from the %-spec that requested printing this operand;
912: if `%z3' was used to print operand 3, then CODE is 'z'. */
913:
914: #define PRINT_OPERAND(FILE, X, CODE) \
915: { if (GET_CODE (X) == REG) \
916: fprintf (FILE, "%s", reg_name [REGNO (X)]); \
917: else if (GET_CODE (X) == MEM) \
918: output_address (XEXP (X, 0)); \
919: else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != DImode) \
920: { union { double d; int i[2]; } u; \
921: u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
922: fprintf (FILE, "#%.20#g", u.d); } \
923: else { putc ('#', FILE); output_addr_const (FILE, X); }}
924:
925: /* Print a memory operand whose address is X, on file FILE. */
926:
927: #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
928: { \
929: register rtx addr = ADDR; \
930: register rtx index = 0; \
931: register rtx offset = 0; \
932: \
933: if (GET_CODE (addr) == MEM) \
934: { \
935: fprintf (FILE, "@"); \
936: addr = XEXP (addr, 0); \
937: } \
938: \
939: switch (GET_CODE (addr)) \
940: { \
941: case REG: \
942: index = addr; \
943: break; \
944: \
945: case PLUS: \
946: index = XEXP (addr, 0); \
947: if (REG_P (index)) \
948: offset = XEXP (addr, 1); \
949: else \
950: { \
951: offset = XEXP (addr, 0); \
952: index = XEXP (addr, 1); \
953: if (! REG_P (index)) abort (); \
954: } \
955: break; \
956: \
957: default: \
958: offset = addr; \
959: break; \
960: } \
961: \
962: if (offset) \
963: output_addr_const (FILE, offset); \
964: \
965: if (index) \
966: fprintf (FILE, "(%s)", reg_name[REGNO (index)]); \
967: }
968:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.