]> gcc.gnu.org Git - gcc.git/blame - gcc/config/tahoe/tahoe.h
Added arg to RETURN_POPS_ARGS.
[gcc.git] / gcc / config / tahoe / tahoe.h
CommitLineData
5e3b9953 1/* Definitions of target machine for GNU compiler. Tahoe version.
8b109b37 2 Copyright (C) 1989, 1993, 1994, 1995 Free Software Foundation, Inc.
5e3b9953
RS
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20/*
5e3b9953
RS
21 * Original port made at the University of Buffalo by Devon Bowen,
22 * Dale Wiles and Kevin Zachmann.
23 *
24 * HCX/UX version by Piet van Oostrum (piet@cs.ruu.nl)
25 *
9e269f72 26 * Performance hacking by Michael Tiemann (tiemann@cygnus.com)
5e3b9953
RS
27 */
28
29/* define this for the HCX/UX version */
30
31/* #define HCX_UX */
32
33/*
34 * Run-time Target Specification
35 */
36
37#ifdef HCX_UX
38/* no predefines, see Makefile and hcx-universe.c */
39/* have cc1 print that this is the hcx version */
40#define TARGET_VERSION printf (" (hcx)");
41#else
42/* we want "tahoe" and "unix" defined for all future compilations */
65c42379 43#define CPP_PREDEFINES "-Dtahoe -Dunix -Asystem(unix) -Acpu(tahoe) -Amachine(tahoe)"
5e3b9953
RS
44/* have cc1 print that this is the tahoe version */
45#define TARGET_VERSION printf (" (tahoe)");
46#endif
47
48/* this is required in all tm files to hold flags */
49
50extern int target_flags;
51
52/* Zero if it is safe to output .dfloat and .float pseudos. */
53#define TARGET_HEX_FLOAT (target_flags & 1)
54
55#define TARGET_DEFAULT 1
56
57#define TARGET_SWITCHES \
58 { {"hex-float", 1}, \
59 {"no-hex-float", -1}, \
60 { "", TARGET_DEFAULT} }
61\f
62
63/*
64 * Storage Layout
65 */
66
67/* This symbol was previously not mentioned, so apparently the tahoe
68 is little-endian for bits, or else doesn't care. */
69#define BITS_BIG_ENDIAN 0
70
71/* tahoe uses a big endian byte order */
72
73#define BYTES_BIG_ENDIAN 1
74
75/* tahoe uses a big endian word order */
76
77#define WORDS_BIG_ENDIAN 1
78
79/* standard byte size is usable on tahoe */
80
81#define BITS_PER_UNIT 8
82
83/* longs on the tahoe are 4 byte groups */
84
85#define BITS_PER_WORD 32
86
87/* from the last two params we get 4 bytes per word */
88
89#define UNITS_PER_WORD 4
90
91/* addresses are 32 bits (one word) */
92
93#define POINTER_SIZE 32
94
95/* all parameters line up on 32 boundaries */
96
97#define PARM_BOUNDARY 32
98
99/* stack should line up on 32 boundaries */
100
101#define STACK_BOUNDARY 32
102
103/* line functions up on 32 bits */
104
105#define FUNCTION_BOUNDARY 32
106
107/* the biggest alignment the tahoe needs in 32 bits */
108
109#define BIGGEST_ALIGNMENT 32
110
111/* we have to align after an 'int : 0' in a structure */
112
113#define EMPTY_FIELD_BOUNDARY 32
114
115#ifdef HCX_UX
116/* structures must be made of full words */
117
118#define STRUCTURE_SIZE_BOUNDARY 32
119#else
120/* structures must be made of full bytes */
121
122#define STRUCTURE_SIZE_BOUNDARY 8
123#endif
124
125/* tahoe is picky about data alignment */
126
127#define STRICT_ALIGNMENT 1
128
129/* keep things standard with pcc */
130
131#define PCC_BITFIELD_TYPE_MATTERS 1
132
133/* this section is borrowed from the vax version since the */
134/* formats are the same in both of the architectures */
135
2e15b172
RK
136#define CHECK_FLOAT_VALUE(MODE, D, OVEFLOW) \
137 if (OVERFLOW) \
138 (D) = 1.7014117331926443e+38; \
139 else if ((MODE) == SFmode) \
140 { \
141 if ((D) > 1.7014117331926443e+38) \
142 (OVERFLOW) = 1, (D) = 1.7014117331926443e+38; \
143 else if ((D) < -1.7014117331926443e+38) \
144 (OVERFLOW) = 1, (D) = -1.7014117331926443e+38; \
145 else if (((D) > 0) && ((D) < 2.9387358770557188e-39)) \
146 (OVERFLOW) = 1, (D) = 0.0; \
147 else if (((D) < 0) && ((D) > -2.9387358770557188e-39)) \
148 (OVERFLOW) = 1, (D) = 0.0; \
5e3b9953
RS
149 }
150
151
152/*
153 * Register Usage
154 */
155
156/* define 15 general regs plus one for the floating point reg (FPP) */
157
158#define FIRST_PSEUDO_REGISTER 17
159
160/* let the compiler know what the fp, sp and pc are */
161
162#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0}
163
164/* lots of regs aren't guaranteed to return from a call. The FPP reg */
165/* must be included in these since it can't be saved by the reg mask */
166
167#define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
168
169/* A single fp reg can handle any type of float.
170 CPU regs hold just 32 bits. */
171
172#define HARD_REGNO_NREGS(REGNO, MODE) \
173 (REGNO != 16 ? ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) \
174 : GET_MODE_NUNITS ((MODE)))
175
176/* any mode greater than 4 bytes (doubles) can only go in an even regs */
177/* and the FPP can only hold SFmode and DFmode */
178
179#define HARD_REGNO_MODE_OK(REGNO, MODE) \
180 (REGNO != 16 \
181 ? (GET_MODE_UNIT_SIZE (MODE) <= 4 ? 1 : (REGNO % 2 - 1)) \
182 : ((MODE) == SFmode || (MODE) == DFmode \
183 || (MODE) == SCmode || (MODE) == DCmode))
184
185/* if mode1 or mode2, but not both, are doubles then modes cannot be tied */
186
187#define MODES_TIEABLE_P(MODE1, MODE2) \
188 (((MODE1) == DFmode || (MODE1) == DCmode) \
189 == ((MODE2) == DFmode || (MODE2) == DCmode))
190
191/* return nonzero if register variable of mode MODE is not
192 a priori a bad idea. Used only if defined. */
193#define MODE_OK_FOR_USERVAR(MODE) \
194 ((MODE) == SImode)
195
196/* the program counter is reg 15 */
197
198#define PC_REGNUM 15
199
200/* the stack pointer is reg 14 */
201
202#define STACK_POINTER_REGNUM 14
203
204/* the frame pointer is reg 13 */
205
206#define FRAME_POINTER_REGNUM 13
207
208/* tahoe does require an fp */
209
210#define FRAME_POINTER_REQUIRED 1
211
212/* since tahoe doesn't have a argument pointer, make it the fp */
213
214#define ARG_POINTER_REGNUM 13
215
216/* this isn't currently used since C doesn't support this feature */
217
218#define STATIC_CHAIN_REGNUM 0
219
220/* we'll use reg 1 for structure passing cause the destination */
221/* of the eventual movblk requires it to be there anyway. */
222
223#define STRUCT_VALUE_REGNUM 1
224
225
226/*
227 * Register Classes
228 */
229
230/* tahoe has two types of regs. GENERAL_REGS are all the regs up */
231/* to number 15. FPP_REG is the special floating point processor */
232/* register class (only one reg). */
233
234enum reg_class {NO_REGS,GENERAL_REGS,FPP_REG,ALL_REGS,LIM_REG_CLASSES};
235
236/* defines the number of reg classes. */
237
238#define N_REG_CLASSES (int) LIM_REG_CLASSES
239
240/* this defines what the classes are officially named for debugging */
241
242#define REG_CLASS_NAMES \
243 {"NO_REGS","GENERAL_REGS","FPP_REG","ALL_REGS"}
244
245/* set general regs to be the first 16 regs and the fpp reg to be 17th */
246
247#define REG_CLASS_CONTENTS {0,0xffff,0x10000,0x1ffff}
248
249/* register class for the fpp reg is FPP_REG, all others are GENERAL_REGS */
250
251#define REGNO_REG_CLASS(REGNO) (REGNO == 16 ? FPP_REG : GENERAL_REGS)
252
9b3b4b3e 253/* only general registers can be used as a base reg */
5e3b9953
RS
254
255#define BASE_REG_CLASS GENERAL_REGS
256
9b3b4b3e 257/* only general registers can be used to index */
5e3b9953
RS
258
259#define INDEX_REG_CLASS GENERAL_REGS
260
261/* 'a' as a constraint in the md file means the FFP_REG class */
262
263#define REG_CLASS_FROM_LETTER(C) (C == 'a' ? FPP_REG : NO_REGS)
264
265/* any general reg but the fpp can be a base reg */
266
267#define REGNO_OK_FOR_BASE_P(regno) \
268((regno) < FIRST_PSEUDO_REGISTER - 1 || reg_renumber[regno] >= 0)
269
270/* any general reg except the pc and fpp can be an index reg */
271
272#define REGNO_OK_FOR_INDEX_P(regno) \
273((regno) < FIRST_PSEUDO_REGISTER - 2 || reg_renumber[regno] >= 0)
274
275/* if your loading a floating point constant, it can't be done */
276/* through a register. Force it to be a memory constant. */
277
278#define PREFERRED_RELOAD_CLASS(X,CLASS) \
279 ((GET_CODE (X) == CONST_DOUBLE) ? NO_REGS : CLASS)
280
281/* for the fpp reg, all modes fit; for any others, you need two for doubles */
282
283#define CLASS_MAX_NREGS(CLASS, MODE) \
284 (CLASS != FPP_REG ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) : 1)
285
286/* we don't define any special constant sizes so all should fail */
287
288#define CONST_OK_FOR_LETTER_P(VALUE, C) 0
289
290/* we don't define any special double sizes so all should fail */
291
292#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
293
294
295/*
296 * Describing Stack Layout
297 */
298
299/* tahoe stack grows from high to low memory */
300
301#define STACK_GROWS_DOWNWARD
302
303/* Define this if longjmp restores from saved registers
304 rather than from what setjmp saved. */
305#define LONGJMP_RESTORE_FROM_STACK
306
307/* tahoe call frames grow from high to low memory on the stack */
308
309#define FRAME_GROWS_DOWNWARD
310
311/* the tahoe fp points to the *top* of the frame instead of the */
312/* bottom, so we have to make this offset a constant large enough */
313/* to jump over the biggest frame possible. */
314
315#define STARTING_FRAME_OFFSET -52
316
317/* tahoe always pushes 4 bytes unless it's a double in which case */
318/* it pushes a full 8 bytes. */
319
320#define PUSH_ROUNDING(BYTES) (BYTES <= 4 ? 4 : 8)
321
322/* the first parameter in a function is at the fp + 4 */
323
324#define FIRST_PARM_OFFSET(FNDECL) 4
325
326/* the tahoe return function takes care of everything on the stack */
327
8b109b37 328#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
5e3b9953
RS
329
330/* function values for all types are returned in register 0 */
331
332#define FUNCTION_VALUE(VALTYPE, FUNC) \
333 gen_rtx (REG, TYPE_MODE (VALTYPE), 0)
334
13d39dbc 335/* library routines also return things in reg 0 */
5e3b9953
RS
336
337#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)
338
339/* Tahoe doesn't return structures in a reentrant way */
340
341#define PCC_STATIC_STRUCT_RETURN
342
343/* we only return values from a function in reg 0 */
344
345#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
346
347/* we never pass args through a register */
348
349#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
350
351/* int is fine to hold the argument summary in FUNCTION_ARG */
352
353#define CUMULATIVE_ARGS int
354
355/* we just set CUM to 0 before the FUNCTION_ARG call. No matter what */
356/* we make it, FUNCTION_ARG will return 0 anyway */
357
358#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) \
359 ((CUM) = 0)
360
361/* all modes push their size rounded to the nearest word boundary */
362/* except block which is the size of the block rounded up */
363
364#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
365 ((CUM) += ((MODE) != BLKmode \
366 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
367 : (int_size_in_bytes (TYPE) + 3) & ~3))
368
369/* this is always false since we never pass params in regs */
370
371#define FUNCTION_ARG_REGNO_P(N) 0
372
373/* this code calculates the register entry mask and sets up */
374/* the stack pointer for the function. The stack is set down */
375/* far enough from the fp to jump over any push regs and local */
376/* vars. This is a problem since the tahoe has the fp pointing */
377/* to the top of the frame and the compiler must know the off- */
378/* set off the fp to the local vars. */
379
380#define FUNCTION_PROLOGUE(FILE, SIZE) \
381{ register int regno; \
382 register int mask = 0; \
383 extern char call_used_regs[]; \
384 for (regno = 0; regno < FIRST_PSEUDO_REGISTER-1; regno++) \
385 if (regs_ever_live[regno] && !call_used_regs[regno]) \
386 mask |= 1 << regno; \
387 fprintf (FILE, "\t.word 0x%x\n", mask); \
388 if (SIZE != 0) fprintf (FILE, "\tsubl3 $%d,fp,sp\n", (SIZE) - STARTING_FRAME_OFFSET); }
389
390/* Zero out global variable in case it was used in this function. */
391#define FUNCTION_EPILOGUE(FILE, SIZE) \
392{ extern rtx tahoe_reg_conversion_loc; \
393 tahoe_reg_conversion_loc = 0; \
394}
395
396#ifdef HCX_UX
397
398/* to call the profiler, the address of the counter var is placed */
399/* on the stack and then passed into mcount this way */
400
401#define FUNCTION_PROFILER(FILE, LABELNO) \
402 fprintf (FILE, "\tpushal LP%d\n\tcallf $8,mcount\n", (LABELNO));
403
404#else
405
406/* to call the profiler, push the variable value onto the stack */
407/* and call mcount like a regular function. */
408
409#define FUNCTION_PROFILER(FILE, LABELNO) \
410 fprintf (FILE, "\tpushl $LP%d\n\tcallf $8,mcount\n", (LABELNO));
411
412#endif
413
414/* all stack handling at the end of a function is handled by the */
415/* return command. */
416
417#define EXIT_IGNORE_STACK 1
418
419/*
420 * Library Subroutine Names
421 */
422
423/* udiv is a valid C library routine in libc.a, so we call that */
424
425#define UDIVSI3_LIBCALL "*udiv"
426
427/* urem is a valid C library routine in libc.a, so we call that */
428/* but not so on hcx/ux */
429
430#ifdef HCX_UX
431#undef UMODSI3_LIBCALL
432#else
433#define UMODSI3_LIBCALL "*urem"
434#endif
435
436
437/*
438 * Addressing Modes
439 */
440
441/* constant addresses can be treated exactly the same as normal constants */
442
6eff269e
BK
443#define CONSTANT_ADDRESS_P(X) \
444 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
445 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
446 || GET_CODE (X) == HIGH)
5e3b9953
RS
447
448/* we can have as many as two regs in any given address */
449
450#define MAX_REGS_PER_ADDRESS 2
451
452/* The following is all the code for GO_IF_LEGITIMATE_ADDRESS */
453/* most of this taken directly from the vax tm file since the */
454/* tahoe and vax addressing modes are nearly identical. */
455
456/* Is x an indirectable address? */
457
458#define INDIRECTABLE_ADDRESS_P(X) \
459 (CONSTANT_ADDRESS_P (X) \
460 || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \
461 || (GET_CODE (X) == PLUS \
462 && GET_CODE (XEXP (X, 0)) == REG \
463 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
464 && CONSTANT_ADDRESS_P (XEXP (X, 1))))
465
466/* If x is a non-indexed-address, go to ADDR. */
467
468#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \
469{ register rtx xfoob = (X); \
470 if (GET_CODE (xfoob) == REG) goto ADDR; \
471 if (INDIRECTABLE_ADDRESS_P (xfoob)) goto ADDR; \
472 xfoob = XEXP (X, 0); \
473 if (GET_CODE (X) == MEM && INDIRECTABLE_ADDRESS_P (xfoob)) \
474 goto ADDR; \
475 if ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \
476 && GET_CODE (xfoob) == REG && REGNO (xfoob) == 14) \
477 goto ADDR; }
478
479/* Is PROD an index term in mode MODE. */
480
481#define INDEX_TERM_P(PROD, MODE) \
482(GET_MODE_SIZE (MODE) == 1 \
483 ? (GET_CODE (PROD) == REG && REG_OK_FOR_BASE_P (PROD)) \
484 : (GET_CODE (PROD) == MULT \
485 && \
486 (xfoo0 = XEXP (PROD, 0), xfoo1 = XEXP (PROD, 1), \
487 ((GET_CODE (xfoo0) == CONST_INT \
488 && INTVAL (xfoo0) == GET_MODE_SIZE (MODE) \
489 && GET_CODE (xfoo1) == REG \
490 && REG_OK_FOR_INDEX_P (xfoo1)) \
491 || \
492 (GET_CODE (xfoo1) == CONST_INT \
493 && INTVAL (xfoo1) == GET_MODE_SIZE (MODE) \
494 && GET_CODE (xfoo0) == REG \
495 && REG_OK_FOR_INDEX_P (xfoo0))))))
496
497/* Is the addition to the index a reg? */
498
499#define GO_IF_REG_PLUS_INDEX(X, MODE, ADDR) \
500{ register rtx xfooa; \
501 if (GET_CODE (X) == PLUS) \
502 { if (GET_CODE (XEXP (X, 0)) == REG \
503 && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
504 && (xfooa = XEXP (X, 1), \
505 INDEX_TERM_P (xfooa, MODE))) \
506 goto ADDR; \
507 if (GET_CODE (XEXP (X, 1)) == REG \
508 && REG_OK_FOR_BASE_P (XEXP (X, 1)) \
509 && (xfooa = XEXP (X, 0), \
510 INDEX_TERM_P (xfooa, MODE))) \
511 goto ADDR; } }
512
9b3b4b3e 513/* Is the rtx X a valid memory address for operand of mode MODE? */
5e3b9953
RS
514/* If it is, go to ADDR */
515
516#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
517{ register rtx xfoo, xfoo0, xfoo1; \
518 GO_IF_NONINDEXED_ADDRESS (X, ADDR); \
519 if (GET_CODE (X) == PLUS) \
520 { xfoo = XEXP (X, 0); \
521 if (INDEX_TERM_P (xfoo, MODE)) \
522 { GO_IF_NONINDEXED_ADDRESS (XEXP (X, 1), ADDR); } \
523 xfoo = XEXP (X, 1); \
524 if (INDEX_TERM_P (xfoo, MODE)) \
525 { GO_IF_NONINDEXED_ADDRESS (XEXP (X, 0), ADDR); } \
526 if (CONSTANT_ADDRESS_P (XEXP (X, 0))) \
527 { if (GET_CODE (XEXP (X, 1)) == REG \
528 && REG_OK_FOR_BASE_P (XEXP (X, 1))) \
529 goto ADDR; \
530 GO_IF_REG_PLUS_INDEX (XEXP (X, 1), MODE, ADDR); } \
531 if (CONSTANT_ADDRESS_P (XEXP (X, 1))) \
532 { if (GET_CODE (XEXP (X, 0)) == REG \
533 && REG_OK_FOR_BASE_P (XEXP (X, 0))) \
534 goto ADDR; \
535 GO_IF_REG_PLUS_INDEX (XEXP (X, 0), MODE, ADDR); } } }
536
537/* Register 16 can never be used for index or base */
538
539#ifndef REG_OK_STRICT
540#define REG_OK_FOR_INDEX_P(X) (REGNO(X) != 16)
541#define REG_OK_FOR_BASE_P(X) (REGNO(X) != 16)
542#else
543#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
544#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
545#endif
546
547/* Addressing is too simple to allow optimizing here */
548
549#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}
550
551/* Post_inc and pre_dec always adds 4 */
552
553#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
554 { if (GET_CODE(ADDR) == POST_INC || GET_CODE(ADDR) == PRE_DEC) \
555 goto LABEL; \
556 if (GET_CODE (ADDR) == PLUS) \
557 { if (CONSTANT_ADDRESS_P (XEXP (ADDR, 0)) \
558 && GET_CODE (XEXP (ADDR, 1)) == REG); \
559 else if (CONSTANT_ADDRESS_P (XEXP (ADDR, 1)) \
560 && GET_CODE (XEXP (ADDR, 0)) == REG); \
561 else goto LABEL; }}
562
563/* Double's are not legitimate as immediate operands */
564
565#define LEGITIMATE_CONSTANT_P(X) \
566 (GET_CODE (X) != CONST_DOUBLE)
567
568
569/*
570 * Miscellaneous Parameters
571 */
572
573/* the elements in the case jump table are all words */
574
575#define CASE_VECTOR_MODE HImode
576
577/* each of the table elements in a case are relative to the jump address */
578
579#define CASE_VECTOR_PC_RELATIVE
580
581/* tahoe case instructions just fall through to the next instruction */
582/* if not satisfied. It doesn't support a default action */
583
584#define CASE_DROPS_THROUGH
585
586/* the standard answer is given here and work ok */
587
588#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
589
590/* in a general div case, it's easiest to use TRUNC_DIV_EXPR */
591
592#define EASY_DIV_EXPR TRUNC_DIV_EXPR
593
594/* the standard seems to be leaving char's as signed so we left it */
595/* this way even though we think they should be unsigned! */
596
597#define DEFAULT_SIGNED_CHAR 1
598
599/* the most we can move without cutting down speed is 4 bytes */
600
601#define MOVE_MAX 4
602
603/* our int is 32 bits */
604
605#define INT_TYPE_SIZE 32
606
607/* byte access isn't really slower than anything else */
608
609#define SLOW_BYTE_ACCESS 0
610
611/* zero extension is more than one instruction so try to avoid it */
612
613#define SLOW_ZERO_EXTEND
614
615/* any bits higher than the low 4 are ignored in the shift count */
616/* so don't bother zero extending or sign extending them */
617
d969caf8 618#define SHIFT_COUNT_TRUNCATED 1
5e3b9953
RS
619
620/* we don't need to officially convert from one fixed type to another */
621/* in order to use it as that type. We can just assume it's the same */
622
623#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
624
625/* pass chars as ints */
626
627#define PROMOTE_PROTOTYPES
628
629/* pointers can be represented by an si mode expression */
630
631#define Pmode SImode
632
633/* function addresses are made by specifying a byte address */
634
635#define FUNCTION_MODE QImode
636
637/* Define this if addresses of constant functions
638 shouldn't be put through pseudo regs where they can be cse'd.
639 On the tahoe a call with a constant address is much faster than one with a
640 register. */
641
642#define NO_FUNCTION_CSE
643
644/* specify the costs of various sorts of constants,
645 and also indicate that multiplication is cheap on this machine. */
646
3bb22aee 647#define CONST_COSTS(RTX,CODE,OUTER_CODE) \
5e3b9953
RS
648 case CONST_INT: \
649 /* Constant zero is super cheap due to clr instruction. */ \
650 if (RTX == const0_rtx) return 0; \
651 if ((unsigned) INTVAL (RTX) < 077) return 1; \
652 if (INTVAL (RTX) <= 127 && INTVAL (RTX) >= -128) return 2; \
653 case CONST: \
654 case LABEL_REF: \
655 case SYMBOL_REF: \
656 return 3; \
657 case CONST_DOUBLE: \
658 return 5; \
659 case MULT: \
660 total = 2;
661
662
663/*
664 * Condition Code Information
665 */
666
667/* Nonzero if the results of the previous comparison are
668 in the floating point condition code register. */
669
670#define CC_UNCHANGED 04000
671
672
673#define NOTICE_UPDATE_CC(EXP, INSN) \
674{ if (cc_status.flags & CC_UNCHANGED) \
675 /* Happens for cvtld and a few other insns. */ \
676 cc_status.flags &= ~CC_UNCHANGED; \
677 else if (GET_CODE (EXP) == SET) \
678 { if (GET_CODE (SET_SRC (EXP)) == CALL) \
679 CC_STATUS_INIT; \
680 else if (GET_CODE (SET_DEST (EXP)) != PC) \
681 { cc_status.flags = 0; \
682 cc_status.value1 = SET_DEST (EXP); \
683 cc_status.value2 = SET_SRC (EXP); } } \
684 else if (GET_CODE (EXP) == PARALLEL \
685 && GET_CODE (XVECEXP (EXP, 0, 0)) == SET \
686 && GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) != PC) \
687 { cc_status.flags = 0; \
688 cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0)); \
689 cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0)); } \
690 /* PARALLELs whose first element sets the PC are aob, sob insns. \
691 They do change the cc's. So drop through and forget the cc's. */ \
692 else CC_STATUS_INIT; \
693 if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \
694 && cc_status.value2 \
695 && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \
696 cc_status.value2 = 0; \
697 if (cc_status.value1 && GET_CODE (cc_status.value1) == MEM \
698 && cc_status.value2 \
699 && GET_CODE (cc_status.value2) == MEM) \
700 cc_status.value2 = 0; }
701/* Actual condition, one line up, should be that value2's address
702 depends on value1, but that is too much of a pain. */
703
704
705/*
706 * Output of Assembler Code
707 */
708
709/* print which tahoe version compiled this code and print a directive */
710/* to the gnu assembler to say that the following is normal assembly */
711
712#ifdef HCX_UX
713#define ASM_FILE_START(FILE) \
714{ fprintf (FILE, "#gcc hcx 1.0\n\n"); \
715 output_file_directive ((FILE), main_input_filename);} while (0)
716#else
717#define ASM_FILE_START(FILE) fprintf (FILE, "#gcc tahoe 1.0\n#NO_APP\n");
718#endif
719
720/* the instruction that turns on the APP for the gnu assembler */
721
722#define ASM_APP_ON "#APP\n"
723
724/* the instruction that turns off the APP for the gnu assembler */
725
726#define ASM_APP_OFF "#NO_APP\n"
727
728/* what to output before read-only data. */
729
730#define TEXT_SECTION_ASM_OP ".text"
731
732/* what to output before writable data. */
733
734#define DATA_SECTION_ASM_OP ".data"
735
736/* this is what we call each of the regs. notice that the FPP reg is */
737/* called "ac". This should never get used due to the way we've set */
738/* up FPP instructions in the md file. But we call it "ac" here to */
739/* fill the list. */
740
741#define REGISTER_NAMES \
742{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
743 "r9", "r10", "r11", "r12", "fp", "sp", "pc", "ac"}
744
745#ifdef HCX_UX
746/* allow generation of sdb info in the assembly */
747#define SDB_DEBUGGING_INFO
748#else
749/* allow generation of dbx info in the assembly */
750
751#define DBX_DEBUGGING_INFO
752
753/* our dbx doesn't support this */
754
755#define DBX_NO_XREFS
756
757/* we don't want symbols broken up */
758
759#define DBX_CONTIN_LENGTH 0
760
761/* this'll really never be used, but we'll leave it at this */
762
763#define DBX_CONTIN_CHAR '?'
764
765#endif /* HCX_UX */
766
767/* registers are called the same thing in dbx anything else */
768/* This is necessary even if we generate SDB output */
769
770#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
771
772/* labels are the label followed by a colon and a newline */
773/* must be a statement, so surround it in a null loop */
774
775#define ASM_OUTPUT_LABEL(FILE,NAME) \
776 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
777
778/* use the .globl directive to make labels global for the linker */
779
780#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
781 do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
782
783/* output a label by appending an underscore to it */
784
785#define ASM_OUTPUT_LABELREF(FILE,NAME) \
786 fprintf (FILE, "_%s", NAME)
787
788/* use the standard format for printing internal labels */
789
790#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
791 fprintf (FILE, "%s%d:\n", PREFIX, NUM)
792
793/* a * is used for label indirection in unix assembly */
794
795#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
796 sprintf (LABEL, "*%s%d", PREFIX, NUM)
797
798/* outputting a double is easy cause we only have one kind */
799
800#ifdef HCX_UX
801#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
802 fprintf (FILE, "\t.double 0d%.20e\n", (VALUE))
803#else
804#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
805{ \
806 union { int i[2]; double d;} temp; \
807 temp.d = (VALUE); \
808 if (TARGET_HEX_FLOAT) \
809 fprintf ((FILE), "\t.long 0x%x,0x%x # %.20e\n", \
810 temp.i[0], temp.i[1], temp.d); \
811 else \
812 fprintf (FILE, "\t.dfloat 0d%.20e\n", temp.d); \
813}
814#endif
815
816/* This is how to output an assembler line defining a `float' constant. */
817
818#ifdef HCX_UX
819#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
820 fprintf (FILE, "\t.float 0f%.20e\n", (VALUE))
821#else
822#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
823{ \
824 union { int i; float f;} temp; \
825 temp.f = (float) (VALUE); \
826 if (TARGET_HEX_FLOAT) \
827 fprintf ((FILE), "\t.long 0x%x # %.20e\n", \
828 temp.i, temp.f); \
829 else \
830 fprintf (FILE, "\t.float 0f%.20e\n", temp.f); \
831}
832#endif
833
834/* This is how to output an assembler line defining an `int' constant. */
835
836#define ASM_OUTPUT_INT(FILE,VALUE) \
837( fprintf (FILE, "\t.long "), \
838 output_addr_const (FILE, (VALUE)), \
839 fprintf (FILE, "\n"))
840
841/* Likewise for `char' and `short' constants. */
842
843#define ASM_OUTPUT_SHORT(FILE,VALUE) \
844( fprintf (FILE, "\t.word "), \
845 output_addr_const (FILE, (VALUE)), \
846 fprintf (FILE, "\n"))
847
848#define ASM_OUTPUT_CHAR(FILE,VALUE) \
849( fprintf (FILE, "\t.byte "), \
850 output_addr_const (FILE, (VALUE)), \
851 fprintf (FILE, "\n"))
852
853#ifdef HCX_UX
854/* This is how to output an assembler line for an ASCII string. */
855
856#define ASM_OUTPUT_ASCII(FILE, p, size) \
9e269f72 857do { register int i; \
5e3b9953
RS
858 fprintf ((FILE), "\t.ascii \""); \
859 for (i = 0; i < (size); i++) \
860 { \
861 register int c = (p)[i]; \
862 if (c == '\'' || c == '\\') \
863 putc ('\\', (FILE)); \
864 if (c >= ' ' && c < 0177 && c != '\"') \
865 putc (c, (FILE)); \
866 else \
867 { \
868 fprintf ((FILE), "\\%03o", c); \
869 } \
870 } \
9e269f72 871 fprintf ((FILE), "\"\n"); } while (0)
5e3b9953
RS
872#endif
873
874/* This is how to output an assembler line for a numeric constant byte. */
875
876#define ASM_OUTPUT_BYTE(FILE,VALUE) \
877 fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
878
879/* this is the insn to push a register onto the stack */
880
881#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
882 fprintf (FILE, "\tpushl %s\n", reg_names[REGNO])
883
884/* this is the insn to pop a register from the stack */
885
886#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
887 fprintf (FILE, "\tmovl (sp)+,%s\n", reg_names[REGNO])
888
889/* this is required even thought tahoe doesn't support it */
890/* cause the C code expects it to be defined */
891
892#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
893 fprintf (FILE, "\t.long L%d\n", VALUE)
894
895/* This is how to output an element of a case-vector that is relative. */
896
897#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
898 fprintf (FILE, "\t.word L%d-L%d\n", VALUE, REL)
899
900/* This is how to output an assembler line
901 that says to advance the location counter
902 to a multiple of 2**LOG bytes. */
903
904#ifdef HCX_UX
905#define CASE_ALIGNMENT 2
906#define ASM_OUTPUT_ALIGN(FILE,LOG) \
907 if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
908#else
909#define CASE_ALIGNMENT 1
910#define ASM_OUTPUT_ALIGN(FILE,LOG) \
911 LOG ? fprintf (FILE, "\t.align %d\n", (LOG)) : 0
912#endif
913
914/* This is how to skip over some space */
915
916#define ASM_OUTPUT_SKIP(FILE,SIZE) \
917 fprintf (FILE, "\t.space %u\n", (SIZE))
918
919/* This defines common variables across files */
920
921#ifdef HCX_UX
922#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
923( fputs (".comm ", (FILE)), \
924 assemble_name ((FILE), (NAME)), \
925 fprintf ((FILE), ",%u\n", (SIZE)))
926#else
927#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
928( fputs (".comm ", (FILE)), \
929 assemble_name ((FILE), (NAME)), \
930 fprintf ((FILE), ",%u\n", (ROUNDED)))
931#endif
932
933/* This says how to output an assembler line
934 to define a local common symbol. */
935
936#ifdef HCX_UX
937#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
938( fputs ("\t.bss ", (FILE)), \
939 assemble_name ((FILE), (NAME)), \
940 fprintf ((FILE), ",%u,4\n", (SIZE),(ROUNDED)))
941#else
942#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
943( fputs (".lcomm ", (FILE)), \
944 assemble_name ((FILE), (NAME)), \
945 fprintf ((FILE), ",%u\n", (ROUNDED)))
946#endif
947
948/* code to generate a label */
949
950#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
951( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
952 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
953
954/* Define the parentheses used to group arithmetic operations
955 in assembler code. */
956
957#define ASM_OPEN_PAREN "("
958#define ASM_CLOSE_PAREN ")"
959
960/* Define results of standard character escape sequences. */
961
962#define TARGET_BELL 007
963#define TARGET_BS 010
964#define TARGET_TAB 011
965#define TARGET_NEWLINE 012
966#define TARGET_VT 013
967#define TARGET_FF 014
968#define TARGET_CR 015
969
970/* Print an instruction operand X on file FILE.
971 CODE is the code from the %-spec that requested printing this operand;
972 if `%z3' was used to print operand 3, then CODE is 'z'.
973 On the Vax, the only code used is `#', indicating that either
974 `d' or `g' should be printed, depending on whether we're using dfloat
975 or gfloat. */
976/* Print an operand. Some difference from the vax code,
977 since the tahoe can't support immediate floats and doubles.
978
979 %@ means print the proper alignment operand for aligning after a casesi.
980 This depends on the assembler syntax.
981 This is 1 for our assembler, since .align is logarithmic.
982
983 %s means the number given is supposed to be a shift value, but on
984 the tahoe it should be converted to a number that can be used as a
985 multiplicative constant (cause multiplication is a whole lot faster
986 than shifting). So make the number 2^n instead. */
987
988#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
989 ((CODE) == '@')
990
991#define PRINT_OPERAND(FILE, X, CODE) \
992{ if (CODE == '@') \
993 putc ('0' + CASE_ALIGNMENT, FILE); \
994 else if (CODE == 's') \
995 fprintf (FILE, "$%d", 1 << INTVAL(X)); \
996 else if (GET_CODE (X) == REG) \
997 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
998 else if (GET_CODE (X) == MEM) \
999 output_address (XEXP (X, 0)); \
1000 else { putc ('$', FILE); output_addr_const (FILE, X); }}
1001
1002/* When the operand is an address, call print_operand_address to */
1003/* do the work from output-tahoe.c. */
1004
1005#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1006 print_operand_address (FILE, ADDR)
1007
1008/* This is for G++ */
1009
1010#define CRT0_DUMMIES
1011#define DOT_GLOBAL_START
1012#ifdef HCX_UX
1013#define NO_GNU_LD /* because of COFF format */
1014#define LINK_SPEC "-L/usr/staff/lib"
1015#endif
This page took 0.326338 seconds and 5 git commands to generate.