* config/pdp11/pdp11-protos.h (pdp11_cannot_change_mode_class,
[official-gcc.git] / gcc / config / pdp11 / pdp11.h
blob08b9d675cdea0af18ca54f7b1d147de054b0de0d
1 /* Definitions of target machine for GNU compiler, for the pdp-11
2 Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
3 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
4 Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #define CONSTANT_POOL_BEFORE_FUNCTION 0
24 /* check whether load_fpu_reg or not */
25 #define LOAD_FPU_REG_P(x) ((x) >= AC0_REGNUM && (x) <= AC3_REGNUM)
26 #define NO_LOAD_FPU_REG_P(x) ((x) == AC4_REGNUM || (x) == AC5_REGNUM)
27 #define FPU_REG_P(x) (LOAD_FPU_REG_P(x) || NO_LOAD_FPU_REG_P(x))
28 #define CPU_REG_P(x) ((x) <= PC_REGNUM)
30 /* Names to predefine in the preprocessor for this target machine. */
32 #define TARGET_CPU_CPP_BUILTINS() \
33 do \
34 { \
35 builtin_define_std ("pdp11"); \
36 } \
37 while (0)
39 /* Print subsidiary information on the compiler version in use. */
40 #define TARGET_VERSION fprintf (stderr, " (pdp11)");
43 /* Generate DBX debugging information. */
45 #define DBX_DEBUGGING_INFO
47 #define TARGET_40_PLUS (TARGET_40 || TARGET_45)
48 #define TARGET_10 (! TARGET_40_PLUS)
50 #define TARGET_UNIX_ASM_DEFAULT 0
52 #define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0)
56 /* TYPE SIZES */
57 #define SHORT_TYPE_SIZE 16
58 #define INT_TYPE_SIZE (TARGET_INT16 ? 16 : 32)
59 #define LONG_TYPE_SIZE 32
60 #define LONG_LONG_TYPE_SIZE 64
62 /* if we set FLOAT_TYPE_SIZE to 32, we could have the benefit
63 of saving core for huge arrays - the definitions are
64 already in md - but floats can never reside in
65 an FPU register - we keep the FPU in double float mode
66 all the time !! */
67 #define FLOAT_TYPE_SIZE (TARGET_FLOAT32 ? 32 : 64)
68 #define DOUBLE_TYPE_SIZE 64
69 #define LONG_DOUBLE_TYPE_SIZE 64
71 /* machine types from ansi */
72 #define SIZE_TYPE "unsigned int" /* definition of size_t */
73 #define WCHAR_TYPE "int" /* or long int???? */
74 #define WCHAR_TYPE_SIZE 16
76 #define PTRDIFF_TYPE "int"
78 /* target machine storage layout */
80 /* Define this if most significant bit is lowest numbered
81 in instructions that operate on numbered bit-fields. */
82 #define BITS_BIG_ENDIAN 0
84 /* Define this if most significant byte of a word is the lowest numbered. */
85 #define BYTES_BIG_ENDIAN 0
87 /* Define this if most significant word of a multiword number is first. */
88 #define WORDS_BIG_ENDIAN 1
90 /* Define that floats are in VAX order, not high word first as for ints. */
91 #define FLOAT_WORDS_BIG_ENDIAN 0
93 /* Width of a word, in units (bytes).
95 UNITS OR BYTES - seems like units */
96 #define UNITS_PER_WORD 2
98 /* This machine doesn't use IEEE floats. */
99 /* Because the pdp11 (at least Unix) convention for 32-bit ints is
100 big endian, opposite for what you need for float, the vax float
101 conversion routines aren't actually used directly. But the underlying
102 format is indeed the vax/pdp11 float format. */
103 extern const struct real_format pdp11_f_format;
104 extern const struct real_format pdp11_d_format;
106 /* Maximum sized of reasonable data type
107 DImode or Dfmode ...*/
108 #define MAX_FIXED_MODE_SIZE 64
110 /* Allocation boundary (in *bits*) for storing pointers in memory. */
111 #define POINTER_BOUNDARY 16
113 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
114 #define PARM_BOUNDARY 16
116 /* Boundary (in *bits*) on which stack pointer should be aligned. */
117 #define STACK_BOUNDARY 16
119 /* Allocation boundary (in *bits*) for the code of a function. */
120 #define FUNCTION_BOUNDARY 16
122 /* Alignment of field after `int : 0' in a structure. */
123 #define EMPTY_FIELD_BOUNDARY 16
125 /* No data type wants to be aligned rounder than this. */
126 #define BIGGEST_ALIGNMENT 16
128 /* Define this if move instructions will actually fail to work
129 when given unaligned data. */
130 #define STRICT_ALIGNMENT 1
132 /* Standard register usage. */
134 /* Number of actual hardware registers.
135 The hardware registers are assigned numbers for the compiler
136 from 0 to just below FIRST_PSEUDO_REGISTER.
137 All registers that the compiler knows about must be given numbers,
138 even those that are not normally considered general registers.
140 we have 8 integer registers, plus 6 float
141 (don't use scratch float !) */
143 /* 1 for registers that have pervasive standard uses
144 and are not available for the register allocator.
146 On the pdp, these are:
147 Reg 7 = pc;
148 reg 6 = sp;
149 reg 5 = fp; not necessarily!
152 /* don't let them touch fp regs for the time being !*/
154 #define FIXED_REGISTERS \
155 {0, 0, 0, 0, 0, 0, 1, 1, \
156 0, 0, 0, 0, 0, 0 }
160 /* 1 for registers not available across function calls.
161 These must include the FIXED_REGISTERS and also any
162 registers that can be used without being saved.
163 The latter must include the registers where values are returned
164 and the register where structure-value addresses are passed.
165 Aside from that, you can include as many other registers as you like. */
167 /* don't know about fp */
168 #define CALL_USED_REGISTERS \
169 {1, 1, 0, 0, 0, 0, 1, 1, \
170 0, 0, 0, 0, 0, 0 }
173 /* Make sure everything's fine if we *don't* have an FPU.
174 This assumes that putting a register in fixed_regs will keep the
175 compiler's mitts completely off it. We don't bother to zero it out
176 of register classes. Also fix incompatible register naming with
177 the UNIX assembler.
179 #define CONDITIONAL_REGISTER_USAGE \
181 int i; \
182 HARD_REG_SET x; \
183 if (!TARGET_FPU) \
185 COPY_HARD_REG_SET (x, reg_class_contents[(int)FPU_REGS]); \
186 for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \
187 if (TEST_HARD_REG_BIT (x, i)) \
188 fixed_regs[i] = call_used_regs[i] = 1; \
191 if (TARGET_AC0) \
192 call_used_regs[AC0_REGNUM] = 1; \
193 if (TARGET_UNIX_ASM) \
195 /* Change names of FPU registers for the UNIX assembler. */ \
196 reg_names[8] = "fr0"; \
197 reg_names[9] = "fr1"; \
198 reg_names[10] = "fr2"; \
199 reg_names[11] = "fr3"; \
200 reg_names[12] = "fr4"; \
201 reg_names[13] = "fr5"; \
205 /* Return number of consecutive hard regs needed starting at reg REGNO
206 to hold something of mode MODE.
207 This is ordinarily the length in words of a value of mode MODE
208 but can be less for certain modes in special long registers.
211 #define HARD_REGNO_NREGS(REGNO, MODE) \
212 ((REGNO <= PC_REGNUM)? \
213 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \
217 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
218 On the pdp, the cpu registers can hold any mode other than float
219 (because otherwise we may end up being asked to move from CPU to FPU
220 register, which isn't a valid operation on the PDP11).
221 For CPU registers, check alignment.
223 FPU accepts SF and DF but actually holds a DF - simplifies life!
225 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
226 (((REGNO) <= PC_REGNUM)? \
227 ((GET_MODE_BITSIZE(MODE) <= 16) \
228 || (GET_MODE_BITSIZE(MODE) >= 32 && \
229 !((REGNO) & 1) && !FLOAT_MODE_P (MODE))) \
230 :FLOAT_MODE_P (MODE))
233 /* Value is 1 if it is a good idea to tie two pseudo registers
234 when one has mode MODE1 and one has mode MODE2.
235 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
236 for any hard reg, then this must be 0 for correct output. */
237 #define MODES_TIEABLE_P(MODE1, MODE2) 0
239 /* Specify the registers used for certain standard purposes.
240 The values of these macros are register numbers. */
242 /* Base register for access to arguments of the function. */
243 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
245 /* Register in which static-chain is passed to a function. */
246 /* ??? - i don't want to give up a reg for this! */
247 #define STATIC_CHAIN_REGNUM 4
249 /* Define the classes of registers for register constraints in the
250 machine description. Also define ranges of constants.
252 One of the classes must always be named ALL_REGS and include all hard regs.
253 If there is more than one class, another class must be named NO_REGS
254 and contain no registers.
256 The name GENERAL_REGS must be the name of a class (or an alias for
257 another name such as ALL_REGS). This is the class of registers
258 that is allowed by "g" or "r" in a register constraint.
259 Also, registers outside this class are allocated only when
260 instructions express preferences for them.
262 The classes must be numbered in nondecreasing order; that is,
263 a larger-numbered class must never be contained completely
264 in a smaller-numbered class.
266 For any two classes, it is very desirable that there be another
267 class that represents their union. */
269 /* The pdp has a couple of classes:
271 MUL_REGS are used for odd numbered regs, to use in 16-bit multiplication
272 (even numbered do 32-bit multiply)
273 LMUL_REGS long multiply registers (even numbered regs )
274 (don't need them, all 32-bit regs are even numbered!)
275 GENERAL_REGS is all cpu
276 LOAD_FPU_REGS is the first four cpu regs, they are easier to load
277 NO_LOAD_FPU_REGS is ac4 and ac5, currently - difficult to load them
278 FPU_REGS is all fpu regs
281 enum reg_class { NO_REGS, MUL_REGS, GENERAL_REGS, LOAD_FPU_REGS, NO_LOAD_FPU_REGS, FPU_REGS, ALL_REGS, LIM_REG_CLASSES };
283 #define N_REG_CLASSES (int) LIM_REG_CLASSES
285 /* have to allow this till cmpsi/tstsi are fixed in a better way !! */
286 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
288 /* Since GENERAL_REGS is the same class as ALL_REGS,
289 don't give it a different class number; just make it an alias. */
291 /* #define GENERAL_REGS ALL_REGS */
293 /* Give names of register classes as strings for dump file. */
295 #define REG_CLASS_NAMES {"NO_REGS", "MUL_REGS", "GENERAL_REGS", "LOAD_FPU_REGS", "NO_LOAD_FPU_REGS", "FPU_REGS", "ALL_REGS" }
297 /* Define which registers fit in which classes.
298 This is an initializer for a vector of HARD_REG_SET
299 of length N_REG_CLASSES. */
301 #define REG_CLASS_CONTENTS {{0}, {0x00aa}, {0x00ff}, {0x0f00}, {0x3000}, {0x3f00}, {0x3fff}}
303 /* The same information, inverted:
304 Return the class number of the smallest class containing
305 reg number REGNO. This could be a conditional expression
306 or could index an array. */
308 #define REGNO_REG_CLASS(REGNO) \
309 ((REGNO) >= AC0_REGNUM ? \
310 ((REGNO) <= AC3_REGNUM ? LOAD_FPU_REGS : \
311 NO_LOAD_FPU_REGS) : \
312 (((REGNO) & 1) ? MUL_REGS : GENERAL_REGS))
315 /* The class value for index registers, and the one for base regs. */
316 #define INDEX_REG_CLASS GENERAL_REGS
317 #define BASE_REG_CLASS GENERAL_REGS
319 /* The following macro defines cover classes for Integrated Register
320 Allocator. Cover classes is a set of non-intersected register
321 classes covering all hard registers used for register allocation
322 purpose. Any move between two registers of a cover class should be
323 cheaper than load or store of the registers. The macro value is
324 array of register classes with LIM_REG_CLASSES used as the end
325 marker. */
327 #define IRA_COVER_CLASSES { GENERAL_REGS, FPU_REGS, LIM_REG_CLASSES }
329 /* Hook for testing if memory is needed for moving between registers. */
330 #define SECONDARY_MEMORY_NEEDED(class1, class2, m) \
331 pdp11_secondary_memory_needed (class1, class2, m)
333 /* Return the maximum number of consecutive registers
334 needed to represent mode MODE in a register of class CLASS. */
335 #define CLASS_MAX_NREGS(CLASS, MODE) \
336 ((CLASS == GENERAL_REGS || CLASS == MUL_REGS)? \
337 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD): \
341 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
342 pdp11_cannot_change_mode_class (FROM, TO, CLASS)
344 /* Stack layout; function entry, exit and calling. */
346 /* Define this if pushing a word on the stack
347 makes the stack pointer a smaller address. */
348 #define STACK_GROWS_DOWNWARD
350 /* Define this to nonzero if the nominal address of the stack frame
351 is at the high-address end of the local variables;
352 that is, each additional local variable allocated
353 goes at a more negative offset in the frame.
355 #define FRAME_GROWS_DOWNWARD 1
357 /* Offset within stack frame to start allocating local variables at.
358 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
359 first local allocated. Otherwise, it is the offset to the BEGINNING
360 of the first local allocated. */
361 #define STARTING_FRAME_OFFSET 0
363 /* If we generate an insn to push BYTES bytes,
364 this says how many the stack pointer really advances by.
365 On the pdp11, the stack is on an even boundary */
366 #define PUSH_ROUNDING(BYTES) ((BYTES + 1) & ~1)
368 /* current_first_parm_offset stores the # of registers pushed on the
369 stack */
370 extern int current_first_parm_offset;
372 /* Offset of first parameter from the argument pointer register value.
373 For the pdp11, this is nonzero to account for the return address.
374 1 - return address
375 2 - frame pointer (always saved, even when not used!!!!)
376 -- change some day !!!:q!
379 #define FIRST_PARM_OFFSET(FNDECL) 4
381 /* Define how to find the value returned by a function.
382 VALTYPE is the data type of the value (as a tree).
383 If the precise function being called is known, FUNC is its FUNCTION_DECL;
384 otherwise, FUNC is 0. */
385 #define BASE_RETURN_VALUE_REG(MODE) \
386 (FLOAT_MODE_P (MODE) ? AC0_REGNUM : RETVAL_REGNUM)
388 /* 1 if N is a possible register number for function argument passing.
389 - not used on pdp */
391 #define FUNCTION_ARG_REGNO_P(N) 0
393 /* Define a data type for recording info about an argument list
394 during the scan of that argument list. This data type should
395 hold all necessary information about the function itself
396 and about the args processed so far, enough to enable macros
397 such as FUNCTION_ARG to determine where the next arg should go.
401 #define CUMULATIVE_ARGS int
403 /* Initialize a variable CUM of type CUMULATIVE_ARGS
404 for a call to a function whose data type is FNTYPE.
405 For a library call, FNTYPE is 0.
407 ...., the offset normally starts at 0, but starts at 1 word
408 when the function gets a structure-value-address as an
409 invisible first argument. */
411 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
412 ((CUM) = 0)
414 /* Output assembler code to FILE to increment profiler label # LABELNO
415 for profiling a function entry. */
417 #define FUNCTION_PROFILER(FILE, LABELNO) \
418 gcc_unreachable ();
420 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
421 the stack pointer does not matter. The value is tested only in
422 functions that have frame pointers.
423 No definition is equivalent to always zero. */
425 extern int may_call_alloca;
427 #define EXIT_IGNORE_STACK 1
429 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \
431 int offset, regno; \
432 offset = get_frame_size(); \
433 for (regno = 0; regno <= PC_REGNUM; regno++) \
434 if (df_regs_ever_live_p (regno) && ! call_used_regs[regno]) \
435 offset += 2; \
436 for (regno = AC0_REGNUM; regno <= AC5_REGNUM; regno++) \
437 if (df_regs_ever_live_p (regno) && ! call_used_regs[regno]) \
438 offset += 8; \
439 /* offset -= 2; no fp on stack frame */ \
440 (DEPTH_VAR) = offset; \
444 /* Addressing modes, and classification of registers for them. */
446 #define HAVE_POST_INCREMENT 1
448 #define HAVE_PRE_DECREMENT 1
450 /* Macros to check register numbers against specific register classes. */
452 /* These assume that REGNO is a hard or pseudo reg number.
453 They give nonzero only if REGNO is a hard reg of the suitable class
454 or a pseudo reg currently allocated to a suitable hard reg.
455 Since they use reg_renumber, they are safe only once reg_renumber
456 has been allocated, which happens in local-alloc.c. */
458 #define REGNO_OK_FOR_INDEX_P(REGNO) \
459 ((REGNO) <= PC_REGNUM || (unsigned) reg_renumber[REGNO] <= PC_REGNUM)
460 #define REGNO_OK_FOR_BASE_P(REGNO) \
461 ((REGNO) <= PC_REGNUM || (unsigned) reg_renumber[REGNO] <= PC_REGNUM)
463 /* Now macros that check whether X is a register and also,
464 strictly, whether it is in a specified class.
469 /* Maximum number of registers that can appear in a valid memory address. */
471 #define MAX_REGS_PER_ADDRESS 1
473 /* Nonzero if the constant value X is a legitimate general operand.
474 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
476 #define LEGITIMATE_CONSTANT_P(X) \
477 (GET_CODE (X) != CONST_DOUBLE || legitimate_const_double_p (X))
479 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
480 and check its validity for a certain class.
481 We have two alternate definitions for each of them.
482 The usual definition accepts all pseudo regs; the other rejects
483 them unless they have been allocated suitable hard regs.
484 The symbol REG_OK_STRICT causes the latter definition to be used.
486 Most source files want to accept pseudo regs in the hope that
487 they will get allocated to the class that the insn wants them to be in.
488 Source files for reload pass need to be strict.
489 After reload, it makes no difference, since pseudo regs have
490 been eliminated by then. */
492 #ifndef REG_OK_STRICT
494 /* Nonzero if X is a hard reg that can be used as an index
495 or if it is a pseudo reg. */
496 #define REG_OK_FOR_INDEX_P(X) (1)
497 /* Nonzero if X is a hard reg that can be used as a base reg
498 or if it is a pseudo reg. */
499 #define REG_OK_FOR_BASE_P(X) (1)
501 #else
503 /* Nonzero if X is a hard reg that can be used as an index. */
504 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
505 /* Nonzero if X is a hard reg that can be used as a base reg. */
506 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
508 #endif
510 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
511 that is a valid memory address for an instruction.
512 The MODE argument is the machine mode for the MEM expression
513 that wants to use this address.
517 #define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
519 rtx xfoob; \
521 /* accept (R0) */ \
522 if (GET_CODE (operand) == REG \
523 && REG_OK_FOR_BASE_P(operand)) \
524 goto ADDR; \
526 /* accept @#address */ \
527 if (CONSTANT_ADDRESS_P (operand)) \
528 goto ADDR; \
530 /* accept X(R0) */ \
531 if (GET_CODE (operand) == PLUS \
532 && GET_CODE (XEXP (operand, 0)) == REG \
533 && REG_OK_FOR_BASE_P (XEXP (operand, 0)) \
534 && CONSTANT_ADDRESS_P (XEXP (operand, 1))) \
535 goto ADDR; \
537 /* accept -(R0) */ \
538 if (GET_CODE (operand) == PRE_DEC \
539 && GET_CODE (XEXP (operand, 0)) == REG \
540 && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \
541 goto ADDR; \
543 /* accept (R0)+ */ \
544 if (GET_CODE (operand) == POST_INC \
545 && GET_CODE (XEXP (operand, 0)) == REG \
546 && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \
547 goto ADDR; \
549 /* accept -(SP) -- which uses PRE_MODIFY for byte mode */ \
550 if (GET_CODE (operand) == PRE_MODIFY \
551 && GET_CODE (XEXP (operand, 0)) == REG \
552 && REGNO (XEXP (operand, 0)) == STACK_POINTER_REGNUM \
553 && GET_CODE ((xfoob = XEXP (operand, 1))) == PLUS \
554 && GET_CODE (XEXP (xfoob, 0)) == REG \
555 && REGNO (XEXP (xfoob, 0)) == STACK_POINTER_REGNUM \
556 && CONSTANT_P (XEXP (xfoob, 1)) \
557 && INTVAL (XEXP (xfoob,1)) == -2) \
558 goto ADDR; \
560 /* accept (SP)+ -- which uses POST_MODIFY for byte mode */ \
561 if (GET_CODE (operand) == POST_MODIFY \
562 && GET_CODE (XEXP (operand, 0)) == REG \
563 && REGNO (XEXP (operand, 0)) == STACK_POINTER_REGNUM \
564 && GET_CODE ((xfoob = XEXP (operand, 1))) == PLUS \
565 && GET_CODE (XEXP (xfoob, 0)) == REG \
566 && REGNO (XEXP (xfoob, 0)) == STACK_POINTER_REGNUM \
567 && CONSTANT_P (XEXP (xfoob, 1)) \
568 && INTVAL (XEXP (xfoob,1)) == 2) \
569 goto ADDR; \
572 /* handle another level of indirection ! */ \
573 if (GET_CODE(operand) != MEM) \
574 goto fail; \
576 xfoob = XEXP (operand, 0); \
578 /* (MEM:xx (MEM:xx ())) is not valid for SI, DI and currently */ \
579 /* also forbidden for float, because we have to handle this */ \
580 /* in output_move_double and/or output_move_quad() - we could */ \
581 /* do it, but currently it's not worth it!!! */ \
582 /* now that DFmode cannot go into CPU register file, */ \
583 /* maybe I should allow float ... */ \
584 /* but then I have to handle memory-to-memory moves in movdf ?? */ \
586 if (GET_MODE_BITSIZE(mode) > 16) \
587 goto fail; \
589 /* accept @(R0) - which is @0(R0) */ \
590 if (GET_CODE (xfoob) == REG \
591 && REG_OK_FOR_BASE_P(xfoob)) \
592 goto ADDR; \
594 /* accept @address */ \
595 if (CONSTANT_ADDRESS_P (xfoob)) \
596 goto ADDR; \
598 /* accept @X(R0) */ \
599 if (GET_CODE (xfoob) == PLUS \
600 && GET_CODE (XEXP (xfoob, 0)) == REG \
601 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0)) \
602 && CONSTANT_ADDRESS_P (XEXP (xfoob, 1))) \
603 goto ADDR; \
605 /* accept @-(R0) */ \
606 if (GET_CODE (xfoob) == PRE_DEC \
607 && GET_CODE (XEXP (xfoob, 0)) == REG \
608 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \
609 goto ADDR; \
611 /* accept @(R0)+ */ \
612 if (GET_CODE (xfoob) == POST_INC \
613 && GET_CODE (XEXP (xfoob, 0)) == REG \
614 && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \
615 goto ADDR; \
617 /* anything else is invalid */ \
618 fail: ; \
622 /* Specify the machine mode that this machine uses
623 for the index in the tablejump instruction. */
624 #define CASE_VECTOR_MODE HImode
626 /* Define this if a raw index is all that is needed for a
627 `tablejump' insn. */
628 #define CASE_TAKES_INDEX_RAW
630 /* Define this as 1 if `char' should by default be signed; else as 0. */
631 #define DEFAULT_SIGNED_CHAR 1
633 /* Max number of bytes we can move from memory to memory
634 in one reasonably fast instruction.
637 #define MOVE_MAX 2
639 /* Nonzero if access to memory by byte is slow and undesirable. -
641 #define SLOW_BYTE_ACCESS 0
643 /* Do not break .stabs pseudos into continuations. */
644 #define DBX_CONTIN_LENGTH 0
646 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
647 is done just by pretending it is already truncated. */
648 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
650 /* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE,
651 return the mode to be used for the comparison. For floating-point, CCFPmode
652 should be used. */
654 #define SELECT_CC_MODE(OP,X,Y) \
655 (GET_MODE_CLASS(GET_MODE(X)) == MODE_FLOAT? CCFPmode : CCmode)
657 /* Specify the machine mode that pointers have.
658 After generation of rtl, the compiler makes no further distinction
659 between pointers and any other objects of this machine mode. */
660 #define Pmode HImode
662 /* A function address in a call instruction
663 is a word address (for indexing purposes)
664 so give the MEM rtx a word's mode. */
665 #define FUNCTION_MODE HImode
667 /* Define this if addresses of constant functions
668 shouldn't be put through pseudo regs where they can be cse'd.
669 Desirable on machines where ordinary constants are expensive
670 but a CALL with constant address is cheap. */
671 /* #define NO_FUNCTION_CSE */
674 /* Tell emit-rtl.c how to initialize special values on a per-function base. */
675 extern struct rtx_def *cc0_reg_rtx;
677 #define CC_STATUS_MDEP rtx
679 #define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)
681 /* Tell final.c how to eliminate redundant test instructions. */
683 /* Here we define machine-dependent flags and fields in cc_status
684 (see `conditions.h'). */
686 #define CC_IN_FPU 04000
688 /* Do UPDATE_CC if EXP is a set, used in
689 NOTICE_UPDATE_CC
691 floats only do compare correctly, else nullify ...
693 get cc0 out soon ...
696 /* Store in cc_status the expressions
697 that the condition codes will describe
698 after execution of an instruction whose pattern is EXP.
699 Do not alter them if the instruction would not alter the cc's. */
701 #define NOTICE_UPDATE_CC(EXP, INSN) \
702 { if (GET_CODE (EXP) == SET) \
704 notice_update_cc_on_set(EXP, INSN); \
706 else if (GET_CODE (EXP) == PARALLEL \
707 && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \
709 notice_update_cc_on_set(XVECEXP (EXP, 0, 0), INSN); \
711 else if (GET_CODE (EXP) == CALL) \
712 { /* all bets are off */ CC_STATUS_INIT; } \
713 if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \
714 && cc_status.value2 \
715 && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \
717 printf ("here!\n"); \
718 cc_status.value2 = 0; \
722 /* Control the assembler format that we output. */
724 /* Output to assembler file text saying following lines
725 may contain character constants, extra white space, comments, etc. */
727 #define ASM_APP_ON ""
729 /* Output to assembler file text saying following lines
730 no longer contain unusual constructs. */
732 #define ASM_APP_OFF ""
734 /* Output before read-only data. */
736 #define TEXT_SECTION_ASM_OP "\t.text\n"
738 /* Output before writable data. */
740 #define DATA_SECTION_ASM_OP "\t.data\n"
742 /* How to refer to registers in assembler output.
743 This sequence is indexed by compiler's hard-register-number (see above). */
745 #define REGISTER_NAMES \
746 {"r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc", \
747 "ac0", "ac1", "ac2", "ac3", "ac4", "ac5" }
749 /* Globalizing directive for a label. */
750 #define GLOBAL_ASM_OP "\t.globl "
752 /* The prefix to add to user-visible assembler symbols. */
754 #define USER_LABEL_PREFIX "_"
756 /* This is how to store into the string LABEL
757 the symbol_ref name of an internal numbered label where
758 PREFIX is the class of label and NUM is the number within the class.
759 This is suitable for output with `assemble_name'. */
761 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
762 sprintf (LABEL, "*%s_%lu", PREFIX, (unsigned long)(NUM))
764 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
765 output_ascii (FILE, P, SIZE)
767 /* This is how to output an element of a case-vector that is absolute. */
769 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
770 fprintf (FILE, "\t%sL_%d\n", TARGET_UNIX_ASM ? "" : ".word ", VALUE)
772 /* This is how to output an element of a case-vector that is relative.
773 Don't define this if it is not supported. */
775 /* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) */
777 /* This is how to output an assembler line
778 that says to advance the location counter
779 to a multiple of 2**LOG bytes.
781 who needs this????
784 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
785 switch (LOG) \
787 case 0: \
788 break; \
789 case 1: \
790 fprintf (FILE, "\t.even\n"); \
791 break; \
792 default: \
793 gcc_unreachable (); \
796 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
797 fprintf (FILE, "\t.=.+ %#ho\n", (unsigned short)(SIZE))
799 /* This says how to output an assembler line
800 to define a global common symbol. */
802 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
803 ( fprintf ((FILE), ".globl "), \
804 assemble_name ((FILE), (NAME)), \
805 fprintf ((FILE), "\n"), \
806 assemble_name ((FILE), (NAME)), \
807 fprintf ((FILE), ": .=.+ %#ho\n", (unsigned short)(ROUNDED)) \
810 /* This says how to output an assembler line
811 to define a local common symbol. */
813 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
814 ( assemble_name ((FILE), (NAME)), \
815 fprintf ((FILE), ":\t.=.+ %#ho\n", (unsigned short)(ROUNDED)))
817 /* Print operand X (an rtx) in assembler syntax to file FILE.
818 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
819 For `%' followed by punctuation, CODE is the punctuation and X is null.
824 #define PRINT_OPERAND(FILE, X, CODE) \
825 { if (CODE == '#') fprintf (FILE, "#"); \
826 else if (GET_CODE (X) == REG) \
827 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
828 else if (GET_CODE (X) == MEM) \
829 output_address (XEXP (X, 0)); \
830 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != SImode) \
831 { REAL_VALUE_TYPE r; \
832 long sval[2]; \
833 REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
834 REAL_VALUE_TO_TARGET_DOUBLE (r, sval); \
835 fprintf (FILE, "$%#lo", sval[0] >> 16); } \
836 else { putc ('$', FILE); output_addr_const_pdp11 (FILE, X); }}
838 /* Print a memory address as an operand to reference that memory location. */
840 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
841 print_operand_address (FILE, ADDR)
843 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
845 fprintf (FILE, "\tmov %s, -(sp)\n", reg_names[REGNO]) \
848 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
850 fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
853 #define TRAMPOLINE_SIZE 8
854 #define TRAMPOLINE_ALIGNMENT 16
856 /* there is no point in avoiding branches on a pdp,
857 since branches are really cheap - I just want to find out
858 how much difference the BRANCH_COST macro makes in code */
859 #define BRANCH_COST(speed_p, predictable_p) (TARGET_BRANCH_CHEAP ? 0 : 1)
862 #define COMPARE_FLAG_MODE HImode