Updated sources with changes from devo.
[official-gcc.git] / gcc / config / arm / arm.h
blobf47f653da9bc09f062317f59d31e630622e8b10a
1 /* Definitions of target machine for GNU compiler, for Acorn RISC Machine.
2 Copyright (C) 1991, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
3 Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
4 and Martin Simmons (@harleqn.co.uk).
5 More major hacks by Richard Earnshaw (rwe11@cl.cam.ac.uk)
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 /* Configuration triples for ARM ports work as follows:
25 (This is a bit of a mess and needs some thought)
26 arm-*-*: little endian
27 armel-*-*: little endian
28 armeb-*-*: big endian
29 If a non-embedded environment (ie: "real" OS) is specified, `arm'
30 should default to that used by the OS.
33 #ifndef __ARM_H__
34 #define __ARM_H__
36 #define TARGET_CPU_arm2 0x0000
37 #define TARGET_CPU_arm250 0x0000
38 #define TARGET_CPU_arm3 0x0000
39 #define TARGET_CPU_arm6 0x0001
40 #define TARGET_CPU_arm600 0x0001
41 #define TARGET_CPU_arm610 0x0002
42 #define TARGET_CPU_arm7 0x0001
43 #define TARGET_CPU_arm7m 0x0004
44 #define TARGET_CPU_arm7dm 0x0004
45 #define TARGET_CPU_arm7dmi 0x0004
46 #define TARGET_CPU_arm700 0x0001
47 #define TARGET_CPU_arm710 0x0002
48 #define TARGET_CPU_arm7100 0x0002
49 #define TARGET_CPU_arm7500 0x0002
50 #define TARGET_CPU_arm7500fe 0x1001
51 #define TARGET_CPU_arm7tdmi 0x0008
52 #define TARGET_CPU_arm8 0x0010
53 #define TARGET_CPU_arm810 0x0020
54 #define TARGET_CPU_strongarm 0x0040
55 #define TARGET_CPU_strongarm110 0x0040
56 /* Configure didn't specify */
57 #define TARGET_CPU_generic 0x8000
59 enum arm_cond_code
61 ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC,
62 ARM_HI, ARM_LS, ARM_GE, ARM_LT, ARM_GT, ARM_LE, ARM_AL, ARM_NV
64 extern enum arm_cond_code arm_current_cc;
65 extern char *arm_condition_codes[];
67 #define ARM_INVERSE_CONDITION_CODE(X) ((enum arm_cond_code) (((int)X) ^ 1))
69 /* This is needed by the tail-calling peepholes */
70 extern int frame_pointer_needed;
73 /* Just in case configure has failed to define anything. */
74 #ifndef TARGET_CPU_DEFAULT
75 #define TARGET_CPU_DEFAULT TARGET_CPU_generic
76 #endif
78 /* If the configuration file doesn't specify the cpu, the subtarget may
79 override it. If it doesn't, then default to an ARM6. */
80 #if TARGET_CPU_DEFAULT == TARGET_CPU_generic
81 #undef TARGET_CPU_DEFAULT
82 #ifdef SUBTARGET_CPU_DEFAULT
83 #define TARGET_CPU_DEFAULT SUBTARGET_CPU_DEFAULT
84 #else
85 #define TARGET_CPU_DEFAULT TARGET_CPU_arm6
86 #endif
87 #endif
89 #if TARGET_CPU_DEFAULT == TARGET_CPU_arm2
90 #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_2__"
91 #else
92 #if TARGET_CPU_DEFAULT == TARGET_CPU_arm6 || TARGET_CPU_DEFAULT == TARGET_CPU_arm610 || TARGET_CPU_DEFAULT == TARGET_CPU_arm7500fe
93 #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_3__"
94 #else
95 #if TARGET_CPU_DEFAULT == TARGET_CPU_arm7m
96 #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_3M__"
97 #else
98 #if TARGET_CPU_DEFAULT == TARGET_CPU_arm7tdmi
99 #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_4T__"
100 #else
101 #if TARGET_CPU_DEFAULT == TARGET_CPU_arm8 || TARGET_CPU_DEFAULT == TARGET_CPU_arm810 || TARGET_CPU_DEFAULT == TARGET_CPU_strongarm
102 #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_4__"
103 #else
104 Unrecognized value in TARGET_CPU_DEFAULT.
105 #endif
106 #endif
107 #endif
108 #endif
109 #endif
111 #ifndef CPP_PREDEFINES
112 #define CPP_PREDEFINES "-Darm -Acpu(arm) -Amachine(arm)"
113 #endif
115 #define CPP_SPEC "\
116 %(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) \
117 %(cpp_endian) %(subtarget_cpp_spec)"
119 /* Set the architecture define -- if -march= is set, then it overrides
120 the -mcpu= setting. */
121 #define CPP_CPU_ARCH_SPEC "\
122 %{m2:-D__arm2__ -D__ARM_ARCH_2__} \
123 %{m3:-D__arm2__ -D__ARM_ARCH_2__} \
124 %{m6:-D__arm6__ -D__ARM_ARCH_3__} \
125 %{march=arm2:-D__ARM_ARCH_2__} \
126 %{march=arm250:-D__ARM_ARCH_2__} \
127 %{march=arm3:-D__ARM_ARCH_2__} \
128 %{march=arm6:-D__ARM_ARCH_3__} \
129 %{march=arm600:-D__ARM_ARCH_3__} \
130 %{march=arm610:-D__ARM_ARCH_3__} \
131 %{march=arm7:-D__ARM_ARCH_3__} \
132 %{march=arm700:-D__ARM_ARCH_3__} \
133 %{march=arm710:-D__ARM_ARCH_3__} \
134 %{march=arm7100:-D__ARM_ARCH_3__} \
135 %{march=arm7500:-D__ARM_ARCH_3__} \
136 %{march=arm7500fe:-D__ARM_ARCH_3__} \
137 %{march=arm7m:-D__ARM_ARCH_3M__} \
138 %{march=arm7dm:-D__ARM_ARCH_3M__} \
139 %{march=arm7dmi:-D__ARM_ARCH_3M__} \
140 %{march=arm7tdmi:-D__ARM_ARCH_4T__} \
141 %{march=arm8:-D__ARM_ARCH_4__} \
142 %{march=arm810:-D__ARM_ARCH_4__} \
143 %{march=strongarm:-D__ARM_ARCH_4__} \
144 %{march=strongarm110:-D__ARM_ARCH_4__} \
145 %{march=armv2:-D__ARM_ARCH_2__} \
146 %{march=armv2a:-D__ARM_ARCH_2__} \
147 %{march=armv3:-D__ARM_ARCH_3__} \
148 %{march=armv3m:-D__ARM_ARCH_3M__} \
149 %{march=armv4:-D__ARM_ARCH_4__} \
150 %{march=armv4t:-D__ARM_ARCH_4T__} \
151 %{!march=*: \
152 %{mcpu=arm2:-D__ARM_ARCH_2__} \
153 %{mcpu=arm250:-D__ARM_ARCH_2__} \
154 %{mcpu=arm3:-D__ARM_ARCH_2__} \
155 %{mcpu=arm6:-D__ARM_ARCH_3__} \
156 %{mcpu=arm600:-D__ARM_ARCH_3__} \
157 %{mcpu=arm610:-D__ARM_ARCH_3__} \
158 %{mcpu=arm7:-D__ARM_ARCH_3__} \
159 %{mcpu=arm700:-D__ARM_ARCH_3__} \
160 %{mcpu=arm710:-D__ARM_ARCH_3__} \
161 %{mcpu=arm7100:-D__ARM_ARCH_3__} \
162 %{mcpu=arm7500:-D__ARM_ARCH_3__} \
163 %{mcpu=arm7500fe:-D__ARM_ARCH_3__} \
164 %{mcpu=arm7m:-D__ARM_ARCH_3M__} \
165 %{mcpu=arm7dm:-D__ARM_ARCH_3M__} \
166 %{mcpu=arm7dmi:-D__ARM_ARCH_3M__} \
167 %{mcpu=arm7tdmi:-D__ARM_ARCH_4T__} \
168 %{mcpu=arm8:-D__ARM_ARCH_4__} \
169 %{mcpu=arm810:-D__ARM_ARCH_4__} \
170 %{mcpu=strongarm:-D__ARM_ARCH_4__} \
171 %{mcpu=strongarm110:-D__ARM_ARCH_4__} \
172 %{!mcpu*:%{!m6:%{!m2:%{!m3:%(cpp_cpu_arch_default)}}}}} \
175 /* Define __APCS_26__ if the PC also contains the PSR */
176 /* This also examines deprecated -m[236] if neither of -mapcs-{26,32} is set,
177 ??? Delete this for 2.9. */
178 #define CPP_APCS_PC_SPEC "\
179 %{mapcs-32:%{mapcs-26:%e-mapcs-26 and -mapcs-32 may not be used together} \
180 -D__APCS_32__} \
181 %{mapcs-26:-D__APCS_26__} \
182 %{!mapcs-32: %{!mapcs-26:%{m6:-D__APCS_32__} %{m2:-D__APCS_26__} \
183 %{m3:-D__APCS_26__} %{!m6:%{!m3:%{!m2:%(cpp_apcs_pc_default)}}}}} \
186 #ifndef CPP_APCS_PC_DEFAULT_SPEC
187 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_26__"
188 #endif
190 #define CPP_FLOAT_SPEC "\
191 %{msoft-float:\
192 %{mhard-float:%e-msoft-float and -mhard_float may not be used together} \
193 -D__SOFTFP__} \
194 %{!mhard-float:%{!msoft-float:%(cpp_float_default)}} \
197 /* Default is hard float, which doesn't define anything */
198 #define CPP_FLOAT_DEFAULT_SPEC ""
200 #define CPP_ENDIAN_SPEC "\
201 %{mbig-endian: \
202 %{mlittle-endian: \
203 %e-mbig-endian and -mlittle-endian may not be used together} \
204 -D__ARMEB__ %{mwords-little-endian:-D__ARMWEL__}} \
205 %{!mlittle-endian:%{!mbig-endian:%(cpp_endian_default)}} \
208 /* Default is little endian, which doesn't define anything. */
209 #define CPP_ENDIAN_DEFAULT_SPEC ""
211 /* Translate (for now) the old -m[236] option into the appropriate -mcpu=...
212 and -mapcs-xx equivalents.
213 ??? Remove support for this style in 2.9.*/
214 #define CC1_SPEC "\
215 %{m2:-mcpu=arm2 -mapcs-26} \
216 %{m3:-mcpu=arm3 -mapcs-26} \
217 %{m6:-mcpu=arm6 -mapcs-32} \
220 /* This macro defines names of additional specifications to put in the specs
221 that can be used in various specifications like CC1_SPEC. Its definition
222 is an initializer with a subgrouping for each command option.
224 Each subgrouping contains a string constant, that defines the
225 specification name, and a string constant that used by the GNU CC driver
226 program.
228 Do not define this macro if it does not need to do anything. */
229 #define EXTRA_SPECS \
230 { "cpp_cpu_arch", CPP_CPU_ARCH_SPEC }, \
231 { "cpp_cpu_arch_default", CPP_ARCH_DEFAULT_SPEC }, \
232 { "cpp_apcs_pc", CPP_APCS_PC_SPEC }, \
233 { "cpp_apcs_pc_default", CPP_APCS_PC_DEFAULT_SPEC }, \
234 { "cpp_float", CPP_FLOAT_SPEC }, \
235 { "cpp_float_default", CPP_FLOAT_DEFAULT_SPEC }, \
236 { "cpp_endian", CPP_ENDIAN_SPEC }, \
237 { "cpp_endian_default", CPP_ENDIAN_DEFAULT_SPEC }, \
238 { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \
239 SUBTARGET_EXTRA_SPECS
241 #define SUBTARGET_EXTRA_SPECS
242 #define SUBTARGET_CPP_SPEC ""
245 /* Run-time Target Specification. */
246 #ifndef TARGET_VERSION
247 #define TARGET_VERSION \
248 fputs (" (ARM/generic)", stderr);
249 #endif
251 /* Run-time compilation parameters selecting different hardware subsets. */
252 extern int target_flags;
254 /* The floating point instruction architecture, can be 2 or 3 */
255 extern char *target_fp_name;
257 /* Nonzero if the function prologue (and epilogue) should obey
258 the ARM Procedure Call Standard. */
259 #define ARM_FLAG_APCS_FRAME (0x0001)
261 /* Nonzero if the function prologue should output the function name to enable
262 the post mortem debugger to print a backtrace (very useful on RISCOS,
263 unused on RISCiX). Specifying this flag also enables
264 -fno-omit-frame-pointer.
265 XXX Must still be implemented in the prologue. */
266 #define ARM_FLAG_POKE (0x0002)
268 /* Nonzero if floating point instructions are emulated by the FPE, in which
269 case instruction scheduling becomes very uninteresting. */
270 #define ARM_FLAG_FPE (0x0004)
272 /* Nonzero if destined for an ARM6xx. Takes out bits that assume restoration
273 of condition flags when returning from a branch & link (ie. a function) */
274 /* ********* DEPRECATED ******** */
275 #define ARM_FLAG_ARM6 (0x0008)
277 /* ********* DEPRECATED ******** */
278 #define ARM_FLAG_ARM3 (0x0010)
280 /* Nonzero if destined for a processor in 32-bit program mode. Takes out bit
281 that assume restoration of the condition flags when returning from a
282 branch and link (ie a function). */
283 #define ARM_FLAG_APCS_32 (0x0020)
285 /* Nonzero if stack checking should be performed on entry to each function
286 which allocates temporary variables on the stack. */
287 #define ARM_FLAG_APCS_STACK (0x0040)
289 /* Nonzero if floating point parameters should be passed to functions in
290 floating point registers. */
291 #define ARM_FLAG_APCS_FLOAT (0x0080)
293 /* Nonzero if re-entrant, position independent code should be generated.
294 This is equivalent to -fpic. */
295 #define ARM_FLAG_APCS_REENT (0x0100)
297 /* Nonzero if the MMU will trap unaligned word accesses, so shorts must be
298 loaded byte-at-a-time. */
299 #define ARM_FLAG_SHORT_BYTE (0x0200)
301 /* Nonzero if all floating point instructions are missing (and there is no
302 emulator either). Generate function calls for all ops in this case. */
303 #define ARM_FLAG_SOFT_FLOAT (0x0400)
305 /* Nonzero if we should compile with BYTES_BIG_ENDIAN set to 1. */
306 #define ARM_FLAG_BIG_END (0x0800)
308 /* Nonzero if we should compile for Thumb interworking. */
309 #define ARM_FLAG_THUMB (0x1000)
311 /* Nonzero if we should have little-endian words even when compiling for
312 big-endian (for backwards compatibility with older versions of GCC). */
313 #define ARM_FLAG_LITTLE_WORDS (0x2000)
315 #define TARGET_APCS (target_flags & ARM_FLAG_APCS_FRAME)
316 #define TARGET_POKE_FUNCTION_NAME (target_flags & ARM_FLAG_POKE)
317 #define TARGET_FPE (target_flags & ARM_FLAG_FPE)
318 #define TARGET_6 (target_flags & ARM_FLAG_ARM6)
319 #define TARGET_3 (target_flags & ARM_FLAG_ARM3)
320 #define TARGET_APCS_32 (target_flags & ARM_FLAG_APCS_32)
321 #define TARGET_APCS_STACK (target_flags & ARM_FLAG_APCS_STACK)
322 #define TARGET_APCS_FLOAT (target_flags & ARM_FLAG_APCS_FLOAT)
323 #define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT)
324 #define TARGET_SHORT_BY_BYTES (target_flags & ARM_FLAG_SHORT_BYTE)
325 #define TARGET_SOFT_FLOAT (target_flags & ARM_FLAG_SOFT_FLOAT)
326 #define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)
327 #define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END)
328 #define TARGET_THUMB_INTERWORK (target_flags & ARM_FLAG_THUMB)
329 #define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS)
331 /* SUBTARGET_SWITCHES is used to add flags on a per-config basis.
332 Bit 31 is reserved. See riscix.h. */
333 #ifndef SUBTARGET_SWITCHES
334 #define SUBTARGET_SWITCHES
335 #endif
337 #define TARGET_SWITCHES \
339 {"apcs", ARM_FLAG_APCS_FRAME, "" }, \
340 {"apcs-frame", ARM_FLAG_APCS_FRAME, \
341 "Generate APCS conformant stack frames" }, \
342 {"no-apcs-frame", -ARM_FLAG_APCS_FRAME, "" }, \
343 {"poke-function-name", ARM_FLAG_POKE, \
344 "Store function names in object code" }, \
345 {"fpe", ARM_FLAG_FPE, "" }, \
346 {"6", ARM_FLAG_ARM6, "" }, \
347 {"2", ARM_FLAG_ARM3, "" }, \
348 {"3", ARM_FLAG_ARM3, "" }, \
349 {"apcs-32", ARM_FLAG_APCS_32, \
350 "Use the 32bit version of the APCS" }, \
351 {"apcs-26", -ARM_FLAG_APCS_32, \
352 "Use the 26bit version of the APCS" }, \
353 {"apcs-stack-check", ARM_FLAG_APCS_STACK, "" }, \
354 {"no-apcs-stack-check", -ARM_FLAG_APCS_STACK, "" }, \
355 {"apcs-float", ARM_FLAG_APCS_FLOAT, \
356 "Pass FP arguments in FP registers" }, \
357 {"no-apcs-float", -ARM_FLAG_APCS_FLOAT, "" }, \
358 {"apcs-reentrant", ARM_FLAG_APCS_REENT, \
359 "Generate re-entrant, PIC code" }, \
360 {"no-apcs-reentrant", -ARM_FLAG_APCS_REENT, "" }, \
361 {"short-load-bytes", ARM_FLAG_SHORT_BYTE, \
362 "Load shorts a byte at a time" }, \
363 {"no-short-load-bytes", -ARM_FLAG_SHORT_BYTE, "" }, \
364 {"short-load-words", -ARM_FLAG_SHORT_BYTE, \
365 "Load words a byte at a time" }, \
366 {"no-short-load-words", ARM_FLAG_SHORT_BYTE, "" }, \
367 {"soft-float", ARM_FLAG_SOFT_FLOAT, \
368 "Use library calls to perform FP operations" }, \
369 {"hard-float", -ARM_FLAG_SOFT_FLOAT, \
370 "Use hardware floating point instructions" }, \
371 {"big-endian", ARM_FLAG_BIG_END, \
372 "Assume target CPU is configured as big endian" }, \
373 {"little-endian", -ARM_FLAG_BIG_END, \
374 "Assume target CPU is configured as little endian" }, \
375 {"words-little-endian", ARM_FLAG_LITTLE_WORDS, \
376 "Assume big endian bytes, little endian words" }, \
377 {"thumb-interwork", ARM_FLAG_THUMB, \
378 "Support calls between THUMB and ARM instructions sets" }, \
379 {"no-thumb-interwork", -ARM_FLAG_THUMB, "" }, \
380 SUBTARGET_SWITCHES \
381 {"", TARGET_DEFAULT } \
384 #define TARGET_OPTIONS \
386 {"cpu=", & arm_select[1].string, "Specify the name of the target CPU" }, \
387 {"arch=", & arm_select[2].string, "Specify the name of the target architecture" }, \
388 {"tune=", & arm_select[3].string, "" }, \
389 {"fp=", & target_fp_name, "Specify the version of the floating point emulator"}, \
390 { "structure-size-boundary=", & structure_size_string, \
391 "Specify the minumum bit alignment of structures" } \
394 /* arm_select[0] is reserved for the default cpu. */
395 struct arm_cpu_select
397 char *string;
398 char *name;
399 int set_tune_p;
400 int set_arch_p;
403 extern struct arm_cpu_select arm_select[];
405 #ifndef PROCESSOR_DEFAULT
406 #define PROCESSOR_DEFAULT PROCESSOR_ARM2
407 #endif
409 #ifndef TARGET_CPU_DEFAULT
410 #define TARGET_CPU_DEFAULT ((char *) 0)
411 #endif
413 /* Which processor we are running on, for instruction scheduling
414 purposes. */
415 enum processor_type
417 PROCESSOR_ARM2,
418 PROCESSOR_ARM3,
419 PROCESSOR_ARM6,
420 PROCESSOR_ARM7,
421 PROCESSOR_ARM8,
422 PROCESSOR_STARM,
423 PROCESSOR_NONE /* NOTE: This must be last, since it doesn't
424 appear in the attr_cpu list */
427 /* Recast the cpu class to be the cpu attribute. */
428 #define arm_cpu_attr ((enum attr_cpu)arm_cpu)
430 extern enum processor_type arm_cpu;
432 enum prog_mode_type
434 prog_mode26,
435 prog_mode32
438 /* Recast the program mode class to be the prog_mode attribute */
439 #define arm_prog_mode ((enum attr_prog_mode) arm_prgmode)
441 extern enum prog_mode_type arm_prgmode;
443 /* What sort of floating point unit do we have? Hardware or software.
444 If software, is it issue 2 or issue 3? */
445 enum floating_point_type
447 FP_HARD,
448 FP_SOFT2,
449 FP_SOFT3
452 /* Recast the floating point class to be the floating point attribute. */
453 #define arm_fpu_attr ((enum attr_fpu) arm_fpu)
455 /* What type of floating point to tune for */
456 extern enum floating_point_type arm_fpu;
458 /* What type of floating point instructions are available */
459 extern enum floating_point_type arm_fpu_arch;
461 /* Default floating point architecture. Override in sub-target if
462 necessary. */
463 #define FP_DEFAULT FP_SOFT2
465 /* Nonzero if the processor has a fast multiply insn, and one that does
466 a 64-bit multiply of two 32-bit values. */
467 extern int arm_fast_multiply;
469 /* Nonzero if this chip supports the ARM Architecture 4 extensions */
470 extern int arm_arch4;
472 #ifndef TARGET_DEFAULT
473 #define TARGET_DEFAULT 0
474 #endif
476 /* The frame pointer register used in gcc has nothing to do with debugging;
477 that is controlled by the APCS-FRAME option. */
478 /* Not fully implemented yet */
479 /* #define CAN_DEBUG_WITHOUT_FP 1 */
481 #define TARGET_MEM_FUNCTIONS 1
483 #define OVERRIDE_OPTIONS arm_override_options ()
485 /* Target machine storage Layout. */
488 /* Define this macro if it is advisable to hold scalars in registers
489 in a wider mode than that declared by the program. In such cases,
490 the value is constrained to be within the bounds of the declared
491 type, but kept valid in the wider mode. The signedness of the
492 extension may differ from that of the type. */
494 /* It is far faster to zero extend chars than to sign extend them */
496 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
497 if (GET_MODE_CLASS (MODE) == MODE_INT \
498 && GET_MODE_SIZE (MODE) < 4) \
500 if (MODE == QImode) \
501 UNSIGNEDP = 1; \
502 else if (MODE == HImode) \
503 UNSIGNEDP = TARGET_SHORT_BY_BYTES != 0; \
504 (MODE) = SImode; \
507 /* Define this macro if the promotion described by `PROMOTE_MODE'
508 should also be done for outgoing function arguments. */
509 /* This is required to ensure that push insns always push a word. */
510 #define PROMOTE_FUNCTION_ARGS
512 /* Define for XFmode extended real floating point support.
513 This will automatically cause REAL_ARITHMETIC to be defined. */
514 /* For the ARM:
515 I think I have added all the code to make this work. Unfortunately,
516 early releases of the floating point emulation code on RISCiX used a
517 different format for extended precision numbers. On my RISCiX box there
518 is a bug somewhere which causes the machine to lock up when running enquire
519 with long doubles. There is the additional aspect that Norcroft C
520 treats long doubles as doubles and we ought to remain compatible.
521 Perhaps someone with an FPA coprocessor and not running RISCiX would like
522 to try this someday. */
523 /* #define LONG_DOUBLE_TYPE_SIZE 96 */
525 /* Disable XFmode patterns in md file */
526 #define ENABLE_XF_PATTERNS 0
528 /* Define if you don't want extended real, but do want to use the
529 software floating point emulator for REAL_ARITHMETIC and
530 decimal <-> binary conversion. */
531 /* See comment above */
532 #define REAL_ARITHMETIC
534 /* Define this if most significant bit is lowest numbered
535 in instructions that operate on numbered bit-fields. */
536 #define BITS_BIG_ENDIAN 0
538 /* Define this if most significant byte of a word is the lowest numbered.
539 Most ARM processors are run in little endian mode, so that is the default.
540 If you want to have it run-time selectable, change the definition in a
541 cover file to be TARGET_BIG_ENDIAN. */
542 #define BYTES_BIG_ENDIAN (TARGET_BIG_END != 0)
544 /* Define this if most significant word of a multiword number is the lowest
545 numbered.
546 This is always false, even when in big-endian mode. */
547 #define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN && ! TARGET_LITTLE_WORDS)
549 /* LIBGCC2_WORDS_BIG_ENDIAN has to be a constant, so we define this based
550 on processor pre-defineds when compiling libgcc2.c. */
551 #if defined(__ARMEB__) && !defined(__ARMWEL__)
552 #define LIBGCC2_WORDS_BIG_ENDIAN 1
553 #else
554 #define LIBGCC2_WORDS_BIG_ENDIAN 0
555 #endif
557 /* Define this if most significant word of doubles is the lowest numbered.
558 This is always true, even when in little-endian mode. */
559 #define FLOAT_WORDS_BIG_ENDIAN 1
561 /* Number of bits in an addressable storage unit */
562 #define BITS_PER_UNIT 8
564 #define BITS_PER_WORD 32
566 #define UNITS_PER_WORD 4
568 #define POINTER_SIZE 32
570 #define PARM_BOUNDARY 32
572 #define STACK_BOUNDARY 32
574 #define FUNCTION_BOUNDARY 32
576 #define EMPTY_FIELD_BOUNDARY 32
578 #define BIGGEST_ALIGNMENT 32
580 /* Make strings word-aligned so strcpy from constants will be faster. */
581 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
582 (TREE_CODE (EXP) == STRING_CST \
583 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
585 /* Every structures size must be a multiple of 32 bits. */
586 /* This is for compatibility with ARMCC. ARM SDT Reference Manual
587 (ARM DUI 0020D) page 2-20 says "Structures are aligned on word
588 boundaries". */
589 #ifndef STRUCTURE_SIZE_BOUNDARY
590 #define STRUCTURE_SIZE_BOUNDARY 32
591 #endif
593 /* Used when parsing command line option -mstructure_size_boundary. */
594 extern char * structure_size_string;
596 /* Non-zero if move instructions will actually fail to work
597 when given unaligned data. */
598 #define STRICT_ALIGNMENT 1
600 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
603 /* Standard register usage. */
605 /* Register allocation in ARM Procedure Call Standard (as used on RISCiX):
606 (S - saved over call).
608 r0 * argument word/integer result
609 r1-r3 argument word
611 r4-r8 S register variable
612 r9 S (rfp) register variable (real frame pointer)
614 r10 F S (sl) stack limit (not currently used)
615 r11 F S (fp) argument pointer
616 r12 (ip) temp workspace
617 r13 F S (sp) lower end of current stack frame
618 r14 (lr) link address/workspace
619 r15 F (pc) program counter
621 f0 floating point result
622 f1-f3 floating point scratch
624 f4-f7 S floating point variable
626 cc This is NOT a real register, but is used internally
627 to represent things that use or set the condition
628 codes.
629 sfp This isn't either. It is used during rtl generation
630 since the offset between the frame pointer and the
631 auto's isn't known until after register allocation.
632 afp Nor this, we only need this because of non-local
633 goto. Without it fp appears to be used and the
634 elimination code won't get rid of sfp. It tracks
635 fp exactly at all times.
637 *: See CONDITIONAL_REGISTER_USAGE */
639 /* The stack backtrace structure is as follows:
640 fp points to here: | save code pointer | [fp]
641 | return link value | [fp, #-4]
642 | return sp value | [fp, #-8]
643 | return fp value | [fp, #-12]
644 [| saved r10 value |]
645 [| saved r9 value |]
646 [| saved r8 value |]
647 [| saved r7 value |]
648 [| saved r6 value |]
649 [| saved r5 value |]
650 [| saved r4 value |]
651 [| saved r3 value |]
652 [| saved r2 value |]
653 [| saved r1 value |]
654 [| saved r0 value |]
655 [| saved f7 value |] three words
656 [| saved f6 value |] three words
657 [| saved f5 value |] three words
658 [| saved f4 value |] three words
659 r0-r3 are not normally saved in a C function. */
661 /* The number of hard registers is 16 ARM + 8 FPU + 1 CC + 1 SFP. */
662 #define FIRST_PSEUDO_REGISTER 27
664 /* 1 for registers that have pervasive standard uses
665 and are not available for the register allocator. */
666 #define FIXED_REGISTERS \
668 0,0,0,0,0,0,0,0, \
669 0,0,1,1,0,1,0,1, \
670 0,0,0,0,0,0,0,0, \
671 1,1,1 \
674 /* 1 for registers not available across function calls.
675 These must include the FIXED_REGISTERS and also any
676 registers that can be used without being saved.
677 The latter must include the registers where values are returned
678 and the register where structure-value addresses are passed.
679 Aside from that, you can include as many other registers as you like.
680 The CC is not preserved over function calls on the ARM 6, so it is
681 easier to assume this for all. SFP is preserved, since FP is. */
682 #define CALL_USED_REGISTERS \
684 1,1,1,1,0,0,0,0, \
685 0,0,1,1,1,1,1,1, \
686 1,1,1,1,0,0,0,0, \
687 1,1,1 \
690 /* If doing stupid life analysis, avoid a bug causing a return value r0 to be
691 trampled. This effectively reduces the number of available registers by 1.
692 XXX It is a hack, I know.
693 XXX Is this still needed? */
694 #define CONDITIONAL_REGISTER_USAGE \
696 if (obey_regdecls) \
697 fixed_regs[0] = 1; \
698 if (TARGET_SOFT_FLOAT) \
700 int regno; \
701 for (regno = 16; regno < 24; ++regno) \
702 fixed_regs[regno] = call_used_regs[regno] = 1; \
704 if (flag_pic) \
706 fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
707 call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 0; \
711 /* Return number of consecutive hard regs needed starting at reg REGNO
712 to hold something of mode MODE.
713 This is ordinarily the length in words of a value of mode MODE
714 but can be less for certain modes in special long registers.
716 On the ARM regs are UNITS_PER_WORD bits wide; FPU regs can hold any FP
717 mode. */
718 #define HARD_REGNO_NREGS(REGNO, MODE) \
719 (((REGNO) >= 16 && REGNO != FRAME_POINTER_REGNUM \
720 && (REGNO) != ARG_POINTER_REGNUM) ? 1 \
721 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
723 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
724 This is TRUE for ARM regs since they can hold anything, and TRUE for FPU
725 regs holding FP. */
726 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
727 ((GET_MODE_CLASS (MODE) == MODE_CC) ? (REGNO == CC_REGNUM) : \
728 ((REGNO) < 16 || REGNO == FRAME_POINTER_REGNUM \
729 || REGNO == ARG_POINTER_REGNUM \
730 || GET_MODE_CLASS (MODE) == MODE_FLOAT))
732 /* Value is 1 if it is a good idea to tie two pseudo registers
733 when one has mode MODE1 and one has mode MODE2.
734 If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
735 for any hard reg, then this must be 0 for correct output. */
736 #define MODES_TIEABLE_P(MODE1, MODE2) \
737 (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
739 /* Specify the registers used for certain standard purposes.
740 The values of these macros are register numbers. */
742 /* Define this if the program counter is overloaded on a register. */
743 #define PC_REGNUM 15
745 /* Register to use for pushing function arguments. */
746 #define STACK_POINTER_REGNUM 13
748 /* Base register for access to local variables of the function. */
749 #define FRAME_POINTER_REGNUM 25
751 /* Define this to be where the real frame pointer is if it is not possible to
752 work out the offset between the frame pointer and the automatic variables
753 until after register allocation has taken place. FRAME_POINTER_REGNUM
754 should point to a special register that we will make sure is eliminated. */
755 #define HARD_FRAME_POINTER_REGNUM 11
757 /* Value should be nonzero if functions must have frame pointers.
758 Zero means the frame pointer need not be set up (and parms may be accessed
759 via the stack pointer) in functions that seem suitable.
760 If we have to have a frame pointer we might as well make use of it.
761 APCS says that the frame pointer does not need to be pushed in leaf
762 functions, or simple tail call functions. */
763 #define FRAME_POINTER_REQUIRED \
764 (current_function_has_nonlocal_label || (TARGET_APCS && !leaf_function_p ()))
766 /* Base register for access to arguments of the function. */
767 #define ARG_POINTER_REGNUM 26
769 /* The native (Norcroft) Pascal compiler for the ARM passes the static chain
770 as an invisible last argument (possible since varargs don't exist in
771 Pascal), so the following is not true. */
772 #define STATIC_CHAIN_REGNUM 8
774 /* Register in which address to store a structure value
775 is passed to a function. */
776 #define STRUCT_VALUE_REGNUM 0
778 /* Internal, so that we don't need to refer to a raw number */
779 #define CC_REGNUM 24
781 /* The order in which register should be allocated. It is good to use ip
782 since no saving is required (though calls clobber it) and it never contains
783 function parameters. It is quite good to use lr since other calls may
784 clobber it anyway. Allocate r0 through r3 in reverse order since r3 is
785 least likely to contain a function parameter; in addition results are
786 returned in r0.
788 #define REG_ALLOC_ORDER \
790 3, 2, 1, 0, 12, 14, 4, 5, \
791 6, 7, 8, 10, 9, 11, 13, 15, \
792 16, 17, 18, 19, 20, 21, 22, 23, \
793 24, 25, 26 \
796 /* Register and constant classes. */
798 /* Register classes: all ARM regs or all FPU regs---simple! */
799 enum reg_class
801 NO_REGS,
802 FPU_REGS,
803 GENERAL_REGS,
804 ALL_REGS,
805 LIM_REG_CLASSES
808 #define N_REG_CLASSES (int) LIM_REG_CLASSES
810 /* Give names of register classes as strings for dump file. */
811 #define REG_CLASS_NAMES \
813 "NO_REGS", \
814 "FPU_REGS", \
815 "GENERAL_REGS", \
816 "ALL_REGS", \
819 /* Define which registers fit in which classes.
820 This is an initializer for a vector of HARD_REG_SET
821 of length N_REG_CLASSES. */
822 #define REG_CLASS_CONTENTS \
824 0x0000000, /* NO_REGS */ \
825 0x0FF0000, /* FPU_REGS */ \
826 0x200FFFF, /* GENERAL_REGS */ \
827 0x2FFFFFF /* ALL_REGS */ \
830 /* The same information, inverted:
831 Return the class number of the smallest class containing
832 reg number REGNO. This could be a conditional expression
833 or could index an array. */
834 #define REGNO_REG_CLASS(REGNO) \
835 (((REGNO) < 16 || REGNO == FRAME_POINTER_REGNUM \
836 || REGNO == ARG_POINTER_REGNUM) \
837 ? GENERAL_REGS : (REGNO) == CC_REGNUM \
838 ? NO_REGS : FPU_REGS)
840 /* The class value for index registers, and the one for base regs. */
841 #define INDEX_REG_CLASS GENERAL_REGS
842 #define BASE_REG_CLASS GENERAL_REGS
844 /* Get reg_class from a letter such as appears in the machine description.
845 We only need constraint `f' for FPU_REGS (`r' == GENERAL_REGS). */
846 #define REG_CLASS_FROM_LETTER(C) \
847 ((C)=='f' ? FPU_REGS : NO_REGS)
849 /* The letters I, J, K, L and M in a register constraint string
850 can be used to stand for particular ranges of immediate operands.
851 This macro defines what the ranges are.
852 C is the letter, and VALUE is a constant value.
853 Return 1 if VALUE is in the range specified by C.
854 I: immediate arithmetic operand (i.e. 8 bits shifted as required).
855 J: valid indexing constants.
856 K: ~value ok in rhs argument of data operand.
857 L: -value ok in rhs argument of data operand.
858 M: 0..32, or a power of 2 (for shifts, or mult done by shift). */
859 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
860 ((C) == 'I' ? const_ok_for_arm (VALUE) : \
861 (C) == 'J' ? ((VALUE) < 4096 && (VALUE) > -4096) : \
862 (C) == 'K' ? (const_ok_for_arm (~(VALUE))) : \
863 (C) == 'L' ? (const_ok_for_arm (-(VALUE))) : \
864 (C) == 'M' ? (((VALUE >= 0 && VALUE <= 32)) \
865 || (((VALUE) & ((VALUE) - 1)) == 0)) \
866 : 0)
868 /* For the ARM, `Q' means that this is a memory operand that is just
869 an offset from a register.
870 `S' means any symbol that has the SYMBOL_REF_FLAG set or a CONSTANT_POOL
871 address. This means that the symbol is in the text segment and can be
872 accessed without using a load. */
874 #define EXTRA_CONSTRAINT(OP, C) \
875 ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \
876 : (C) == 'R' ? (GET_CODE (OP) == MEM \
877 && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF \
878 && CONSTANT_POOL_ADDRESS_P (XEXP (OP, 0))) \
879 : (C) == 'S' ? (optimize > 0 && CONSTANT_ADDRESS_P (OP)) \
880 : 0)
882 /* Constant letter 'G' for the FPU immediate constants.
883 'H' means the same constant negated. */
884 #define CONST_DOUBLE_OK_FOR_LETTER_P(X,C) \
885 ((C) == 'G' ? const_double_rtx_ok_for_fpu (X) \
886 : (C) == 'H' ? neg_const_double_rtx_ok_for_fpu (X) : 0)
888 /* Given an rtx X being reloaded into a reg required to be
889 in class CLASS, return the class of reg to actually use.
890 In general this is just CLASS; but on some machines
891 in some cases it is preferable to use a more restrictive class. */
892 #define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
894 /* Return the register class of a scratch register needed to copy IN into
895 or out of a register in CLASS in MODE. If it can be done directly,
896 NO_REGS is returned. */
897 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,X) \
898 (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \
899 ? GENERAL_REGS : NO_REGS)
901 /* If we need to load shorts byte-at-a-time, then we need a scratch. */
902 #define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,X) \
903 (((MODE) == HImode && ! arm_arch4 && TARGET_SHORT_BY_BYTES \
904 && (GET_CODE (X) == MEM \
905 || ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG) \
906 && true_regnum (X) == -1))) \
907 ? GENERAL_REGS : NO_REGS)
909 /* Try a machine-dependent way of reloading an illegitimate address
910 operand. If we find one, push the reload and jump to WIN. This
911 macro is used in only one place: `find_reloads_address' in reload.c.
913 For the ARM, we wish to handle large displacements off a base
914 register by splitting the addend across a MOV and the mem insn.
915 This can cut the number of reloads needed. */
916 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \
917 do { \
918 if (GET_CODE (X) == PLUS \
919 && GET_CODE (XEXP (X, 0)) == REG \
920 && REGNO (XEXP (X, 0)) < FIRST_PSEUDO_REGISTER \
921 && REG_MODE_OK_FOR_BASE_P (XEXP (X, 0), MODE) \
922 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
924 HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
925 HOST_WIDE_INT low, high; \
927 if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \
928 low = ((val & 0xf) ^ 0x8) - 0x8; \
929 else if (MODE == SImode || MODE == QImode \
930 || (MODE == SFmode && TARGET_SOFT_FLOAT) \
931 || (MODE == HImode && ! arm_arch4)) \
932 /* Need to be careful, -4096 is not a valid offset */ \
933 low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \
934 else if (MODE == HImode && arm_arch4) \
935 /* Need to be careful, -256 is not a valid offset */ \
936 low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
937 else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \
938 && TARGET_HARD_FLOAT) \
939 /* Need to be careful, -1024 is not a valid offset */ \
940 low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
941 else \
942 break; \
944 high = ((((val - low) & 0xffffffff) ^ 0x80000000) - 0x80000000); \
945 /* Check for overflow or zero */ \
946 if (low == 0 || high == 0 || (high + low != val)) \
947 break; \
949 /* Reload the high part into a base reg; leave the low part \
950 in the mem. */ \
951 X = gen_rtx_PLUS (GET_MODE (X), \
952 gen_rtx_PLUS (GET_MODE (X), XEXP (X, 0), \
953 GEN_INT (high)), \
954 GEN_INT (low)); \
955 push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL_PTR, \
956 BASE_REG_CLASS, GET_MODE (X), VOIDmode, 0, 0, \
957 OPNUM, TYPE); \
958 goto WIN; \
960 } while (0)
962 /* Return the maximum number of consecutive registers
963 needed to represent mode MODE in a register of class CLASS.
964 ARM regs are UNITS_PER_WORD bits while FPU regs can hold any FP mode */
965 #define CLASS_MAX_NREGS(CLASS, MODE) \
966 ((CLASS) == FPU_REGS ? 1 \
967 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
969 /* Moves between FPU_REGS and GENERAL_REGS are two memory insns. */
970 #define REGISTER_MOVE_COST(CLASS1, CLASS2) \
971 ((((CLASS1) == FPU_REGS && (CLASS2) != FPU_REGS) \
972 || ((CLASS2) == FPU_REGS && (CLASS1) != FPU_REGS)) \
973 ? 20 : 2)
975 /* Stack layout; function entry, exit and calling. */
977 /* Define this if pushing a word on the stack
978 makes the stack pointer a smaller address. */
979 #define STACK_GROWS_DOWNWARD 1
981 /* Define this if the nominal address of the stack frame
982 is at the high-address end of the local variables;
983 that is, each additional local variable allocated
984 goes at a more negative offset in the frame. */
985 #define FRAME_GROWS_DOWNWARD 1
987 /* Offset within stack frame to start allocating local variables at.
988 If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
989 first local allocated. Otherwise, it is the offset to the BEGINNING
990 of the first local allocated. */
991 #define STARTING_FRAME_OFFSET 0
993 /* If we generate an insn to push BYTES bytes,
994 this says how many the stack pointer really advances by. */
995 /* The push insns do not do this rounding implicitly. So don't define this. */
996 /* #define PUSH_ROUNDING(NPUSHED) (((NPUSHED) + 3) & ~3) */
998 /* Define this if the maximum size of all the outgoing args is to be
999 accumulated and pushed during the prologue. The amount can be
1000 found in the variable current_function_outgoing_args_size. */
1001 #define ACCUMULATE_OUTGOING_ARGS
1003 /* Offset of first parameter from the argument pointer register value. */
1004 #define FIRST_PARM_OFFSET(FNDECL) 4
1006 /* Value is the number of byte of arguments automatically
1007 popped when returning from a subroutine call.
1008 FUNDECL is the declaration node of the function (as a tree),
1009 FUNTYPE is the data type of the function (as a tree),
1010 or for a library call it is an identifier node for the subroutine name.
1011 SIZE is the number of bytes of arguments passed on the stack.
1013 On the ARM, the caller does not pop any of its arguments that were passed
1014 on the stack. */
1015 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
1017 /* Define how to find the value returned by a function.
1018 VALTYPE is the data type of the value (as a tree).
1019 If the precise function being called is known, FUNC is its FUNCTION_DECL;
1020 otherwise, FUNC is 0. */
1021 #define FUNCTION_VALUE(VALTYPE, FUNC) \
1022 (GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT && TARGET_HARD_FLOAT \
1023 ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \
1024 : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))
1026 /* Define how to find the value returned by a library function
1027 assuming the value has mode MODE. */
1028 #define LIBCALL_VALUE(MODE) \
1029 (GET_MODE_CLASS (MODE) == MODE_FLOAT && TARGET_HARD_FLOAT \
1030 ? gen_rtx (REG, MODE, 16) \
1031 : gen_rtx (REG, MODE, 0))
1033 /* 1 if N is a possible register number for a function value.
1034 On the ARM, only r0 and f0 can return results. */
1035 #define FUNCTION_VALUE_REGNO_P(REGNO) \
1036 ((REGNO) == 0 || ((REGNO) == 16) && TARGET_HARD_FLOAT)
1038 /* How large values are returned */
1039 /* A C expression which can inhibit the returning of certain function values
1040 in registers, based on the type of value. */
1041 #define RETURN_IN_MEMORY(TYPE) \
1042 (TYPE_MODE ((TYPE)) == BLKmode || \
1043 (AGGREGATE_TYPE_P ((TYPE)) && arm_return_in_memory ((TYPE))))
1045 /* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return
1046 values must be in memory. On the ARM, they need only do so if larger
1047 than a word, or if they contain elements offset from zero in the struct. */
1048 #define DEFAULT_PCC_STRUCT_RETURN 0
1050 /* Define where to put the arguments to a function.
1051 Value is zero to push the argument on the stack,
1052 or a hard register in which to store the argument.
1054 MODE is the argument's machine mode.
1055 TYPE is the data type of the argument (as a tree).
1056 This is null for libcalls where that information may
1057 not be available.
1058 CUM is a variable of type CUMULATIVE_ARGS which gives info about
1059 the preceding args and about the function being called.
1060 NAMED is nonzero if this argument is a named parameter
1061 (otherwise it is an extra parameter matching an ellipsis).
1063 On the ARM, normally the first 16 bytes are passed in registers r0-r3; all
1064 other arguments are passed on the stack. If (NAMED == 0) (which happens
1065 only in assign_parms, since SETUP_INCOMING_VARARGS is defined), say it is
1066 passed in the stack (function_prologue will indeed make it pass in the
1067 stack if necessary). */
1068 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1069 ((NAMED) \
1070 ? ((CUM) >= 16 ? 0 : gen_rtx (REG, MODE, (CUM) / 4)) \
1071 : 0)
1073 /* For an arg passed partly in registers and partly in memory,
1074 this is the number of registers used.
1075 For args passed entirely in registers or entirely in memory, zero. */
1076 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
1077 ((CUM) < 16 && 16 < (CUM) + ((MODE) != BLKmode \
1078 ? GET_MODE_SIZE (MODE) \
1079 : int_size_in_bytes (TYPE)) \
1080 ? 4 - (CUM) / 4 : 0)
1082 /* A C type for declaring a variable that is used as the first argument of
1083 `FUNCTION_ARG' and other related values. For some target machines, the
1084 type `int' suffices and can hold the number of bytes of argument so far.
1086 On the ARM, this is the number of bytes of arguments scanned so far. */
1087 #define CUMULATIVE_ARGS int
1089 /* Initialize a variable CUM of type CUMULATIVE_ARGS
1090 for a call to a function whose data type is FNTYPE.
1091 For a library call, FNTYPE is 0.
1092 On the ARM, the offset starts at 0. */
1093 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
1094 ((CUM) = (((FNTYPE) && aggregate_value_p (TREE_TYPE ((FNTYPE)))) ? 4 : 0))
1096 /* Update the data in CUM to advance over an argument
1097 of mode MODE and data type TYPE.
1098 (TYPE is null for libcalls where that information may not be available.) */
1099 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1100 (CUM) += ((MODE) != BLKmode \
1101 ? (GET_MODE_SIZE (MODE) + 3) & ~3 \
1102 : (int_size_in_bytes (TYPE) + 3) & ~3) \
1104 /* 1 if N is a possible register number for function argument passing.
1105 On the ARM, r0-r3 are used to pass args. */
1106 #define FUNCTION_ARG_REGNO_P(REGNO) \
1107 ((REGNO) >= 0 && (REGNO) <= 3)
1109 /* Perform any actions needed for a function that is receiving a variable
1110 number of arguments. CUM is as above. MODE and TYPE are the mode and type
1111 of the current parameter. PRETEND_SIZE is a variable that should be set to
1112 the amount of stack that must be pushed by the prolog to pretend that our
1113 caller pushed it.
1115 Normally, this macro will push all remaining incoming registers on the
1116 stack and set PRETEND_SIZE to the length of the registers pushed.
1118 On the ARM, PRETEND_SIZE is set in order to have the prologue push the last
1119 named arg and all anonymous args onto the stack.
1120 XXX I know the prologue shouldn't be pushing registers, but it is faster
1121 that way. */
1122 #define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL) \
1124 extern int current_function_anonymous_args; \
1125 current_function_anonymous_args = 1; \
1126 if ((CUM) < 16) \
1127 (PRETEND_SIZE) = 16 - (CUM); \
1130 /* Generate assembly output for the start of a function. */
1131 #define FUNCTION_PROLOGUE(STREAM, SIZE) \
1132 output_func_prologue ((STREAM), (SIZE))
1134 /* Call the function profiler with a given profile label. The Acorn compiler
1135 puts this BEFORE the prolog but gcc puts it afterwards. The ``mov ip,lr''
1136 seems like a good idea to stick with cc convention. ``prof'' doesn't seem
1137 to mind about this! */
1138 #define FUNCTION_PROFILER(STREAM,LABELNO) \
1140 fprintf(STREAM, "\tmov\t%sip, %slr\n", REGISTER_PREFIX, REGISTER_PREFIX); \
1141 fprintf(STREAM, "\tbl\tmcount\n"); \
1142 fprintf(STREAM, "\t.word\tLP%d\n", (LABELNO)); \
1145 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1146 the stack pointer does not matter. The value is tested only in
1147 functions that have frame pointers.
1148 No definition is equivalent to always zero.
1150 On the ARM, the function epilogue recovers the stack pointer from the
1151 frame. */
1152 #define EXIT_IGNORE_STACK 1
1154 /* Generate the assembly code for function exit. */
1155 #define FUNCTION_EPILOGUE(STREAM, SIZE) \
1156 output_func_epilogue ((STREAM), (SIZE))
1158 /* Determine if the epilogue should be output as RTL.
1159 You should override this if you define FUNCTION_EXTRA_EPILOGUE. */
1160 #define USE_RETURN_INSN use_return_insn ()
1162 /* Definitions for register eliminations.
1164 This is an array of structures. Each structure initializes one pair
1165 of eliminable registers. The "from" register number is given first,
1166 followed by "to". Eliminations of the same "from" register are listed
1167 in order of preference.
1169 We have two registers that can be eliminated on the ARM. First, the
1170 arg pointer register can often be eliminated in favor of the stack
1171 pointer register. Secondly, the pseudo frame pointer register can always
1172 be eliminated; it is replaced with either the stack or the real frame
1173 pointer. */
1175 #define ELIMINABLE_REGS \
1176 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1177 {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1178 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1179 {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
1181 /* Given FROM and TO register numbers, say whether this elimination is allowed.
1182 Frame pointer elimination is automatically handled.
1184 All eliminations are permissible. Note that ARG_POINTER_REGNUM and
1185 HARD_FRAME_POINTER_REGNUM are in fact the same thing. If we need a frame
1186 pointer, we must eliminate FRAME_POINTER_REGNUM into
1187 HARD_FRAME_POINTER_REGNUM and not into STACK_POINTER_REGNUM. */
1188 #define CAN_ELIMINATE(FROM, TO) \
1189 (((TO) == STACK_POINTER_REGNUM && frame_pointer_needed) ? 0 : 1)
1191 /* Define the offset between two registers, one to be eliminated, and the other
1192 its replacement, at the start of a routine. */
1193 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1195 int volatile_func = arm_volatile_func (); \
1196 if ((FROM) == ARG_POINTER_REGNUM && (TO) == HARD_FRAME_POINTER_REGNUM)\
1197 (OFFSET) = 0; \
1198 else if ((FROM) == FRAME_POINTER_REGNUM \
1199 && (TO) == STACK_POINTER_REGNUM) \
1200 (OFFSET) = (current_function_outgoing_args_size \
1201 + (get_frame_size () + 3 & ~3)); \
1202 else \
1204 int regno; \
1205 int offset = 12; \
1206 int saved_hard_reg = 0; \
1208 if (! volatile_func) \
1210 for (regno = 0; regno <= 10; regno++) \
1211 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
1212 saved_hard_reg = 1, offset += 4; \
1213 for (regno = 16; regno <=23; regno++) \
1214 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
1215 offset += 12; \
1217 if ((FROM) == FRAME_POINTER_REGNUM) \
1218 (OFFSET) = -offset; \
1219 else \
1221 if (! frame_pointer_needed) \
1222 offset -= 16; \
1223 if (! volatile_func \
1224 && (regs_ever_live[14] || saved_hard_reg)) \
1225 offset += 4; \
1226 offset += current_function_outgoing_args_size; \
1227 (OFFSET) = (get_frame_size () + 3 & ~3) + offset; \
1232 /* Output assembler code for a block containing the constant parts
1233 of a trampoline, leaving space for the variable parts.
1235 On the ARM, (if r8 is the static chain regnum, and remembering that
1236 referencing pc adds an offset of 8) the trampoline looks like:
1237 ldr r8, [pc, #0]
1238 ldr pc, [pc]
1239 .word static chain value
1240 .word function's address
1241 ??? FIXME: When the trampoline returns, r8 will be clobbered. */
1242 #define TRAMPOLINE_TEMPLATE(FILE) \
1244 fprintf ((FILE), "\tldr\t%sr8, [%spc, #0]\n", \
1245 REGISTER_PREFIX, REGISTER_PREFIX); \
1246 fprintf ((FILE), "\tldr\t%spc, [%spc, #0]\n", \
1247 REGISTER_PREFIX, REGISTER_PREFIX); \
1248 fprintf ((FILE), "\t.word\t0\n"); \
1249 fprintf ((FILE), "\t.word\t0\n"); \
1252 /* Length in units of the trampoline for entering a nested function. */
1253 #define TRAMPOLINE_SIZE 16
1255 /* Alignment required for a trampoline in units. */
1256 #define TRAMPOLINE_ALIGN 4
1258 /* Emit RTL insns to initialize the variable parts of a trampoline.
1259 FNADDR is an RTX for the address of the function's pure code.
1260 CXT is an RTX for the static chain value for the function. */
1261 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
1263 emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \
1264 (CXT)); \
1265 emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \
1266 (FNADDR)); \
1270 /* Addressing modes, and classification of registers for them. */
1272 #define HAVE_POST_INCREMENT 1
1273 #define HAVE_PRE_INCREMENT 1
1274 #define HAVE_POST_DECREMENT 1
1275 #define HAVE_PRE_DECREMENT 1
1277 /* Macros to check register numbers against specific register classes. */
1279 /* These assume that REGNO is a hard or pseudo reg number.
1280 They give nonzero only if REGNO is a hard reg of the suitable class
1281 or a pseudo reg currently allocated to a suitable hard reg.
1282 Since they use reg_renumber, they are safe only once reg_renumber
1283 has been allocated, which happens in local-alloc.c.
1285 On the ARM, don't allow the pc to be used. */
1286 #define REGNO_OK_FOR_BASE_P(REGNO) \
1287 ((REGNO) < 15 || (REGNO) == FRAME_POINTER_REGNUM \
1288 || (REGNO) == ARG_POINTER_REGNUM \
1289 || (unsigned) reg_renumber[(REGNO)] < 15 \
1290 || (unsigned) reg_renumber[(REGNO)] == FRAME_POINTER_REGNUM \
1291 || (unsigned) reg_renumber[(REGNO)] == ARG_POINTER_REGNUM)
1292 #define REGNO_OK_FOR_INDEX_P(REGNO) \
1293 REGNO_OK_FOR_BASE_P(REGNO)
1295 /* Maximum number of registers that can appear in a valid memory address.
1296 Shifts in addresses can't be by a register. */
1298 #define MAX_REGS_PER_ADDRESS 2
1300 /* Recognize any constant value that is a valid address. */
1301 /* XXX We can address any constant, eventually... */
1303 #ifdef AOF_ASSEMBLER
1305 #define CONSTANT_ADDRESS_P(X) \
1306 (GET_CODE (X) == SYMBOL_REF \
1307 && CONSTANT_POOL_ADDRESS_P (X))
1309 #else
1311 #define CONSTANT_ADDRESS_P(X) \
1312 (GET_CODE (X) == SYMBOL_REF \
1313 && (CONSTANT_POOL_ADDRESS_P (X) \
1314 || (optimize > 0 && SYMBOL_REF_FLAG (X))))
1316 #endif /* AOF_ASSEMBLER */
1318 /* Nonzero if the constant value X is a legitimate general operand.
1319 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.
1321 On the ARM, allow any integer (invalid ones are removed later by insn
1322 patterns), nice doubles and symbol_refs which refer to the function's
1323 constant pool XXX. */
1324 #define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X))
1326 /* Symbols in the text segment can be accessed without indirecting via the
1327 constant pool; it may take an extra binary operation, but this is still
1328 faster than indirecting via memory. Don't do this when not optimizing,
1329 since we won't be calculating al of the offsets necessary to do this
1330 simplification. */
1331 /* This doesn't work with AOF syntax, since the string table may be in
1332 a different AREA. */
1333 #ifndef AOF_ASSEMBLER
1334 #define ENCODE_SECTION_INFO(decl) \
1336 if (optimize > 0 && TREE_CONSTANT (decl) \
1337 && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST)) \
1339 rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd' \
1340 ? TREE_CST_RTL (decl) : DECL_RTL (decl)); \
1341 SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; \
1344 #endif
1346 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
1347 and check its validity for a certain class.
1348 We have two alternate definitions for each of them.
1349 The usual definition accepts all pseudo regs; the other rejects
1350 them unless they have been allocated suitable hard regs.
1351 The symbol REG_OK_STRICT causes the latter definition to be used. */
1352 #ifndef REG_OK_STRICT
1354 /* Nonzero if X is a hard reg that can be used as a base reg
1355 or if it is a pseudo reg. */
1356 #define REG_OK_FOR_BASE_P(X) \
1357 (REGNO (X) < 16 || REGNO (X) >= FIRST_PSEUDO_REGISTER \
1358 || REGNO (X) == FRAME_POINTER_REGNUM || REGNO (X) == ARG_POINTER_REGNUM)
1360 /* Nonzero if X is a hard reg that can be used as an index
1361 or if it is a pseudo reg. */
1362 #define REG_OK_FOR_INDEX_P(X) \
1363 REG_OK_FOR_BASE_P(X)
1365 #define REG_OK_FOR_PRE_POST_P(X) \
1366 (REGNO (X) < 16 || REGNO (X) >= FIRST_PSEUDO_REGISTER \
1367 || REGNO (X) == FRAME_POINTER_REGNUM || REGNO (X) == ARG_POINTER_REGNUM)
1369 #else
1371 /* Nonzero if X is a hard reg that can be used as a base reg. */
1372 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
1374 /* Nonzero if X is a hard reg that can be used as an index. */
1375 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
1377 #define REG_OK_FOR_PRE_POST_P(X) \
1378 (REGNO (X) < 16 || (unsigned) reg_renumber[REGNO (X)] < 16 \
1379 || REGNO (X) == FRAME_POINTER_REGNUM || REGNO (X) == ARG_POINTER_REGNUM \
1380 || (unsigned) reg_renumber[REGNO (X)] == FRAME_POINTER_REGNUM \
1381 || (unsigned) reg_renumber[REGNO (X)] == ARG_POINTER_REGNUM)
1383 #endif
1385 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
1386 that is a valid memory address for an instruction.
1387 The MODE argument is the machine mode for the MEM expression
1388 that wants to use this address.
1390 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS. */
1391 #define BASE_REGISTER_RTX_P(X) \
1392 (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))
1394 #define INDEX_REGISTER_RTX_P(X) \
1395 (GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X))
1397 /* A C statement (sans semicolon) to jump to LABEL for legitimate index RTXs
1398 used by the macro GO_IF_LEGITIMATE_ADDRESS. Floating point indices can
1399 only be small constants. */
1400 #define GO_IF_LEGITIMATE_INDEX(MODE, BASE_REGNO, INDEX, LABEL) \
1401 do \
1403 HOST_WIDE_INT range; \
1404 enum rtx_code code = GET_CODE (INDEX); \
1406 if (TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT) \
1408 if (code == CONST_INT && INTVAL (INDEX) < 1024 \
1409 && INTVAL (INDEX) > -1024 \
1410 && (INTVAL (INDEX) & 3) == 0) \
1411 goto LABEL; \
1413 else \
1415 if (INDEX_REGISTER_RTX_P (INDEX) && GET_MODE_SIZE (MODE) <= 4) \
1416 goto LABEL; \
1417 if (GET_MODE_SIZE (MODE) <= 4 && code == MULT \
1418 && (! arm_arch4 || (MODE) != HImode)) \
1420 rtx xiop0 = XEXP (INDEX, 0); \
1421 rtx xiop1 = XEXP (INDEX, 1); \
1422 if (INDEX_REGISTER_RTX_P (xiop0) \
1423 && power_of_two_operand (xiop1, SImode)) \
1424 goto LABEL; \
1425 if (INDEX_REGISTER_RTX_P (xiop1) \
1426 && power_of_two_operand (xiop0, SImode)) \
1427 goto LABEL; \
1429 if (GET_MODE_SIZE (MODE) <= 4 \
1430 && (code == LSHIFTRT || code == ASHIFTRT \
1431 || code == ASHIFT || code == ROTATERT) \
1432 && (! arm_arch4 || (MODE) != HImode)) \
1434 rtx op = XEXP (INDEX, 1); \
1435 if (INDEX_REGISTER_RTX_P (XEXP (INDEX, 0)) \
1436 && GET_CODE (op) == CONST_INT && INTVAL (op) > 0 \
1437 && INTVAL (op) <= 31) \
1438 goto LABEL; \
1440 /* NASTY: Since this limits the addressing of unsigned byte loads */ \
1441 range = ((MODE) == HImode || (MODE) == QImode) \
1442 ? (arm_arch4 ? 256 : 4095) : 4096; \
1443 if (code == CONST_INT && INTVAL (INDEX) < range \
1444 && INTVAL (INDEX) > -range) \
1445 goto LABEL; \
1447 } while (0)
1449 /* Jump to LABEL if X is a valid address RTX. This must also take
1450 REG_OK_STRICT into account when deciding about valid registers, but it uses
1451 the above macros so we are in luck. Allow REG, REG+REG, REG+INDEX,
1452 INDEX+REG, REG-INDEX, and non floating SYMBOL_REF to the constant pool.
1453 Allow REG-only and AUTINC-REG if handling TImode or HImode. Other symbol
1454 refs must be forced though a static cell to ensure addressability. */
1455 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
1457 if (BASE_REGISTER_RTX_P (X)) \
1458 goto LABEL; \
1459 else if ((GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC) \
1460 && GET_CODE (XEXP (X, 0)) == REG \
1461 && REG_OK_FOR_PRE_POST_P (XEXP (X, 0))) \
1462 goto LABEL; \
1463 else if (GET_MODE_SIZE (MODE) >= 4 && reload_completed \
1464 && (GET_CODE (X) == LABEL_REF \
1465 || (GET_CODE (X) == CONST \
1466 && GET_CODE (XEXP ((X), 0)) == PLUS \
1467 && GET_CODE (XEXP (XEXP ((X), 0), 0)) == LABEL_REF \
1468 && GET_CODE (XEXP (XEXP ((X), 0), 1)) == CONST_INT)))\
1469 goto LABEL; \
1470 else if ((MODE) == TImode) \
1472 else if ((MODE) == DImode || (TARGET_SOFT_FLOAT && (MODE) == DFmode)) \
1474 if (GET_CODE (X) == PLUS && BASE_REGISTER_RTX_P (XEXP (X, 0)) \
1475 && GET_CODE (XEXP (X, 1)) == CONST_INT) \
1477 HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
1478 if (val == 4 || val == -4 || val == -8) \
1479 goto LABEL; \
1482 else if (GET_CODE (X) == PLUS) \
1484 rtx xop0 = XEXP(X,0); \
1485 rtx xop1 = XEXP(X,1); \
1487 if (BASE_REGISTER_RTX_P (xop0)) \
1488 GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop0), xop1, LABEL); \
1489 else if (BASE_REGISTER_RTX_P (xop1)) \
1490 GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop1), xop0, LABEL); \
1492 /* Reload currently can't handle MINUS, so disable this for now */ \
1493 /* else if (GET_CODE (X) == MINUS) \
1495 rtx xop0 = XEXP (X,0); \
1496 rtx xop1 = XEXP (X,1); \
1498 if (BASE_REGISTER_RTX_P (xop0)) \
1499 GO_IF_LEGITIMATE_INDEX (MODE, -1, xop1, LABEL); \
1500 } */ \
1501 else if (GET_MODE_CLASS (MODE) != MODE_FLOAT \
1502 && GET_CODE (X) == SYMBOL_REF \
1503 && CONSTANT_POOL_ADDRESS_P (X)) \
1504 goto LABEL; \
1505 else if ((GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_DEC) \
1506 && (GET_MODE_SIZE (MODE) <= 4) \
1507 && GET_CODE (XEXP (X, 0)) == REG \
1508 && REG_OK_FOR_PRE_POST_P (XEXP (X, 0))) \
1509 goto LABEL; \
1512 /* Try machine-dependent ways of modifying an illegitimate address
1513 to be legitimate. If we find one, return the new, valid address.
1514 This macro is used in only one place: `memory_address' in explow.c.
1516 OLDX is the address as it was before break_out_memory_refs was called.
1517 In some cases it is useful to look at this to decide what needs to be done.
1519 MODE and WIN are passed so that this macro can use
1520 GO_IF_LEGITIMATE_ADDRESS.
1522 It is always safe for this macro to do nothing. It exists to recognize
1523 opportunities to optimize the output.
1525 On the ARM, try to convert [REG, #BIGCONST]
1526 into ADD BASE, REG, #UPPERCONST and [BASE, #VALIDCONST],
1527 where VALIDCONST == 0 in case of TImode. */
1528 extern struct rtx_def *legitimize_pic_address ();
1529 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
1531 if (GET_CODE (X) == PLUS) \
1533 rtx xop0 = XEXP (X, 0); \
1534 rtx xop1 = XEXP (X, 1); \
1536 if (CONSTANT_P (xop0) && ! symbol_mentioned_p (xop0)) \
1537 xop0 = force_reg (SImode, xop0); \
1538 if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1)) \
1539 xop1 = force_reg (SImode, xop1); \
1540 if (BASE_REGISTER_RTX_P (xop0) && GET_CODE (xop1) == CONST_INT) \
1542 HOST_WIDE_INT n, low_n; \
1543 rtx base_reg, val; \
1544 n = INTVAL (xop1); \
1546 if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \
1548 low_n = n & 0x0f; \
1549 n &= ~0x0f; \
1550 if (low_n > 4) \
1552 n += 16; \
1553 low_n -= 16; \
1556 else \
1558 low_n = ((MODE) == TImode ? 0 \
1559 : n >= 0 ? (n & 0xfff) : -((-n) & 0xfff)); \
1560 n -= low_n; \
1562 base_reg = gen_reg_rtx (SImode); \
1563 val = force_operand (gen_rtx (PLUS, SImode, xop0, \
1564 GEN_INT (n)), NULL_RTX); \
1565 emit_move_insn (base_reg, val); \
1566 (X) = (low_n == 0 ? base_reg \
1567 : gen_rtx (PLUS, SImode, base_reg, GEN_INT (low_n))); \
1569 else if (xop0 != XEXP (X, 0) || xop1 != XEXP (x, 1)) \
1570 (X) = gen_rtx (PLUS, SImode, xop0, xop1); \
1572 else if (GET_CODE (X) == MINUS) \
1574 rtx xop0 = XEXP (X, 0); \
1575 rtx xop1 = XEXP (X, 1); \
1577 if (CONSTANT_P (xop0)) \
1578 xop0 = force_reg (SImode, xop0); \
1579 if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1)) \
1580 xop1 = force_reg (SImode, xop1); \
1581 if (xop0 != XEXP (X, 0) || xop1 != XEXP (X, 1)) \
1582 (X) = gen_rtx (MINUS, SImode, xop0, xop1); \
1584 if (flag_pic) \
1585 (X) = legitimize_pic_address (OLDX, MODE, NULL_RTX); \
1586 if (memory_address_p (MODE, X)) \
1587 goto WIN; \
1590 /* Go to LABEL if ADDR (a legitimate address expression)
1591 has an effect that depends on the machine mode it is used for. */
1592 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
1594 if (GET_CODE(ADDR) == PRE_DEC || GET_CODE(ADDR) == POST_DEC \
1595 || GET_CODE(ADDR) == PRE_INC || GET_CODE(ADDR) == POST_INC) \
1596 goto LABEL; \
1599 /* Specify the machine mode that this machine uses
1600 for the index in the tablejump instruction. */
1601 #define CASE_VECTOR_MODE SImode
1603 /* Define as C expression which evaluates to nonzero if the tablejump
1604 instruction expects the table to contain offsets from the address of the
1605 table.
1606 Do not define this if the table should contain absolute addresses. */
1607 /* #define CASE_VECTOR_PC_RELATIVE 1 */
1609 /* Specify the tree operation to be used to convert reals to integers. */
1610 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
1612 /* This is the kind of divide that is easiest to do in the general case. */
1613 #define EASY_DIV_EXPR TRUNC_DIV_EXPR
1615 /* signed 'char' is most compatible, but RISC OS wants it unsigned.
1616 unsigned is probably best, but may break some code. */
1617 #ifndef DEFAULT_SIGNED_CHAR
1618 #define DEFAULT_SIGNED_CHAR 0
1619 #endif
1621 /* Don't cse the address of the function being compiled. */
1622 #define NO_RECURSIVE_FUNCTION_CSE 1
1624 /* Max number of bytes we can move from memory to memory
1625 in one reasonably fast instruction. */
1626 #define MOVE_MAX 4
1628 /* Define if operations between registers always perform the operation
1629 on the full register even if a narrower mode is specified. */
1630 #define WORD_REGISTER_OPERATIONS
1632 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
1633 will either zero-extend or sign-extend. The value of this macro should
1634 be the code that says which one of the two operations is implicitly
1635 done, NIL if none. */
1636 #define LOAD_EXTEND_OP(MODE) \
1637 ((arm_arch4 || (MODE) == QImode) ? ZERO_EXTEND \
1638 : ((BYTES_BIG_ENDIAN && (MODE) == HImode) ? SIGN_EXTEND : NIL))
1640 /* Define this if zero-extension is slow (more than one real instruction).
1641 On the ARM, it is more than one instruction only if not fetching from
1642 memory. */
1643 /* #define SLOW_ZERO_EXTEND */
1645 /* Nonzero if access to memory by bytes is slow and undesirable. */
1646 #define SLOW_BYTE_ACCESS 0
1648 /* Immediate shift counts are truncated by the output routines (or was it
1649 the assembler?). Shift counts in a register are truncated by ARM. Note
1650 that the native compiler puts too large (> 32) immediate shift counts
1651 into a register and shifts by the register, letting the ARM decide what
1652 to do instead of doing that itself. */
1653 /* This is all wrong. Defining SHIFT_COUNT_TRUNCATED tells combine that
1654 code like (X << (Y % 32)) for register X, Y is equivalent to (X << Y).
1655 On the arm, Y in a register is used modulo 256 for the shift. Only for
1656 rotates is modulo 32 used. */
1657 /* #define SHIFT_COUNT_TRUNCATED 1 */
1659 /* All integers have the same format so truncation is easy. */
1660 #define TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) 1
1662 /* Calling from registers is a massive pain. */
1663 #define NO_FUNCTION_CSE 1
1665 /* Chars and shorts should be passed as ints. */
1666 #define PROMOTE_PROTOTYPES 1
1668 /* The machine modes of pointers and functions */
1669 #define Pmode SImode
1670 #define FUNCTION_MODE Pmode
1672 /* The structure type of the machine dependent info field of insns
1673 No uses for this yet. */
1674 /* #define INSN_MACHINE_INFO struct machine_info */
1676 /* The relative costs of various types of constants. Note that cse.c defines
1677 REG = 1, SUBREG = 2, any node = (2 + sum of subnodes). */
1678 #define CONST_COSTS(RTX, CODE, OUTER_CODE) \
1679 case CONST_INT: \
1680 if (const_ok_for_arm (INTVAL (RTX))) \
1681 return (OUTER_CODE) == SET ? 2 : -1; \
1682 else if (OUTER_CODE == AND \
1683 && const_ok_for_arm (~INTVAL (RTX))) \
1684 return -1; \
1685 else if ((OUTER_CODE == COMPARE \
1686 || OUTER_CODE == PLUS || OUTER_CODE == MINUS) \
1687 && const_ok_for_arm (-INTVAL (RTX))) \
1688 return -1; \
1689 else \
1690 return 5; \
1691 case CONST: \
1692 case LABEL_REF: \
1693 case SYMBOL_REF: \
1694 return 6; \
1695 case CONST_DOUBLE: \
1696 if (const_double_rtx_ok_for_fpu (RTX)) \
1697 return (OUTER_CODE) == SET ? 2 : -1; \
1698 else if (((OUTER_CODE) == COMPARE || (OUTER_CODE) == PLUS) \
1699 && neg_const_double_rtx_ok_for_fpu (RTX)) \
1700 return -1; \
1701 return(7);
1703 #define ARM_FRAME_RTX(X) \
1704 ((X) == frame_pointer_rtx || (X) == stack_pointer_rtx \
1705 || (X) == arg_pointer_rtx)
1707 #define DEFAULT_RTX_COSTS(X,CODE,OUTER_CODE) \
1708 return arm_rtx_costs (X, CODE, OUTER_CODE);
1710 /* Moves to and from memory are quite expensive */
1711 #define MEMORY_MOVE_COST(MODE,CLASS,IN) 10
1713 /* All address computations that can be done are free, but rtx cost returns
1714 the same for practically all of them. So we weight the different types
1715 of address here in the order (most pref first):
1716 PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */
1717 #define ADDRESS_COST(X) \
1718 (10 - ((GET_CODE (X) == MEM || GET_CODE (X) == LABEL_REF \
1719 || GET_CODE (X) == SYMBOL_REF) \
1720 ? 0 \
1721 : ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC \
1722 || GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC) \
1723 ? 10 \
1724 : (((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS) \
1725 ? 6 + (GET_CODE (XEXP (X, 1)) == CONST_INT ? 2 \
1726 : ((GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == '2' \
1727 || GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == 'c' \
1728 || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == '2' \
1729 || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == 'c') \
1730 ? 1 : 0)) \
1731 : 4)))))
1735 /* Try to generate sequences that don't involve branches, we can then use
1736 conditional instructions */
1737 #define BRANCH_COST 4
1739 /* A C statement to update the variable COST based on the relationship
1740 between INSN that is dependent on DEP through dependence LINK. */
1741 #define ADJUST_COST(INSN,LINK,DEP,COST) \
1742 (COST) = arm_adjust_cost ((INSN), (LINK), (DEP), (COST))
1744 /* Position Independent Code. */
1745 /* We decide which register to use based on the compilation options and
1746 the assembler in use; this is more general than the APCS restriction of
1747 using sb (r9) all the time. */
1748 extern int arm_pic_register;
1750 /* The register number of the register used to address a table of static
1751 data addresses in memory. */
1752 #define PIC_OFFSET_TABLE_REGNUM arm_pic_register
1754 #define FINALIZE_PIC arm_finalize_pic ()
1756 #define LEGITIMATE_PIC_OPERAND_P(X) (! symbol_mentioned_p (X))
1760 /* Condition code information. */
1761 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
1762 return the mode to be used for the comparison.
1763 CCFPEmode should be used with floating inequalities,
1764 CCFPmode should be used with floating equalities.
1765 CC_NOOVmode should be used with SImode integer equalities.
1766 CC_Zmode should be used if only the Z flag is set correctly
1767 CCmode should be used otherwise. */
1769 #define EXTRA_CC_MODES CC_NOOVmode, CC_Zmode, CC_SWPmode, \
1770 CCFPmode, CCFPEmode, CC_DNEmode, CC_DEQmode, CC_DLEmode, \
1771 CC_DLTmode, CC_DGEmode, CC_DGTmode, CC_DLEUmode, CC_DLTUmode, \
1772 CC_DGEUmode, CC_DGTUmode, CC_Cmode
1774 #define EXTRA_CC_NAMES "CC_NOOV", "CC_Z", "CC_SWP", "CCFP", "CCFPE", \
1775 "CC_DNE", "CC_DEQ", "CC_DLE", "CC_DLT", "CC_DGE", "CC_DGT", "CC_DLEU", \
1776 "CC_DLTU", "CC_DGEU", "CC_DGTU", "CC_C"
1778 enum machine_mode arm_select_cc_mode ();
1779 #define SELECT_CC_MODE(OP,X,Y) arm_select_cc_mode ((OP), (X), (Y))
1781 #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
1783 enum rtx_code arm_canonicalize_comparison ();
1784 #define CANONICALIZE_COMPARISON(CODE,OP0,OP1) \
1785 do \
1787 if (GET_CODE (OP1) == CONST_INT \
1788 && ! (const_ok_for_arm (INTVAL (OP1)) \
1789 || (const_ok_for_arm (- INTVAL (OP1))))) \
1791 rtx const_op = OP1; \
1792 CODE = arm_canonicalize_comparison ((CODE), &const_op); \
1793 OP1 = const_op; \
1795 } while (0)
1797 #define STORE_FLAG_VALUE 1
1799 /* Define the information needed to generate branch insns. This is
1800 stored from the compare operation. Note that we can't use "rtx" here
1801 since it hasn't been defined! */
1803 extern struct rtx_def *arm_compare_op0, *arm_compare_op1;
1804 extern int arm_compare_fp;
1806 /* Define the codes that are matched by predicates in arm.c */
1807 #define PREDICATE_CODES \
1808 {"s_register_operand", {SUBREG, REG}}, \
1809 {"f_register_operand", {SUBREG, REG}}, \
1810 {"arm_add_operand", {SUBREG, REG, CONST_INT}}, \
1811 {"fpu_add_operand", {SUBREG, REG, CONST_DOUBLE}}, \
1812 {"arm_rhs_operand", {SUBREG, REG, CONST_INT}}, \
1813 {"fpu_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \
1814 {"arm_not_operand", {SUBREG, REG, CONST_INT}}, \
1815 {"offsettable_memory_operand", {MEM}}, \
1816 {"bad_signed_byte_operand", {MEM}}, \
1817 {"alignable_memory_operand", {MEM}}, \
1818 {"shiftable_operator", {PLUS, MINUS, AND, IOR, XOR}}, \
1819 {"minmax_operator", {SMIN, SMAX, UMIN, UMAX}}, \
1820 {"shift_operator", {ASHIFT, ASHIFTRT, LSHIFTRT, ROTATERT, MULT}}, \
1821 {"di_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM}}, \
1822 {"soft_df_operand", {SUBREG, REG, CONST_DOUBLE, MEM}}, \
1823 {"load_multiple_operation", {PARALLEL}}, \
1824 {"store_multiple_operation", {PARALLEL}}, \
1825 {"equality_operator", {EQ, NE}}, \
1826 {"arm_rhsm_operand", {SUBREG, REG, CONST_INT, MEM}}, \
1827 {"const_shift_operand", {CONST_INT}}, \
1828 {"index_operand", {SUBREG, REG, CONST_INT}}, \
1829 {"reg_or_int_operand", {SUBREG, REG, CONST_INT}}, \
1830 {"multi_register_push", {PARALLEL}}, \
1831 {"cc_register", {REG}}, \
1832 {"dominant_cc_register", {REG}},
1836 /* Gcc puts the pool in the wrong place for ARM, since we can only
1837 load addresses a limited distance around the pc. We do some
1838 special munging to move the constant pool values to the correct
1839 point in the code. */
1840 #define MACHINE_DEPENDENT_REORG(INSN) arm_reorg ((INSN))
1842 /* The pool is empty, since we have moved everything into the code. */
1843 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE,X,MODE,ALIGN,LABELNO,JUMPTO) \
1844 goto JUMPTO
1846 /* Output an internal label definition. */
1847 #ifndef ASM_OUTPUT_INTERNAL_LABEL
1848 #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
1849 do \
1851 char * s = (char *) alloca (40 + strlen (PREFIX)); \
1852 extern int arm_target_label, arm_ccfsm_state; \
1853 extern rtx arm_target_insn; \
1855 if (arm_ccfsm_state == 3 && arm_target_label == (NUM) \
1856 && !strcmp (PREFIX, "L")) \
1858 arm_ccfsm_state = 0; \
1859 arm_target_insn = NULL; \
1861 ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM)); \
1862 ASM_OUTPUT_LABEL (STREAM, s); \
1863 } while (0)
1864 #endif
1866 /* Output a push or a pop instruction (only used when profiling). */
1867 #define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \
1868 fprintf (STREAM,"\tstmfd\t%ssp!,{%s%s}\n", \
1869 REGISTER_PREFIX, REGISTER_PREFIX, reg_names [REGNO])
1871 #define ASM_OUTPUT_REG_POP(STREAM,REGNO) \
1872 fprintf (STREAM,"\tldmfd\t%ssp!,{%s%s}\n", \
1873 REGISTER_PREFIX, REGISTER_PREFIX, reg_names [REGNO])
1875 /* Target characters. */
1876 #define TARGET_BELL 007
1877 #define TARGET_BS 010
1878 #define TARGET_TAB 011
1879 #define TARGET_NEWLINE 012
1880 #define TARGET_VT 013
1881 #define TARGET_FF 014
1882 #define TARGET_CR 015
1884 /* Only perform branch elimination (by making instructions conditional) if
1885 we're optimising. Otherwise it's of no use anyway. */
1886 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
1887 if (optimize) \
1888 final_prescan_insn (INSN, OPVEC, NOPERANDS)
1890 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
1891 ((CODE) == '?' || (CODE) == '|' || (CODE) == '@')
1892 /* Output an operand of an instruction. */
1893 #define PRINT_OPERAND(STREAM, X, CODE) \
1894 arm_print_operand (STREAM, X, CODE)
1896 #define ARM_SIGN_EXTEND(x) ((HOST_WIDE_INT) \
1897 (HOST_BITS_PER_WIDE_INT <= 32 ? (x) \
1898 : (((x) & (unsigned HOST_WIDE_INT) 0xffffffff) | \
1899 (((x) & (unsigned HOST_WIDE_INT) 0x80000000) \
1900 ? ((~ (HOST_WIDE_INT) 0) \
1901 & ~ (unsigned HOST_WIDE_INT) 0xffffffff) \
1902 : 0))))
1904 /* Output the address of an operand. */
1905 #define PRINT_OPERAND_ADDRESS(STREAM,X) \
1907 int is_minus = GET_CODE (X) == MINUS; \
1909 if (GET_CODE (X) == REG) \
1910 fprintf (STREAM, "[%s%s, #0]", REGISTER_PREFIX, \
1911 reg_names[REGNO (X)]); \
1912 else if (GET_CODE (X) == PLUS || is_minus) \
1914 rtx base = XEXP (X, 0); \
1915 rtx index = XEXP (X, 1); \
1916 char * base_reg_name; \
1917 HOST_WIDE_INT offset = 0; \
1918 if (GET_CODE (base) != REG) \
1920 /* Ensure that BASE is a register (one of them must be). */ \
1921 rtx temp = base; \
1922 base = index; \
1923 index = temp; \
1925 base_reg_name = reg_names[REGNO (base)]; \
1926 switch (GET_CODE (index)) \
1928 case CONST_INT: \
1929 offset = INTVAL (index); \
1930 if (is_minus) \
1931 offset = -offset; \
1932 fprintf (STREAM, "[%s%s, #%d]", REGISTER_PREFIX, \
1933 base_reg_name, offset); \
1934 break; \
1936 case REG: \
1937 fprintf (STREAM, "[%s%s, %s%s%s]", REGISTER_PREFIX, \
1938 base_reg_name, is_minus ? "-" : "", \
1939 REGISTER_PREFIX, reg_names[REGNO (index)] ); \
1940 break; \
1942 case MULT: \
1943 case ASHIFTRT: \
1944 case LSHIFTRT: \
1945 case ASHIFT: \
1946 case ROTATERT: \
1948 fprintf (STREAM, "[%s%s, %s%s%s", REGISTER_PREFIX, \
1949 base_reg_name, is_minus ? "-" : "", REGISTER_PREFIX,\
1950 reg_names[REGNO (XEXP (index, 0))]); \
1951 arm_print_operand (STREAM, index, 'S'); \
1952 fputs ("]", STREAM); \
1953 break; \
1956 default: \
1957 abort(); \
1960 else if (GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC \
1961 || GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC) \
1963 extern int output_memory_reference_mode; \
1965 if (GET_CODE (XEXP (X, 0)) != REG) \
1966 abort (); \
1968 if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \
1969 fprintf (STREAM, "[%s%s, #%s%d]!", REGISTER_PREFIX, \
1970 reg_names[REGNO (XEXP (X, 0))], \
1971 GET_CODE (X) == PRE_DEC ? "-" : "", \
1972 GET_MODE_SIZE (output_memory_reference_mode)); \
1973 else \
1974 fprintf (STREAM, "[%s%s], #%s%d", REGISTER_PREFIX, \
1975 reg_names[REGNO (XEXP (X, 0))], \
1976 GET_CODE (X) == POST_DEC ? "-" : "", \
1977 GET_MODE_SIZE (output_memory_reference_mode)); \
1979 else output_addr_const(STREAM, X); \
1982 /* Handles PIC addr specially */
1983 #define OUTPUT_INT_ADDR_CONST(STREAM,X) \
1985 if (flag_pic && GET_CODE(X) == CONST && is_pic(X)) \
1987 output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \
1988 fputs(" - (", STREAM); \
1989 output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \
1990 fputs(")", STREAM); \
1992 else output_addr_const(STREAM, X); \
1995 /* Output code to add DELTA to the first argument, and then jump to FUNCTION.
1996 Used for C++ multiple inheritance. */
1997 #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
1998 do { \
1999 int mi_delta = (DELTA); \
2000 char *mi_op = mi_delta < 0 ? "sub" : "add"; \
2001 int shift = 0; \
2002 int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) \
2003 ? 1 : 0); \
2004 if (mi_delta < 0) mi_delta = -mi_delta; \
2005 while (mi_delta != 0) \
2007 if (mi_delta & (3 << shift) == 0) \
2008 shift += 2; \
2009 else \
2011 fprintf (FILE, "\t%s\t%s%s, %s%s, #%d\n", \
2012 mi_op, REGISTER_PREFIX, reg_names[this_regno], \
2013 REGISTER_PREFIX, reg_names[this_regno], \
2014 mi_delta & (0xff << shift)); \
2015 mi_delta &= ~(0xff << shift); \
2016 shift += 8; \
2019 fputs ("\tb\t", FILE); \
2020 assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
2021 fputc ('\n', FILE); \
2022 } while (0)
2024 /* A C expression whose value is RTL representing the value of the return
2025 address for the frame COUNT steps up from the current frame. */
2027 #define RETURN_ADDR_RTX(COUNT, FRAME) \
2028 ((COUNT == 0) \
2029 ? gen_rtx (MEM, Pmode, plus_constant (FRAME, -4)) \
2030 : NULL_RTX)
2032 /* Used to mask out junk bits from the return address, such as
2033 processor state, interrupt status, condition codes and the like. */
2034 #define MASK_RETURN_ADDR \
2035 /* If we are generating code for an ARM2/ARM3 machine or for an ARM6 \
2036 in 26 bit mode, the condition codes must be masked out of the \
2037 return address. This does not apply to ARM6 and later processors \
2038 when running in 32 bit mode. */ \
2039 ((!TARGET_APCS_32) ? (GEN_INT (0x03fffffc)) : (GEN_INT (0xffffffff)))
2041 /* Prototypes for arm.c -- actually, they aren't since the types aren't
2042 fully defined yet. */
2044 void arm_override_options (/* void */);
2045 int use_return_insn (/* void */);
2046 int const_ok_for_arm (/* HOST_WIDE_INT */);
2047 int const_ok_for_op (/* HOST_WIDE_INT, enum rtx_code,
2048 enum machine_mode */);
2049 int arm_split_constant (/* enum rtx_code, enum machine_mode,
2050 HOST_WIDE_INT, struct rtx_def *,
2051 struct rtx_def *, int */);
2052 enum rtx_code arm_canonicalize_comparison (/* enum rtx_code,
2053 struct rtx_def ** */);
2054 int arm_return_in_memory (/* union tree_node * */);
2055 int legitimate_pic_operand_p (/* struct rtx_def * */);
2056 struct rtx_def *legitimize_pic_address (/* struct rtx_def *,
2057 enum machine_mode,
2058 struct rtx_def * */);
2059 int is_pic (/* struct rtx_def * */);
2060 void arm_finalize_pic (/* void */);
2061 int arm_rtx_costs (/* struct rtx_def *, enum rtx_code, enum rtx_code */);
2062 int arm_adjust_cost (/* struct rtx_def *, struct rtx_def *,
2063 struct rtx_def *, int */);
2064 int const_double_rtx_ok_for_fpu (/* struct rtx_def * */);
2065 int neg_const_double_rtx_ok_for_fpu (/* struct rtx_def * */);
2066 int s_register_operand (/* struct rtx_def *, enum machine_mode */);
2067 int f_register_operand (/* struct rtx_def *, enum machine_mode */);
2068 int reg_or_int_operand (/* struct rtx_def *, enum machine_mode */);
2069 int reload_memory_operand (/* struct rtx_def *, enum machine_mode */);
2070 int arm_rhs_operand (/* struct rtx_def *, enum machine_mode */);
2071 int arm_rhsm_operand (/* struct rtx_def *, enum machine_mode */);
2072 int arm_add_operand (/* struct rtx_def *, enum machine_mode */);
2073 int arm_not_operand (/* struct rtx_def *, enum machine_mode */);
2074 int offsettable_memory_operand (/* struct rtx_def *, enum machine_mode */);
2075 int alignable_memory_operand (/* struct rtx_def *, enum machine_mode */);
2076 int bad_signed_byte_operand (/* struct rtx_def *, enum machine_mode */);
2077 int fpu_rhs_operand (/* struct rtx_def *, enum machine_mode */);
2078 int fpu_add_operand (/* struct rtx_def *, enum machine_mode */);
2079 int power_of_two_operand (/* struct rtx_def *, enum machine_mode */);
2080 int di_operand (/* struct rtx_def *, enum machine_mode */);
2081 int soft_df_operand (/* struct rtx_def *, enum machine_mode */);
2082 int index_operand (/* struct rtx_def *, enum machine_mode */);
2083 int const_shift_operand (/* struct rtx_def *, enum machine_mode */);
2084 int shiftable_operator (/* struct rtx_def *, enum machine_mode */);
2085 int shift_operator (/* struct rtx_def *, enum machine_mode */);
2086 int equality_operator (/* struct rtx_def *, enum machine_mode */);
2087 int minmax_operator (/* struct rtx_def *, enum machine_mode */);
2088 int cc_register (/* struct rtx_def *, enum machine_mode */);
2089 int dominant_cc_register (/* struct rtx_def *, enum machine_mode */);
2090 int symbol_mentioned_p (/* struct rtx_def * */);
2091 int label_mentioned_p (/* struct rtx_def * */);
2092 enum rtx_code minmax_code (/* struct rtx_def * */);
2093 int adjacent_mem_locations (/* struct rtx_def *, struct rtx_def * */);
2094 int load_multiple_operation (/* struct rtx_def *, enum machine_mode */);
2095 int store_multiple_operation (/* struct rtx_def *, enum machine_mode */);
2096 int load_multiple_sequence (/* struct rtx_def **, int, int *, int *,
2097 HOST_WIDE_INT * */);
2098 char *emit_ldm_seq (/* struct rtx_def **, int */);
2099 int store_multiple_sequence (/* struct rtx_def **, int, int *, int *,
2100 HOST_WIDE_INT * */);
2101 char *emit_stm_seq (/* struct rtx_def **, int */);
2102 int multi_register_push (/* struct rtx_def *, enum machine_mode */);
2103 int arm_valid_machine_decl_attribute (/* union tree_node *, union tree_node *,
2104 union tree_node *,
2105 union tree_node * */);
2106 struct rtx_def *arm_gen_load_multiple (/* int, int, struct rtx_def *,
2107 int, int, int, int */);
2108 struct rtx_def *arm_gen_store_multiple (/* int, int, struct rtx_def *,
2109 int, int, int, int */);
2110 int arm_gen_movstrqi (/* struct rtx_def ** */);
2111 struct rtx_def *gen_rotated_half_load (/* struct rtx_def * */);
2112 enum machine_mode arm_select_cc_mode (/* enum rtx_code, struct rtx_def *,
2113 struct rtx_def * */);
2114 struct rtx_def *gen_compare_reg (/* enum rtx_code, struct rtx_def *,
2115 struct rtx_def * */);
2116 void arm_reload_in_hi (/* struct rtx_def ** */);
2117 void arm_reload_out_hi (/* struct rtx_def ** */);
2118 void arm_reorg (/* struct rtx_def * */);
2119 char *fp_immediate_constant (/* struct rtx_def * */);
2120 void print_multi_reg (/* FILE *, char *, int, int */);
2121 char *output_call (/* struct rtx_def ** */);
2122 char *output_call_mem (/* struct rtx_def ** */);
2123 char *output_mov_long_double_fpu_from_arm (/* struct rtx_def ** */);
2124 char *output_mov_long_double_arm_from_fpu (/* struct rtx_def ** */);
2125 char *output_mov_long_double_arm_from_arm (/* struct rtx_def ** */);
2126 char *output_mov_double_fpu_from_arm (/* struct rtx_def ** */);
2127 char *output_mov_double_arm_from_fpu (/* struct rtx_def ** */);
2128 char *output_move_double (/* struct rtx_def ** */);
2129 char *output_mov_immediate (/* struct rtx_def ** */);
2130 char *output_add_immediate (/* struct rtx_def ** */);
2131 char *arithmetic_instr (/* struct rtx_def *, int */);
2132 void output_ascii_pseudo_op (/* FILE *, unsigned char *, int */);
2133 char *output_return_instruction (/* struct rtx_def *, int, int */);
2134 int arm_volatile_func (/* void */);
2135 void output_func_prologue (/* FILE *, int */);
2136 void output_func_epilogue (/* FILE *, int */);
2137 void arm_expand_prologue (/* void */);
2138 void arm_print_operand (/* FILE *, struct rtx_def *, int */);
2139 void final_prescan_insn (/* struct rtx_def *, struct rtx_def **, int */);
2140 #ifdef AOF_ASSEMBLER
2141 struct rtx_def *aof_pic_entry (/* struct rtx_def * */);
2142 void aof_dump_pic_table (/* FILE * */);
2143 char *aof_text_section (/* void */);
2144 char *aof_data_section (/* void */);
2145 void aof_add_import (/* char * */);
2146 void aof_delete_import (/* char * */);
2147 void aof_dump_imports (/* FILE * */);
2148 #endif
2150 #endif /* __ARM_H__ */