]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/pdp11/pdp11.h
pdp11.h (PRINT_OPERAND): Delete.
[thirdparty/gcc.git] / gcc / config / pdp11 / pdp11.h
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).
5
6 This file is part of GCC.
7
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.
12
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.
17
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/>. */
21
22 #define CONSTANT_POOL_BEFORE_FUNCTION 0
23
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)
29
30 /* Names to predefine in the preprocessor for this target machine. */
31
32 #define TARGET_CPU_CPP_BUILTINS() \
33 do \
34 { \
35 builtin_define_std ("pdp11"); \
36 } \
37 while (0)
38
39 /* Print subsidiary information on the compiler version in use. */
40 #define TARGET_VERSION fprintf (stderr, " (pdp11)");
41
42
43 /* Generate DBX debugging information. */
44
45 #define DBX_DEBUGGING_INFO
46
47 #define TARGET_40_PLUS (TARGET_40 || TARGET_45)
48 #define TARGET_10 (! TARGET_40_PLUS)
49
50 #define TARGET_UNIX_ASM_DEFAULT 0
51
52 #define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0)
53
54 \f
55
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
61
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
70
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
75
76 #define PTRDIFF_TYPE "int"
77
78 /* target machine storage layout */
79
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
83
84 /* Define this if most significant byte of a word is the lowest numbered. */
85 #define BYTES_BIG_ENDIAN 0
86
87 /* Define this if most significant word of a multiword number is first. */
88 #define WORDS_BIG_ENDIAN 1
89
90 /* Define that floats are in VAX order, not high word first as for ints. */
91 #define FLOAT_WORDS_BIG_ENDIAN 0
92
93 /* Width of a word, in units (bytes).
94
95 UNITS OR BYTES - seems like units */
96 #define UNITS_PER_WORD 2
97
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;
105
106 /* Maximum sized of reasonable data type
107 DImode or Dfmode ...*/
108 #define MAX_FIXED_MODE_SIZE 64
109
110 /* Allocation boundary (in *bits*) for storing pointers in memory. */
111 #define POINTER_BOUNDARY 16
112
113 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
114 #define PARM_BOUNDARY 16
115
116 /* Boundary (in *bits*) on which stack pointer should be aligned. */
117 #define STACK_BOUNDARY 16
118
119 /* Allocation boundary (in *bits*) for the code of a function. */
120 #define FUNCTION_BOUNDARY 16
121
122 /* Alignment of field after `int : 0' in a structure. */
123 #define EMPTY_FIELD_BOUNDARY 16
124
125 /* No data type wants to be aligned rounder than this. */
126 #define BIGGEST_ALIGNMENT 16
127
128 /* Define this if move instructions will actually fail to work
129 when given unaligned data. */
130 #define STRICT_ALIGNMENT 1
131 \f
132 /* Standard register usage. */
133
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.
139
140 we have 8 integer registers, plus 6 float
141 (don't use scratch float !) */
142
143 /* 1 for registers that have pervasive standard uses
144 and are not available for the register allocator.
145
146 On the pdp, these are:
147 Reg 7 = pc;
148 reg 6 = sp;
149 reg 5 = fp; not necessarily!
150 */
151
152 #define FIXED_REGISTERS \
153 {0, 0, 0, 0, 0, 0, 1, 1, \
154 0, 0, 0, 0, 0, 0, 1, 1 }
155
156
157
158 /* 1 for registers not available across function calls.
159 These must include the FIXED_REGISTERS and also any
160 registers that can be used without being saved.
161 The latter must include the registers where values are returned
162 and the register where structure-value addresses are passed.
163 Aside from that, you can include as many other registers as you like. */
164
165 /* don't know about fp */
166 #define CALL_USED_REGISTERS \
167 {1, 1, 0, 0, 0, 0, 1, 1, \
168 0, 0, 0, 0, 0, 0, 1, 1 }
169
170
171 /* Return number of consecutive hard regs needed starting at reg REGNO
172 to hold something of mode MODE.
173 This is ordinarily the length in words of a value of mode MODE
174 but can be less for certain modes in special long registers.
175 */
176
177 #define HARD_REGNO_NREGS(REGNO, MODE) \
178 ((REGNO <= PC_REGNUM)? \
179 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \
180 :1)
181
182
183 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
184 On the pdp, the cpu registers can hold any mode other than float
185 (because otherwise we may end up being asked to move from CPU to FPU
186 register, which isn't a valid operation on the PDP11).
187 For CPU registers, check alignment.
188
189 FPU accepts SF and DF but actually holds a DF - simplifies life!
190 */
191 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
192 (((REGNO) <= PC_REGNUM)? \
193 ((GET_MODE_BITSIZE(MODE) <= 16) \
194 || (GET_MODE_BITSIZE(MODE) >= 32 && \
195 !((REGNO) & 1) && !FLOAT_MODE_P (MODE))) \
196 :FLOAT_MODE_P (MODE))
197
198
199 /* Value is 1 if it is a good idea to tie two pseudo registers
200 when one has mode MODE1 and one has mode MODE2.
201 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
202 for any hard reg, then this must be 0 for correct output. */
203 #define MODES_TIEABLE_P(MODE1, MODE2) 0
204
205 /* Specify the registers used for certain standard purposes.
206 The values of these macros are register numbers. */
207
208 /* Register in which static-chain is passed to a function. */
209 /* ??? - i don't want to give up a reg for this! */
210 #define STATIC_CHAIN_REGNUM 4
211 \f
212 /* Define the classes of registers for register constraints in the
213 machine description. Also define ranges of constants.
214
215 One of the classes must always be named ALL_REGS and include all hard regs.
216 If there is more than one class, another class must be named NO_REGS
217 and contain no registers.
218
219 The name GENERAL_REGS must be the name of a class (or an alias for
220 another name such as ALL_REGS). This is the class of registers
221 that is allowed by "g" or "r" in a register constraint.
222 Also, registers outside this class are allocated only when
223 instructions express preferences for them.
224
225 The classes must be numbered in nondecreasing order; that is,
226 a larger-numbered class must never be contained completely
227 in a smaller-numbered class.
228
229 For any two classes, it is very desirable that there be another
230 class that represents their union. */
231
232 /* The pdp has a couple of classes:
233
234 MUL_REGS are used for odd numbered regs, to use in 16-bit multiplication
235 (even numbered do 32-bit multiply)
236 LMUL_REGS long multiply registers (even numbered regs )
237 (don't need them, all 32-bit regs are even numbered!)
238 GENERAL_REGS is all cpu
239 LOAD_FPU_REGS is the first four cpu regs, they are easier to load
240 NO_LOAD_FPU_REGS is ac4 and ac5, currently - difficult to load them
241 FPU_REGS is all fpu regs
242 */
243
244 enum reg_class { NO_REGS, MUL_REGS, GENERAL_REGS, LOAD_FPU_REGS, NO_LOAD_FPU_REGS, FPU_REGS, ALL_REGS, LIM_REG_CLASSES };
245
246 #define N_REG_CLASSES (int) LIM_REG_CLASSES
247
248 /* have to allow this till cmpsi/tstsi are fixed in a better way !! */
249 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
250
251 /* Since GENERAL_REGS is the same class as ALL_REGS,
252 don't give it a different class number; just make it an alias. */
253
254 /* #define GENERAL_REGS ALL_REGS */
255
256 /* Give names of register classes as strings for dump file. */
257
258 #define REG_CLASS_NAMES {"NO_REGS", "MUL_REGS", "GENERAL_REGS", "LOAD_FPU_REGS", "NO_LOAD_FPU_REGS", "FPU_REGS", "ALL_REGS" }
259
260 /* Define which registers fit in which classes.
261 This is an initializer for a vector of HARD_REG_SET
262 of length N_REG_CLASSES. */
263
264 #define REG_CLASS_CONTENTS {{0}, {0x00aa}, {0xc0ff}, {0x0f00}, {0x3000}, {0x3f00}, {0xffff}}
265
266 /* The same information, inverted:
267 Return the class number of the smallest class containing
268 reg number REGNO. This could be a conditional expression
269 or could index an array. */
270
271 #define REGNO_REG_CLASS(REGNO) pdp11_regno_reg_class (REGNO)
272
273 /* The class value for index registers, and the one for base regs. */
274 #define INDEX_REG_CLASS GENERAL_REGS
275 #define BASE_REG_CLASS GENERAL_REGS
276
277 /* The following macro defines cover classes for Integrated Register
278 Allocator. Cover classes is a set of non-intersected register
279 classes covering all hard registers used for register allocation
280 purpose. Any move between two registers of a cover class should be
281 cheaper than load or store of the registers. The macro value is
282 array of register classes with LIM_REG_CLASSES used as the end
283 marker. */
284
285 #define IRA_COVER_CLASSES { GENERAL_REGS, FPU_REGS, LIM_REG_CLASSES }
286
287 /* Hook for testing if memory is needed for moving between registers. */
288 #define SECONDARY_MEMORY_NEEDED(class1, class2, m) \
289 pdp11_secondary_memory_needed (class1, class2, m)
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) \
294 ((CLASS == GENERAL_REGS || CLASS == MUL_REGS)? \
295 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD): \
296 1 \
297 )
298
299 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
300 pdp11_cannot_change_mode_class (FROM, TO, CLASS)
301 \f
302 /* Stack layout; function entry, exit and calling. */
303
304 /* Define this if pushing a word on the stack
305 makes the stack pointer a smaller address. */
306 #define STACK_GROWS_DOWNWARD
307
308 /* Define this to nonzero if the nominal address of the stack frame
309 is at the high-address end of the local variables;
310 that is, each additional local variable allocated
311 goes at a more negative offset in the frame.
312 */
313 #define FRAME_GROWS_DOWNWARD 1
314
315 /* Offset within stack frame to start allocating local variables at.
316 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
317 first local allocated. Otherwise, it is the offset to the BEGINNING
318 of the first local allocated. */
319 #define STARTING_FRAME_OFFSET 0
320
321 /* If we generate an insn to push BYTES bytes,
322 this says how many the stack pointer really advances by.
323 On the pdp11, the stack is on an even boundary */
324 #define PUSH_ROUNDING(BYTES) ((BYTES + 1) & ~1)
325
326 /* current_first_parm_offset stores the # of registers pushed on the
327 stack */
328 extern int current_first_parm_offset;
329
330 /* Offset of first parameter from the argument pointer register value. */
331 #define FIRST_PARM_OFFSET(FNDECL) 0
332
333 /* Define how to find the value returned by a function.
334 VALTYPE is the data type of the value (as a tree).
335 If the precise function being called is known, FUNC is its FUNCTION_DECL;
336 otherwise, FUNC is 0. */
337 #define BASE_RETURN_VALUE_REG(MODE) \
338 (FLOAT_MODE_P (MODE) ? AC0_REGNUM : RETVAL_REGNUM)
339
340 /* 1 if N is a possible register number for function argument passing.
341 - not used on pdp */
342
343 #define FUNCTION_ARG_REGNO_P(N) 0
344 \f
345 /* Define a data type for recording info about an argument list
346 during the scan of that argument list. This data type should
347 hold all necessary information about the function itself
348 and about the args processed so far, enough to enable macros
349 such as FUNCTION_ARG to determine where the next arg should go.
350
351 */
352
353 #define CUMULATIVE_ARGS int
354
355 /* Initialize a variable CUM of type CUMULATIVE_ARGS
356 for a call to a function whose data type is FNTYPE.
357 For a library call, FNTYPE is 0.
358
359 ...., the offset normally starts at 0, but starts at 1 word
360 when the function gets a structure-value-address as an
361 invisible first argument. */
362
363 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
364 ((CUM) = 0)
365
366 /* Output assembler code to FILE to increment profiler label # LABELNO
367 for profiling a function entry. */
368
369 #define FUNCTION_PROFILER(FILE, LABELNO) \
370 gcc_unreachable ();
371
372 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
373 the stack pointer does not matter. The value is tested only in
374 functions that have frame pointers.
375 No definition is equivalent to always zero. */
376
377 extern int may_call_alloca;
378
379 #define EXIT_IGNORE_STACK 1
380
381 /* Definitions for register eliminations.
382
383 This is an array of structures. Each structure initializes one pair
384 of eliminable registers. The "from" register number is given first,
385 followed by "to". Eliminations of the same "from" register are listed
386 in order of preference.
387
388 There are two registers that can always be eliminated on the pdp11.
389 The frame pointer and the arg pointer can be replaced by either the
390 hard frame pointer or to the stack pointer, depending upon the
391 circumstances. The hard frame pointer is not used before reload and
392 so it is not eligible for elimination. */
393
394 #define ELIMINABLE_REGS \
395 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
396 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
397 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
398 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} \
399
400 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
401 ((OFFSET) = pdp11_initial_elimination_offset ((FROM), (TO)))
402
403 \f
404 /* Addressing modes, and classification of registers for them. */
405
406 #define HAVE_POST_INCREMENT 1
407
408 #define HAVE_PRE_DECREMENT 1
409
410 /* Macros to check register numbers against specific register classes. */
411
412 /* These assume that REGNO is a hard or pseudo reg number.
413 They give nonzero only if REGNO is a hard reg of the suitable class
414 or a pseudo reg currently allocated to a suitable hard reg.
415 Since they use reg_renumber, they are safe only once reg_renumber
416 has been allocated, which happens in local-alloc.c. */
417
418 #define REGNO_OK_FOR_BASE_P(REGNO) \
419 ((REGNO) <= PC_REGNUM || (unsigned) reg_renumber[REGNO] <= PC_REGNUM || \
420 (REGNO) == ARG_POINTER_REGNUM || (REGNO) == FRAME_POINTER_REGNUM)
421
422 #define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P (REGNO)
423
424 /* Now macros that check whether X is a register and also,
425 strictly, whether it is in a specified class.
426 */
427
428
429 \f
430 /* Maximum number of registers that can appear in a valid memory address. */
431
432 #define MAX_REGS_PER_ADDRESS 1
433
434 /* Nonzero if the constant value X is a legitimate general operand.
435 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
436
437 #define LEGITIMATE_CONSTANT_P(X) \
438 (GET_CODE (X) != CONST_DOUBLE || legitimate_const_double_p (X))
439
440 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
441 and check its validity for a certain class.
442 We have two alternate definitions for each of them.
443 The usual definition accepts all pseudo regs; the other rejects
444 them unless they have been allocated suitable hard regs.
445 The symbol REG_OK_STRICT causes the latter definition to be used.
446
447 Most source files want to accept pseudo regs in the hope that
448 they will get allocated to the class that the insn wants them to be in.
449 Source files for reload pass need to be strict.
450 After reload, it makes no difference, since pseudo regs have
451 been eliminated by then. */
452
453 #ifndef REG_OK_STRICT
454
455 /* Nonzero if X is a hard reg that can be used as an index
456 or if it is a pseudo reg. */
457 #define REG_OK_FOR_INDEX_P(X) (1)
458 /* Nonzero if X is a hard reg that can be used as a base reg
459 or if it is a pseudo reg. */
460 #define REG_OK_FOR_BASE_P(X) (1)
461
462 #else
463
464 /* Nonzero if X is a hard reg that can be used as an index. */
465 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
466 /* Nonzero if X is a hard reg that can be used as a base reg. */
467 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
468
469 #endif
470 \f
471 /* Specify the machine mode that this machine uses
472 for the index in the tablejump instruction. */
473 #define CASE_VECTOR_MODE HImode
474
475 /* Define this if a raw index is all that is needed for a
476 `tablejump' insn. */
477 #define CASE_TAKES_INDEX_RAW
478
479 /* Define this as 1 if `char' should by default be signed; else as 0. */
480 #define DEFAULT_SIGNED_CHAR 1
481
482 /* Max number of bytes we can move from memory to memory
483 in one reasonably fast instruction.
484 */
485
486 #define MOVE_MAX 2
487
488 /* Nonzero if access to memory by byte is slow and undesirable. -
489 */
490 #define SLOW_BYTE_ACCESS 0
491
492 /* Do not break .stabs pseudos into continuations. */
493 #define DBX_CONTIN_LENGTH 0
494
495 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
496 is done just by pretending it is already truncated. */
497 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
498
499 /* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE,
500 return the mode to be used for the comparison. For floating-point, CCFPmode
501 should be used. */
502
503 #define SELECT_CC_MODE(OP,X,Y) \
504 (GET_MODE_CLASS(GET_MODE(X)) == MODE_FLOAT? CCFPmode : CCmode)
505
506 /* Specify the machine mode that pointers have.
507 After generation of rtl, the compiler makes no further distinction
508 between pointers and any other objects of this machine mode. */
509 #define Pmode HImode
510
511 /* A function address in a call instruction
512 is a word address (for indexing purposes)
513 so give the MEM rtx a word's mode. */
514 #define FUNCTION_MODE HImode
515
516 /* Define this if addresses of constant functions
517 shouldn't be put through pseudo regs where they can be cse'd.
518 Desirable on machines where ordinary constants are expensive
519 but a CALL with constant address is cheap. */
520 /* #define NO_FUNCTION_CSE */
521
522 \f
523 /* Tell emit-rtl.c how to initialize special values on a per-function base. */
524 extern struct rtx_def *cc0_reg_rtx;
525
526 #define CC_STATUS_MDEP rtx
527
528 #define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)
529 \f
530 /* Tell final.c how to eliminate redundant test instructions. */
531
532 /* Here we define machine-dependent flags and fields in cc_status
533 (see `conditions.h'). */
534
535 #define CC_IN_FPU 04000
536
537 /* Do UPDATE_CC if EXP is a set, used in
538 NOTICE_UPDATE_CC
539
540 floats only do compare correctly, else nullify ...
541
542 get cc0 out soon ...
543 */
544
545 /* Store in cc_status the expressions
546 that the condition codes will describe
547 after execution of an instruction whose pattern is EXP.
548 Do not alter them if the instruction would not alter the cc's. */
549
550 #define NOTICE_UPDATE_CC(EXP, INSN) \
551 { if (GET_CODE (EXP) == SET) \
552 { \
553 notice_update_cc_on_set(EXP, INSN); \
554 } \
555 else if (GET_CODE (EXP) == PARALLEL \
556 && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \
557 { \
558 notice_update_cc_on_set(XVECEXP (EXP, 0, 0), INSN); \
559 } \
560 else if (GET_CODE (EXP) == CALL) \
561 { /* all bets are off */ CC_STATUS_INIT; } \
562 if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \
563 && cc_status.value2 \
564 && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \
565 { \
566 printf ("here!\n"); \
567 cc_status.value2 = 0; \
568 } \
569 }
570 \f
571 /* Control the assembler format that we output. */
572
573 /* Output to assembler file text saying following lines
574 may contain character constants, extra white space, comments, etc. */
575
576 #define ASM_APP_ON ""
577
578 /* Output to assembler file text saying following lines
579 no longer contain unusual constructs. */
580
581 #define ASM_APP_OFF ""
582
583 /* Output before read-only data. */
584
585 #define TEXT_SECTION_ASM_OP "\t.text\n"
586
587 /* Output before writable data. */
588
589 #define DATA_SECTION_ASM_OP "\t.data\n"
590
591 /* How to refer to registers in assembler output.
592 This sequence is indexed by compiler's hard-register-number (see above). */
593
594 #define REGISTER_NAMES \
595 {"r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc", \
596 "ac0", "ac1", "ac2", "ac3", "ac4", "ac5", "fp", "ap" }
597
598 /* Globalizing directive for a label. */
599 #define GLOBAL_ASM_OP "\t.globl "
600
601 /* The prefix to add to user-visible assembler symbols. */
602
603 #define USER_LABEL_PREFIX "_"
604
605 /* This is how to store into the string LABEL
606 the symbol_ref name of an internal numbered label where
607 PREFIX is the class of label and NUM is the number within the class.
608 This is suitable for output with `assemble_name'. */
609
610 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
611 sprintf (LABEL, "*%s_%lu", PREFIX, (unsigned long)(NUM))
612
613 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
614 output_ascii (FILE, P, SIZE)
615
616 /* This is how to output an element of a case-vector that is absolute. */
617
618 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
619 fprintf (FILE, "\t%sL_%d\n", TARGET_UNIX_ASM ? "" : ".word ", VALUE)
620
621 /* This is how to output an element of a case-vector that is relative.
622 Don't define this if it is not supported. */
623
624 /* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) */
625
626 /* This is how to output an assembler line
627 that says to advance the location counter
628 to a multiple of 2**LOG bytes.
629
630 who needs this????
631 */
632
633 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
634 switch (LOG) \
635 { \
636 case 0: \
637 break; \
638 case 1: \
639 fprintf (FILE, "\t.even\n"); \
640 break; \
641 default: \
642 gcc_unreachable (); \
643 }
644
645 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
646 fprintf (FILE, "\t.=.+ %#ho\n", (unsigned short)(SIZE))
647
648 /* This says how to output an assembler line
649 to define a global common symbol. */
650
651 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
652 pdp11_asm_output_var (FILE, NAME, SIZE, ALIGN, true)
653
654
655 /* This says how to output an assembler line
656 to define a local common symbol. */
657
658 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
659 pdp11_asm_output_var (FILE, NAME, SIZE, ALIGN, false)
660
661 /* Print a memory address as an operand to reference that memory location. */
662
663 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
664 print_operand_address (FILE, ADDR)
665
666 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
667 ( \
668 fprintf (FILE, "\tmov %s, -(sp)\n", reg_names[REGNO]) \
669 )
670
671 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
672 ( \
673 fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
674 )
675
676 #define TRAMPOLINE_SIZE 8
677 #define TRAMPOLINE_ALIGNMENT 16
678
679 /* there is no point in avoiding branches on a pdp,
680 since branches are really cheap - I just want to find out
681 how much difference the BRANCH_COST macro makes in code */
682 #define BRANCH_COST(speed_p, predictable_p) (TARGET_BRANCH_CHEAP ? 0 : 1)
683
684
685 #define COMPARE_FLAG_MODE HImode