Merged r158229 through r158464 into branch.
[official-gcc.git] / gcc / config / h8300 / h8300.h
blobf77dfa31407c850af7ca6ca94f4a9672f17d8b07
1 /* Definitions of target machine for GNU compiler.
2 Renesas H8/300 (generic)
3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999,
4 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
5 Free Software Foundation, Inc.
6 Contributed by Steve Chamberlain (sac@cygnus.com),
7 Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
9 This file is part of GCC.
11 GCC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3, or (at your option)
14 any later version.
16 GCC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GCC; see the file COPYING3. If not see
23 <http://www.gnu.org/licenses/>. */
25 #ifndef GCC_H8300_H
26 #define GCC_H8300_H
28 /* Which CPU to compile for.
29 We use int for CPU_TYPE to avoid lots of casts. */
30 #if 0 /* defined in insn-attr.h, here for documentation */
31 enum attr_cpu { CPU_H8300, CPU_H8300H };
32 #endif
33 extern int cpu_type;
35 /* Various globals defined in h8300.c. */
37 extern const char *h8_push_op, *h8_pop_op, *h8_mov_op;
38 extern const char * const *h8_reg_names;
40 /* Target CPU builtins. */
41 #define TARGET_CPU_CPP_BUILTINS() \
42 do \
43 { \
44 if (TARGET_H8300H) \
45 { \
46 builtin_define ("__H8300H__"); \
47 builtin_assert ("cpu=h8300h"); \
48 builtin_assert ("machine=h8300h"); \
49 if (TARGET_NORMAL_MODE) \
50 { \
51 builtin_define ("__NORMAL_MODE__"); \
52 } \
53 } \
54 else if (TARGET_H8300SX) \
55 { \
56 builtin_define ("__H8300SX__"); \
57 if (TARGET_NORMAL_MODE) \
58 { \
59 builtin_define ("__NORMAL_MODE__"); \
60 } \
61 } \
62 else if (TARGET_H8300S) \
63 { \
64 builtin_define ("__H8300S__"); \
65 builtin_assert ("cpu=h8300s"); \
66 builtin_assert ("machine=h8300s"); \
67 if (TARGET_NORMAL_MODE) \
68 { \
69 builtin_define ("__NORMAL_MODE__"); \
70 } \
71 } \
72 else \
73 { \
74 builtin_define ("__H8300__"); \
75 builtin_assert ("cpu=h8300"); \
76 builtin_assert ("machine=h8300"); \
77 } \
78 } \
79 while (0)
81 #define LINK_SPEC "%{mh:%{mn:-m h8300hn}} %{mh:%{!mn:-m h8300h}} %{ms:%{mn:-m h8300sn}} %{ms:%{!mn:-m h8300s}}"
83 #define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
85 #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
86 do \
87 { \
88 /* Basic block reordering is only beneficial on targets with cache \
89 and/or variable-cycle branches where (cycle count taken != \
90 cycle count not taken). */ \
91 flag_reorder_blocks = 0; \
92 } \
93 while (0)
95 /* Print subsidiary information on the compiler version in use. */
97 #define TARGET_VERSION fprintf (stderr, " (Renesas H8/300)");
99 /* Macros used in the machine description to test the flags. */
101 /* Select between the H8/300 and H8/300H CPUs. */
102 #define TARGET_H8300 (! TARGET_H8300H && ! TARGET_H8300S)
103 #define TARGET_H8300S (TARGET_H8300S_1 || TARGET_H8300SX)
104 /* Some multiply instructions are not available in all H8SX variants.
105 Use this macro instead of TARGET_H8300SX to indicate this, even
106 though we don't actually generate different code for now. */
107 #define TARGET_H8300SXMUL TARGET_H8300SX
109 #ifdef IN_LIBGCC2
110 #undef TARGET_H8300H
111 #undef TARGET_H8300S
112 #undef TARGET_NORMAL_MODE
113 /* If compiling libgcc2, make these compile time constants based on what
114 flags are we actually compiling with. */
115 #ifdef __H8300H__
116 #define TARGET_H8300H 1
117 #else
118 #define TARGET_H8300H 0
119 #endif
120 #ifdef __H8300S__
121 #define TARGET_H8300S 1
122 #else
123 #define TARGET_H8300S 0
124 #endif
125 #ifdef __NORMAL_MODE__
126 #define TARGET_NORMAL_MODE 1
127 #else
128 #define TARGET_NORMAL_MODE 0
129 #endif
130 #endif /* !IN_LIBGCC2 */
132 /* Do things that must be done once at start up. */
134 #define OVERRIDE_OPTIONS \
135 do \
137 h8300_init_once (); \
139 while (0)
141 /* Default target_flags if no switches specified. */
143 #ifndef TARGET_DEFAULT
144 #define TARGET_DEFAULT (MASK_QUICKCALL)
145 #endif
147 /* Show we can debug even without a frame pointer. */
148 /* #define CAN_DEBUG_WITHOUT_FP */
150 /* We want dwarf2 info available to gdb... */
151 #define DWARF2_DEBUGGING_INFO 1
152 /* ... but we don't actually support full dwarf2 EH. */
153 #define MUST_USE_SJLJ_EXCEPTIONS 1
155 /* The return address is pushed on the stack. */
156 #define INCOMING_RETURN_ADDR_RTX gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, STACK_POINTER_REGNUM))
157 #define INCOMING_FRAME_SP_OFFSET (POINTER_SIZE / 8)
159 #define DWARF_CIE_DATA_ALIGNMENT 2
161 /* Define this if addresses of constant functions
162 shouldn't be put through pseudo regs where they can be cse'd.
163 Desirable on machines where ordinary constants are expensive
164 but a CALL with constant address is cheap.
166 Calls through a register are cheaper than calls to named
167 functions; however, the register pressure this causes makes
168 CSEing of function addresses generally a lose. */
169 #define NO_FUNCTION_CSE
171 /* Target machine storage layout */
173 /* Define this if most significant bit is lowest numbered
174 in instructions that operate on numbered bit-fields.
175 This is not true on the H8/300. */
176 #define BITS_BIG_ENDIAN 0
178 /* Define this if most significant byte of a word is the lowest numbered. */
179 /* That is true on the H8/300. */
180 #define BYTES_BIG_ENDIAN 1
182 /* Define this if most significant word of a multiword number is lowest
183 numbered. */
184 #define WORDS_BIG_ENDIAN 1
186 #define MAX_BITS_PER_WORD 32
188 /* Width of a word, in units (bytes). */
189 #define UNITS_PER_WORD (TARGET_H8300H || TARGET_H8300S ? 4 : 2)
190 #define MIN_UNITS_PER_WORD 2
192 #define SHORT_TYPE_SIZE 16
193 #define INT_TYPE_SIZE (TARGET_INT32 ? 32 : 16)
194 #define LONG_TYPE_SIZE 32
195 #define LONG_LONG_TYPE_SIZE 64
196 #define FLOAT_TYPE_SIZE 32
197 #define DOUBLE_TYPE_SIZE 32
198 #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
200 #define MAX_FIXED_MODE_SIZE 32
202 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
203 #define PARM_BOUNDARY (TARGET_H8300H || TARGET_H8300S ? 32 : 16)
205 /* Allocation boundary (in *bits*) for the code of a function. */
206 #define FUNCTION_BOUNDARY 16
208 /* Alignment of field after `int : 0' in a structure. */
209 /* One can argue this should be 32 for -mint32, but since 32-bit ints only
210 need 16-bit alignment, this is left as is so that -mint32 doesn't change
211 structure layouts. */
212 #define EMPTY_FIELD_BOUNDARY 16
214 /* No data type wants to be aligned rounder than this.
215 32-bit values are aligned as such on the H8/300H and H8S for speed. */
216 #define BIGGEST_ALIGNMENT \
217 (((TARGET_H8300H || TARGET_H8300S) && ! TARGET_ALIGN_300) ? 32 : 16)
219 /* The stack goes in 16/32 bit lumps. */
220 #define STACK_BOUNDARY (TARGET_H8300 ? 16 : 32)
222 /* Define this if move instructions will actually fail to work
223 when given unaligned data. */
224 /* On the H8/300, longs can be aligned on halfword boundaries, but not
225 byte boundaries. */
226 #define STRICT_ALIGNMENT 1
228 /* Standard register usage. */
230 /* Number of actual hardware registers.
231 The hardware registers are assigned numbers for the compiler
232 from 0 to just below FIRST_PSEUDO_REGISTER.
234 All registers that the compiler knows about must be given numbers,
235 even those that are not normally considered general registers.
237 Reg 9 does not correspond to any hardware register, but instead
238 appears in the RTL as an argument pointer prior to reload, and is
239 eliminated during reloading in favor of either the stack or frame
240 pointer. */
242 #define FIRST_PSEUDO_REGISTER 12
244 /* 1 for registers that have pervasive standard uses
245 and are not available for the register allocator. */
247 #define FIXED_REGISTERS \
248 /* r0 r1 r2 r3 r4 r5 r6 r7 mac ap rap fp */ \
249 { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1 }
251 /* 1 for registers not available across function calls.
252 These must include the FIXED_REGISTERS and also any
253 registers that can be used without being saved.
254 The latter must include the registers where values are returned
255 and the register where structure-value addresses are passed.
256 Aside from that, you can include as many other registers as you
257 like.
259 H8 destroys r0,r1,r2,r3. */
261 #define CALL_USED_REGISTERS \
262 /* r0 r1 r2 r3 r4 r5 r6 r7 mac ap rap fp */ \
263 { 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1 }
265 #define REG_ALLOC_ORDER \
266 /* r0 r1 r2 r3 r4 r5 r6 r7 mac ap rap fp */ \
267 { 2, 3, 0, 1, 4, 5, 6, 8, 7, 9, 10, 11 }
269 #define CONDITIONAL_REGISTER_USAGE \
271 if (!TARGET_MAC) \
272 fixed_regs[MAC_REG] = call_used_regs[MAC_REG] = 1; \
275 #define HARD_REGNO_NREGS(REGNO, MODE) \
276 h8300_hard_regno_nregs ((REGNO), (MODE))
278 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
279 h8300_hard_regno_mode_ok ((REGNO), (MODE))
281 /* Value is 1 if it is a good idea to tie two pseudo registers
282 when one has mode MODE1 and one has mode MODE2.
283 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
284 for any hard reg, then this must be 0 for correct output. */
285 #define MODES_TIEABLE_P(MODE1, MODE2) \
286 ((MODE1) == (MODE2) \
287 || (((MODE1) == QImode || (MODE1) == HImode \
288 || ((TARGET_H8300H || TARGET_H8300S) && (MODE1) == SImode)) \
289 && ((MODE2) == QImode || (MODE2) == HImode \
290 || ((TARGET_H8300H || TARGET_H8300S) && (MODE2) == SImode))))
292 /* A C expression that is nonzero if hard register NEW_REG can be
293 considered for use as a rename register for OLD_REG register */
295 #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
296 h8300_hard_regno_rename_ok (OLD_REG, NEW_REG)
298 /* Specify the registers used for certain standard purposes.
299 The values of these macros are register numbers. */
301 /* H8/300 pc is not overloaded on a register. */
303 /*#define PC_REGNUM 15*/
305 /* Register to use for pushing function arguments. */
306 #define STACK_POINTER_REGNUM SP_REG
308 /* Base register for access to local variables of the function. */
309 #define HARD_FRAME_POINTER_REGNUM HFP_REG
311 /* Base register for access to local variables of the function. */
312 #define FRAME_POINTER_REGNUM FP_REG
314 /* Base register for access to arguments of the function. */
315 #define ARG_POINTER_REGNUM AP_REG
317 /* Register in which static-chain is passed to a function. */
318 #define STATIC_CHAIN_REGNUM SC_REG
320 /* Fake register that holds the address on the stack of the
321 current function's return address. */
322 #define RETURN_ADDRESS_POINTER_REGNUM RAP_REG
324 /* A C expression whose value is RTL representing the value of the return
325 address for the frame COUNT steps up from the current frame.
326 FRAMEADDR is already the frame pointer of the COUNT frame, assuming
327 a stack layout with the frame pointer as the first saved register. */
328 #define RETURN_ADDR_RTX(COUNT, FRAME) h8300_return_addr_rtx ((COUNT), (FRAME))
330 /* Define the classes of registers for register constraints in the
331 machine description. Also define ranges of constants.
333 One of the classes must always be named ALL_REGS and include all hard regs.
334 If there is more than one class, another class must be named NO_REGS
335 and contain no registers.
337 The name GENERAL_REGS must be the name of a class (or an alias for
338 another name such as ALL_REGS). This is the class of registers
339 that is allowed by "g" or "r" in a register constraint.
340 Also, registers outside this class are allocated only when
341 instructions express preferences for them.
343 The classes must be numbered in nondecreasing order; that is,
344 a larger-numbered class must never be contained completely
345 in a smaller-numbered class.
347 For any two classes, it is very desirable that there be another
348 class that represents their union. */
350 enum reg_class {
351 NO_REGS, COUNTER_REGS, SOURCE_REGS, DESTINATION_REGS,
352 GENERAL_REGS, MAC_REGS, ALL_REGS, LIM_REG_CLASSES
355 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
357 /* Give names of register classes as strings for dump file. */
359 #define REG_CLASS_NAMES \
360 { "NO_REGS", "COUNTER_REGS", "SOURCE_REGS", "DESTINATION_REGS", \
361 "GENERAL_REGS", "MAC_REGS", "ALL_REGS", "LIM_REGS" }
363 /* The following macro defines cover classes for Integrated Register
364 Allocator. Cover classes is a set of non-intersected register
365 classes covering all hard registers used for register allocation
366 purpose. Any move between two registers of a cover class should be
367 cheaper than load or store of the registers. The macro value is
368 array of register classes with LIM_REG_CLASSES used as the end
369 marker. */
371 #define IRA_COVER_CLASSES \
373 GENERAL_REGS, MAC_REGS, LIM_REG_CLASSES \
376 /* Define which registers fit in which classes.
377 This is an initializer for a vector of HARD_REG_SET
378 of length N_REG_CLASSES. */
380 #define REG_CLASS_CONTENTS \
381 { {0}, /* No regs */ \
382 {0x010}, /* COUNTER_REGS */ \
383 {0x020}, /* SOURCE_REGS */ \
384 {0x040}, /* DESTINATION_REGS */ \
385 {0xeff}, /* GENERAL_REGS */ \
386 {0x100}, /* MAC_REGS */ \
387 {0xfff}, /* ALL_REGS */ \
390 /* The same information, inverted:
391 Return the class number of the smallest class containing
392 reg number REGNO. This could be a conditional expression
393 or could index an array. */
395 #define REGNO_REG_CLASS(REGNO) \
396 ((REGNO) == MAC_REG ? MAC_REGS \
397 : (REGNO) == COUNTER_REG ? COUNTER_REGS \
398 : (REGNO) == SOURCE_REG ? SOURCE_REGS \
399 : (REGNO) == DESTINATION_REG ? DESTINATION_REGS \
400 : GENERAL_REGS)
402 /* The class value for index registers, and the one for base regs. */
404 #define INDEX_REG_CLASS (TARGET_H8300SX ? GENERAL_REGS : NO_REGS)
405 #define BASE_REG_CLASS GENERAL_REGS
407 /* Get reg_class from a letter such as appears in the machine description.
409 'a' is the MAC register. */
411 #define REG_CLASS_FROM_LETTER(C) (h8300_reg_class_from_letter (C))
413 /* The letters I, J, K, L, M, N, O, P in a register constraint string
414 can be used to stand for particular ranges of immediate operands.
415 This macro defines what the ranges are.
416 C is the letter, and VALUE is a constant value.
417 Return 1 if VALUE is in the range specified by C. */
419 #define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)
420 #define CONST_OK_FOR_J(VALUE) (((VALUE) & 0xff) == 0)
421 #define CONST_OK_FOR_L(VALUE) \
422 (TARGET_H8300H || TARGET_H8300S \
423 ? (VALUE) == 1 || (VALUE) == 2 || (VALUE) == 4 \
424 : (VALUE) == 1 || (VALUE) == 2)
425 #define CONST_OK_FOR_M(VALUE) \
426 ((VALUE) == 1 || (VALUE) == 2)
427 #define CONST_OK_FOR_N(VALUE) \
428 (TARGET_H8300H || TARGET_H8300S \
429 ? (VALUE) == -1 || (VALUE) == -2 || (VALUE) == -4 \
430 : (VALUE) == -1 || (VALUE) == -2)
431 #define CONST_OK_FOR_O(VALUE) \
432 ((VALUE) == -1 || (VALUE) == -2)
434 /* Multi-letter constraints for constant are always started with P
435 (just because it was the only letter in the range left. New
436 constraints for constants should be added here. */
437 #define CONST_OK_FOR_Ppositive(VALUE, NBITS) \
438 ((VALUE) > 0 && (VALUE) < (1 << (NBITS)))
439 #define CONST_OK_FOR_Pnegative(VALUE, NBITS) \
440 ((VALUE) < 0 && (VALUE) > -(1 << (NBITS)))
441 #define CONST_OK_FOR_P(VALUE, STR) \
442 ((STR)[1] >= '1' && (STR)[1] <= '9' && (STR)[2] == '<' \
443 ? (((STR)[3] == '0' || ((STR)[3] == 'X' && TARGET_H8300SX)) \
444 && CONST_OK_FOR_Pnegative ((VALUE), (STR)[1] - '0')) \
445 : ((STR)[1] >= '1' && (STR)[1] <= '9' && (STR)[2] == '>') \
446 ? (((STR)[3] == '0' || ((STR)[3] == 'X' && TARGET_H8300SX)) \
447 && CONST_OK_FOR_Ppositive ((VALUE), (STR)[1] - '0')) \
448 : 0)
449 #define CONSTRAINT_LEN_FOR_P(STR) \
450 ((((STR)[1] >= '1' && (STR)[1] <= '9') \
451 && ((STR)[2] == '<' || (STR)[2] == '>') \
452 && ((STR)[3] == 'X' || (STR)[3] == '0')) ? 4 \
453 : 0)
455 #define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \
456 ((C) == 'P' ? CONST_OK_FOR_P ((VALUE), (STR)) \
457 : CONST_OK_FOR_LETTER_P ((VALUE), (C)))
459 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
460 ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \
461 (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \
462 (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \
463 (C) == 'M' ? CONST_OK_FOR_M (VALUE) : \
464 (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \
465 (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \
468 /* Similar, but for floating constants, and defining letters G and H.
469 Here VALUE is the CONST_DOUBLE rtx itself.
471 `G' is a floating-point zero. */
473 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
474 ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode) \
475 : 0)
477 /* Given an rtx X being reloaded into a reg required to be
478 in class CLASS, return the class of reg to actually use.
479 In general this is just CLASS; but on some machines
480 in some cases it is preferable to use a more restrictive class. */
482 #define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
484 /* Return the maximum number of consecutive registers
485 needed to represent mode MODE in a register of class CLASS. */
487 /* On the H8, this is the size of MODE in words. */
489 #define CLASS_MAX_NREGS(CLASS, MODE) \
490 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
492 /* Any SI register-to-register move may need to be reloaded,
493 so define REGISTER_MOVE_COST to be > 2 so that reload never
494 shortcuts. */
496 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
497 (CLASS1 == MAC_REGS || CLASS2 == MAC_REGS ? 6 : 3)
499 /* Stack layout; function entry, exit and calling. */
501 /* Define this if pushing a word on the stack
502 makes the stack pointer a smaller address. */
504 #define STACK_GROWS_DOWNWARD
506 /* Define this to nonzero if the nominal address of the stack frame
507 is at the high-address end of the local variables;
508 that is, each additional local variable allocated
509 goes at a more negative offset in the frame. */
511 #define FRAME_GROWS_DOWNWARD 1
513 /* Offset within stack frame to start allocating local variables at.
514 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
515 first local allocated. Otherwise, it is the offset to the BEGINNING
516 of the first local allocated. */
518 #define STARTING_FRAME_OFFSET 0
520 /* If we generate an insn to push BYTES bytes,
521 this says how many the stack pointer really advances by.
523 On the H8/300, @-sp really pushes a byte if you ask it to - but that's
524 dangerous, so we claim that it always pushes a word, then we catch
525 the mov.b rx,@-sp and turn it into a mov.w rx,@-sp on output.
527 On the H8/300H, we simplify TARGET_QUICKCALL by setting this to 4
528 and doing a similar thing. */
530 #define PUSH_ROUNDING(BYTES) \
531 (((BYTES) + PARM_BOUNDARY / 8 - 1) & -PARM_BOUNDARY / 8)
533 /* Offset of first parameter from the argument pointer register value. */
534 /* Is equal to the size of the saved fp + pc, even if an fp isn't
535 saved since the value is used before we know. */
537 #define FIRST_PARM_OFFSET(FNDECL) 0
539 /* Value is the number of bytes of arguments automatically
540 popped when returning from a subroutine call.
541 FUNDECL is the declaration node of the function (as a tree),
542 FUNTYPE is the data type of the function (as a tree),
543 or for a library call it is an identifier node for the subroutine name.
544 SIZE is the number of bytes of arguments passed on the stack.
546 On the H8 the return does not pop anything. */
548 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
550 /* Definitions for register eliminations.
552 This is an array of structures. Each structure initializes one pair
553 of eliminable registers. The "from" register number is given first,
554 followed by "to". Eliminations of the same "from" register are listed
555 in order of preference.
557 We have three registers that can be eliminated on the h8300.
558 First, the frame pointer register can often be eliminated in favor
559 of the stack pointer register. Secondly, the argument pointer
560 register and the return address pointer register are always
561 eliminated; they are replaced with either the stack or frame
562 pointer. */
564 #define ELIMINABLE_REGS \
565 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
566 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
567 { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
568 { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
569 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
570 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
572 /* Define the offset between two registers, one to be eliminated, and the other
573 its replacement, at the start of a routine. */
575 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
576 ((OFFSET) = h8300_initial_elimination_offset ((FROM), (TO)))
578 /* Define how to find the value returned by a function.
579 VALTYPE is the data type of the value (as a tree).
580 If the precise function being called is known, FUNC is its FUNCTION_DECL;
581 otherwise, FUNC is 0.
583 On the H8 the return value is in R0/R1. */
585 #define FUNCTION_VALUE(VALTYPE, FUNC) \
586 gen_rtx_REG (TYPE_MODE (VALTYPE), R0_REG)
588 /* Define how to find the value returned by a library function
589 assuming the value has mode MODE. */
591 /* On the H8 the return value is in R0/R1. */
593 #define LIBCALL_VALUE(MODE) \
594 gen_rtx_REG (MODE, R0_REG)
596 /* 1 if N is a possible register number for a function value.
597 On the H8, R0 is the only register thus used. */
599 #define FUNCTION_VALUE_REGNO_P(N) ((N) == R0_REG)
601 /* Define this if PCC uses the nonreentrant convention for returning
602 structure and union values. */
604 /*#define PCC_STATIC_STRUCT_RETURN*/
606 /* 1 if N is a possible register number for function argument passing.
607 On the H8, no registers are used in this way. */
609 #define FUNCTION_ARG_REGNO_P(N) (TARGET_QUICKCALL ? N < 3 : 0)
611 /* When defined, the compiler allows registers explicitly used in the
612 rtl to be used as spill registers but prevents the compiler from
613 extending the lifetime of these registers. */
615 #define SMALL_REGISTER_CLASSES 1
617 /* Define a data type for recording info about an argument list
618 during the scan of that argument list. This data type should
619 hold all necessary information about the function itself
620 and about the args processed so far, enough to enable macros
621 such as FUNCTION_ARG to determine where the next arg should go.
623 On the H8/300, this is a two item struct, the first is the number
624 of bytes scanned so far and the second is the rtx of the called
625 library function if any. */
627 #define CUMULATIVE_ARGS struct cum_arg
628 struct cum_arg
630 int nbytes;
631 struct rtx_def *libcall;
634 /* Initialize a variable CUM of type CUMULATIVE_ARGS
635 for a call to a function whose data type is FNTYPE.
636 For a library call, FNTYPE is 0.
638 On the H8/300, the offset starts at 0. */
640 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
641 ((CUM).nbytes = 0, (CUM).libcall = LIBNAME)
643 /* Update the data in CUM to advance over an argument
644 of mode MODE and data type TYPE.
645 (TYPE is null for libcalls where that information may not be available.) */
647 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
648 ((CUM).nbytes += ((MODE) != BLKmode \
649 ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD \
650 : (int_size_in_bytes (TYPE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD))
652 /* Define where to put the arguments to a function.
653 Value is zero to push the argument on the stack,
654 or a hard register in which to store the argument.
656 MODE is the argument's machine mode.
657 TYPE is the data type of the argument (as a tree).
658 This is null for libcalls where that information may
659 not be available.
660 CUM is a variable of type CUMULATIVE_ARGS which gives info about
661 the preceding args and about the function being called.
662 NAMED is nonzero if this argument is a named parameter
663 (otherwise it is an extra parameter matching an ellipsis). */
665 /* On the H8/300 all normal args are pushed, unless -mquickcall in which
666 case the first 3 arguments are passed in registers.
667 See function `function_arg'. */
669 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
670 function_arg (&CUM, MODE, TYPE, NAMED)
672 /* Output assembler code to FILE to increment profiler label # LABELNO
673 for profiling a function entry. */
675 #define FUNCTION_PROFILER(FILE, LABELNO) \
676 fprintf (FILE, "\t%s\t#LP%d,%s\n\tjsr @mcount\n", \
677 h8_mov_op, (LABELNO), h8_reg_names[0]);
679 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
680 the stack pointer does not matter. The value is tested only in
681 functions that have frame pointers.
682 No definition is equivalent to always zero. */
684 #define EXIT_IGNORE_STACK 0
686 /* Length in units of the trampoline for entering a nested function. */
688 #define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12)
690 /* Addressing modes, and classification of registers for them. */
692 #define HAVE_POST_INCREMENT 1
693 #define HAVE_PRE_DECREMENT 1
694 #define HAVE_POST_DECREMENT TARGET_H8300SX
695 #define HAVE_PRE_INCREMENT TARGET_H8300SX
697 /* Macros to check register numbers against specific register classes. */
699 /* These assume that REGNO is a hard or pseudo reg number.
700 They give nonzero only if REGNO is a hard reg of the suitable class
701 or a pseudo reg currently allocated to a suitable hard reg.
702 Since they use reg_renumber, they are safe only once reg_renumber
703 has been allocated, which happens in local-alloc.c. */
705 #define REGNO_OK_FOR_INDEX_P(regno) 0
707 #define REGNO_OK_FOR_BASE_P(regno) \
708 (((regno) < FIRST_PSEUDO_REGISTER && regno != MAC_REG) \
709 || reg_renumber[regno] >= 0)
711 /* Maximum number of registers that can appear in a valid memory address. */
713 #define MAX_REGS_PER_ADDRESS 1
715 /* 1 if X is an rtx for a constant that is a valid address. */
717 #define CONSTANT_ADDRESS_P(X) \
718 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
719 || (GET_CODE (X) == CONST_INT \
720 /* We handle signed and unsigned offsets here. */ \
721 && INTVAL (X) > (TARGET_H8300 ? -0x10000 : -0x1000000) \
722 && INTVAL (X) < (TARGET_H8300 ? 0x10000 : 0x1000000)) \
723 || (GET_CODE (X) == HIGH || GET_CODE (X) == CONST))
725 /* Nonzero if the constant value X is a legitimate general operand.
726 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
728 #define LEGITIMATE_CONSTANT_P(X) (h8300_legitimate_constant_p (X))
730 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
731 and check its validity for a certain class.
732 We have two alternate definitions for each of them.
733 The usual definition accepts all pseudo regs; the other rejects
734 them unless they have been allocated suitable hard regs.
735 The symbol REG_OK_STRICT causes the latter definition to be used.
737 Most source files want to accept pseudo regs in the hope that
738 they will get allocated to the class that the insn wants them to be in.
739 Source files for reload pass need to be strict.
740 After reload, it makes no difference, since pseudo regs have
741 been eliminated by then. */
743 /* Non-strict versions. */
744 #define REG_OK_FOR_INDEX_NONSTRICT_P(X) 0
745 /* Don't use REGNO_OK_FOR_BASE_P here because it uses reg_renumber. */
746 #define REG_OK_FOR_BASE_NONSTRICT_P(X) \
747 (REGNO (X) >= FIRST_PSEUDO_REGISTER || REGNO (X) != MAC_REG)
749 /* Strict versions. */
750 #define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
751 #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
753 #ifndef REG_OK_STRICT
755 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
756 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P (X)
758 #else
760 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X)
761 #define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
763 #endif
765 /* Extra constraints. */
767 #define OK_FOR_Q(OP) \
768 (TARGET_H8300SX && memory_operand ((OP), VOIDmode))
770 #define OK_FOR_R(OP) \
771 (GET_CODE (OP) == CONST_INT \
772 ? !h8300_shift_needs_scratch_p (INTVAL (OP), QImode) \
773 : 0)
775 #define OK_FOR_S(OP) \
776 (GET_CODE (OP) == CONST_INT \
777 ? !h8300_shift_needs_scratch_p (INTVAL (OP), HImode) \
778 : 0)
780 #define OK_FOR_T(OP) \
781 (GET_CODE (OP) == CONST_INT \
782 ? !h8300_shift_needs_scratch_p (INTVAL (OP), SImode) \
783 : 0)
785 /* 'U' if valid for a bset destination;
786 i.e. a register, register indirect, or the eightbit memory region
787 (a SYMBOL_REF with an SYMBOL_REF_FLAG set).
789 On the H8S 'U' can also be a 16bit or 32bit absolute. */
790 #define OK_FOR_U(OP) \
791 ((GET_CODE (OP) == REG && REG_OK_FOR_BASE_P (OP)) \
792 || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \
793 && REG_OK_FOR_BASE_P (XEXP (OP, 0))) \
794 || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF \
795 && TARGET_H8300S) \
796 || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == CONST \
797 && GET_CODE (XEXP (XEXP (OP, 0), 0)) == PLUS \
798 && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 0)) == SYMBOL_REF \
799 && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 1)) == CONST_INT \
800 && (TARGET_H8300S \
801 || SYMBOL_REF_FLAG (XEXP (XEXP (XEXP (OP, 0), 0), 0)))) \
802 || (GET_CODE (OP) == MEM \
803 && h8300_eightbit_constant_address_p (XEXP (OP, 0))) \
804 || (GET_CODE (OP) == MEM && (TARGET_H8300S || TARGET_H8300SX) \
805 && GET_CODE (XEXP (OP, 0)) == CONST_INT))
807 /* Multi-letter constraints starting with W are to be used for
808 operands that require a memory operand, i.e,. that are never used
809 along with register constraints (see EXTRA_MEMORY_CONSTRAINTS). */
811 #define OK_FOR_WU(OP) \
812 (GET_CODE (OP) == MEM && OK_FOR_U (OP))
814 #define OK_FOR_W(OP, STR) \
815 ((STR)[1] == 'U' ? OK_FOR_WU (OP) \
816 : 0)
818 #define CONSTRAINT_LEN_FOR_W(STR) \
819 ((STR)[1] == 'U' ? 2 \
820 : 0)
822 /* Multi-letter constraints starting with Y are to be used for operands
823 that are constant immediates and have single 1 or 0 in their binary
824 representation. */
826 #define OK_FOR_Y2(OP) \
827 ((GET_CODE (OP) == CONST_INT) && (exact_log2 (INTVAL (OP) & 0xff) != -1))
829 #define OK_FOR_Y0(OP) \
830 ((GET_CODE (OP) == CONST_INT) && (exact_log2 (~INTVAL (OP) & 0xff) != -1))
832 #define OK_FOR_Y(OP, STR) \
833 ((STR)[1] == '2' ? OK_FOR_Y2 (OP) \
834 : (STR)[1] == '0' ? OK_FOR_Y0 (OP) \
835 : 0)
837 #define CONSTRAINT_LEN_FOR_Y(STR) \
838 ((STR)[1] == '2' ? 2 \
839 : (STR)[1] == '0' ? 2 \
840 : 0)
842 #define OK_FOR_Z(OP) \
843 (TARGET_H8300SX \
844 && GET_CODE (OP) == MEM \
845 && CONSTANT_P (XEXP ((OP), 0)))
847 #define EXTRA_CONSTRAINT_STR(OP, C, STR) \
848 ((C) == 'Q' ? OK_FOR_Q (OP) : \
849 (C) == 'R' ? OK_FOR_R (OP) : \
850 (C) == 'S' ? OK_FOR_S (OP) : \
851 (C) == 'T' ? OK_FOR_T (OP) : \
852 (C) == 'U' ? OK_FOR_U (OP) : \
853 (C) == 'W' ? OK_FOR_W ((OP), (STR)) : \
854 (C) == 'Y' ? OK_FOR_Y ((OP), (STR)) : \
855 (C) == 'Z' ? OK_FOR_Z (OP) : \
858 #define CONSTRAINT_LEN(C, STR) \
859 ((C) == 'P' ? CONSTRAINT_LEN_FOR_P (STR) \
860 : (C) == 'W' ? CONSTRAINT_LEN_FOR_W (STR) \
861 : (C) == 'Y' ? CONSTRAINT_LEN_FOR_Y (STR) \
862 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
864 /* Experiments suggest that it's better not add 'Q' or 'U' here. No
865 patterns need it for correctness (no patterns use 'Q' and 'U'
866 without also providing a register alternative). And defining it
867 will mean that a spilled pseudo could be replaced by its frame
868 location in several consecutive insns.
870 Instead, it seems to be better to force pseudos to be reloaded
871 into registers and then use peepholes to recombine insns when
872 beneficial.
874 Unfortunately, for WU (unlike plain U, that matches regs as well),
875 we must require a memory address. In fact, all multi-letter
876 constraints started with W are supposed to have this property, so
877 we just test for W here. */
878 #define EXTRA_MEMORY_CONSTRAINT(C, STR) \
879 ((C) == 'W')
882 /* Go to LABEL if ADDR (a legitimate address expression)
883 has an effect that depends on the machine mode it is used for.
885 On the H8/300, the predecrement and postincrement address depend thus
886 (the amount of decrement or increment being the length of the operand). */
888 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
889 if (GET_CODE (ADDR) == PLUS \
890 && h8300_get_index (XEXP (ADDR, 0), VOIDmode, 0) != XEXP (ADDR, 0)) \
891 goto LABEL;
893 /* Specify the machine mode that this machine uses
894 for the index in the tablejump instruction. */
895 #define CASE_VECTOR_MODE Pmode
897 /* Define this as 1 if `char' should by default be signed; else as 0.
899 On the H8/300, sign extension is expensive, so we'll say that chars
900 are unsigned. */
901 #define DEFAULT_SIGNED_CHAR 0
903 /* This flag, if defined, says the same insns that convert to a signed fixnum
904 also convert validly to an unsigned one. */
905 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
907 /* Max number of bytes we can move from memory to memory
908 in one reasonably fast instruction. */
909 #define MOVE_MAX (TARGET_H8300H || TARGET_H8300S ? 4 : 2)
910 #define MAX_MOVE_MAX 4
912 /* Nonzero if access to memory by bytes is slow and undesirable. */
913 #define SLOW_BYTE_ACCESS TARGET_SLOWBYTE
915 /* Define if shifts truncate the shift count
916 which implies one can omit a sign-extension or zero-extension
917 of a shift count. */
918 /* #define SHIFT_COUNT_TRUNCATED */
920 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
921 is done just by pretending it is already truncated. */
922 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
924 /* Specify the machine mode that pointers have.
925 After generation of rtl, the compiler makes no further distinction
926 between pointers and any other objects of this machine mode. */
927 #define Pmode \
928 ((TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE ? SImode : HImode)
930 /* ANSI C types.
931 We use longs for the H8/300H and the H8S because ints can be 16 or 32.
932 GCC requires SIZE_TYPE to be the same size as pointers. */
933 #define SIZE_TYPE \
934 (TARGET_H8300 || TARGET_NORMAL_MODE ? TARGET_INT32 ? "short unsigned int" : "unsigned int" : "long unsigned int")
935 #define PTRDIFF_TYPE \
936 (TARGET_H8300 || TARGET_NORMAL_MODE ? TARGET_INT32 ? "short int" : "int" : "long int")
938 #define POINTER_SIZE \
939 ((TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE ? 32 : 16)
941 #define WCHAR_TYPE "short unsigned int"
942 #define WCHAR_TYPE_SIZE 16
944 /* A function address in a call instruction
945 is a byte address (for indexing purposes)
946 so give the MEM rtx a byte's mode. */
947 #define FUNCTION_MODE QImode
949 /* Return the length of JUMP's delay slot insn (0 if it has none).
950 If JUMP is a delayed branch, NEXT_INSN (PREV_INSN (JUMP)) will
951 be the containing SEQUENCE, not JUMP itself. */
952 #define DELAY_SLOT_LENGTH(JUMP) \
953 (NEXT_INSN (PREV_INSN (JUMP)) == JUMP ? 0 : 2)
955 #define BRANCH_COST(speed_p, predictable_p) 0
957 /* Tell final.c how to eliminate redundant test instructions. */
959 /* Here we define machine-dependent flags and fields in cc_status
960 (see `conditions.h'). No extra ones are needed for the h8300. */
962 /* Store in cc_status the expressions
963 that the condition codes will describe
964 after execution of an instruction whose pattern is EXP.
965 Do not alter them if the instruction would not alter the cc's. */
967 #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc (EXP, INSN)
969 /* The add insns don't set overflow in a usable way. */
970 #define CC_OVERFLOW_UNUSABLE 01000
971 /* The mov,and,or,xor insns don't set carry. That's OK though as the
972 Z bit is all we need when doing unsigned comparisons on the result of
973 these insns (since they're always with 0). However, conditions.h has
974 CC_NO_OVERFLOW defined for this purpose. Rename it to something more
975 understandable. */
976 #define CC_NO_CARRY CC_NO_OVERFLOW
978 /* Control the assembler format that we output. */
980 /* Output to assembler file text saying following lines
981 may contain character constants, extra white space, comments, etc. */
983 #define ASM_APP_ON "; #APP\n"
985 /* Output to assembler file text saying following lines
986 no longer contain unusual constructs. */
988 #define ASM_APP_OFF "; #NO_APP\n"
990 #define FILE_ASM_OP "\t.file\n"
992 /* The assembler op to get a word, 2 bytes for the H8/300, 4 for H8/300H. */
993 #define ASM_WORD_OP \
994 (TARGET_H8300 || TARGET_NORMAL_MODE ? "\t.word\t" : "\t.long\t")
996 #define TEXT_SECTION_ASM_OP "\t.section .text"
997 #define DATA_SECTION_ASM_OP "\t.section .data"
998 #define BSS_SECTION_ASM_OP "\t.section .bss"
1000 #undef DO_GLOBAL_CTORS_BODY
1001 #define DO_GLOBAL_CTORS_BODY \
1003 extern func_ptr __ctors[]; \
1004 extern func_ptr __ctors_end[]; \
1005 func_ptr *p; \
1006 for (p = __ctors_end; p > __ctors; ) \
1008 (*--p)(); \
1012 #undef DO_GLOBAL_DTORS_BODY
1013 #define DO_GLOBAL_DTORS_BODY \
1015 extern func_ptr __dtors[]; \
1016 extern func_ptr __dtors_end[]; \
1017 func_ptr *p; \
1018 for (p = __dtors; p < __dtors_end; p++) \
1020 (*p)(); \
1024 /* How to refer to registers in assembler output.
1025 This sequence is indexed by compiler's hard-register-number (see above). */
1027 #define REGISTER_NAMES \
1028 { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "mac", "ap", "rap", "fp" }
1030 #define ADDITIONAL_REGISTER_NAMES \
1031 { {"er0", 0}, {"er1", 1}, {"er2", 2}, {"er3", 3}, {"er4", 4}, \
1032 {"er5", 5}, {"er6", 6}, {"er7", 7}, {"r7", 7} }
1034 /* Globalizing directive for a label. */
1035 #define GLOBAL_ASM_OP "\t.global "
1037 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
1038 ASM_OUTPUT_LABEL (FILE, NAME)
1040 /* The prefix to add to user-visible assembler symbols. */
1042 #define USER_LABEL_PREFIX "_"
1044 /* This is how to store into the string LABEL
1045 the symbol_ref name of an internal numbered label where
1046 PREFIX is the class of label and NUM is the number within the class.
1047 This is suitable for output with `assemble_name'.
1049 N.B.: The h8300.md branch_true and branch_false patterns also know
1050 how to generate internal labels. */
1051 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
1052 sprintf (LABEL, "*.%s%lu", PREFIX, (unsigned long)(NUM))
1054 /* This is how to output an insn to push a register on the stack.
1055 It need not be very fast code. */
1057 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \
1058 fprintf (FILE, "\t%s\t%s\n", h8_push_op, h8_reg_names[REGNO])
1060 /* This is how to output an insn to pop a register from the stack.
1061 It need not be very fast code. */
1063 #define ASM_OUTPUT_REG_POP(FILE, REGNO) \
1064 fprintf (FILE, "\t%s\t%s\n", h8_pop_op, h8_reg_names[REGNO])
1066 /* This is how to output an element of a case-vector that is absolute. */
1068 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1069 fprintf (FILE, "%s.L%d\n", ASM_WORD_OP, VALUE)
1071 /* This is how to output an element of a case-vector that is relative. */
1073 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1074 fprintf (FILE, "%s.L%d-.L%d\n", ASM_WORD_OP, VALUE, REL)
1076 /* This is how to output an assembler line
1077 that says to advance the location counter
1078 to a multiple of 2**LOG bytes. */
1080 #define ASM_OUTPUT_ALIGN(FILE, LOG) \
1081 if ((LOG) != 0) \
1082 fprintf (FILE, "\t.align %d\n", (LOG))
1084 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
1085 fprintf (FILE, "\t.space %d\n", (int)(SIZE))
1087 /* This says how to output an assembler line
1088 to define a global common symbol. */
1090 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
1091 ( fputs ("\t.comm ", (FILE)), \
1092 assemble_name ((FILE), (NAME)), \
1093 fprintf ((FILE), ",%lu\n", (unsigned long)(SIZE)))
1095 /* This says how to output the assembler to define a global
1096 uninitialized but not common symbol.
1097 Try to use asm_output_bss to implement this macro. */
1099 #define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED) \
1100 asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
1102 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
1103 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
1105 /* This says how to output an assembler line
1106 to define a local common symbol. */
1108 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
1109 ( fputs ("\t.lcomm ", (FILE)), \
1110 assemble_name ((FILE), (NAME)), \
1111 fprintf ((FILE), ",%d\n", (int)(SIZE)))
1113 #define ASM_PN_FORMAT "%s___%lu"
1115 /* Print an instruction operand X on file FILE.
1116 Look in h8300.c for details. */
1118 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
1119 ((CODE) == '#')
1121 #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
1123 /* Print a memory operand whose address is X, on file FILE.
1124 This uses a function in h8300.c. */
1126 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
1128 /* H8300 specific pragmas. */
1129 #define REGISTER_TARGET_PRAGMAS() \
1130 do \
1132 c_register_pragma (0, "saveall", h8300_pr_saveall); \
1133 c_register_pragma (0, "interrupt", h8300_pr_interrupt); \
1135 while (0)
1137 #define FINAL_PRESCAN_INSN(insn, operand, nop) \
1138 final_prescan_insn (insn, operand, nop)
1140 extern int h8300_move_ratio;
1141 #define MOVE_RATIO(speed) h8300_move_ratio
1143 /* Machine-specific symbol_ref flags. */
1144 #define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
1145 #define SYMBOL_FLAG_EIGHTBIT_DATA (SYMBOL_FLAG_MACH_DEP << 1)
1146 #define SYMBOL_FLAG_TINY_DATA (SYMBOL_FLAG_MACH_DEP << 2)
1148 #endif /* ! GCC_H8300_H */