Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/arc/arc.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | 77e2b8dfacca |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* Definitions of target machine for GNU compiler, Argonaut ARC cpu. | 1 /* Definitions of target machine for GNU compiler, Argonaut ARC cpu. |
2 Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, | 2 Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, |
3 2007, 2008, 2009 Free Software Foundation, Inc. | 3 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify | 7 GCC is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
27 */ | 27 */ |
28 | 28 |
29 | 29 |
30 #undef ASM_SPEC | 30 #undef ASM_SPEC |
31 #undef LINK_SPEC | 31 #undef LINK_SPEC |
32 #undef LIB_SPEC | |
32 #undef STARTFILE_SPEC | 33 #undef STARTFILE_SPEC |
33 #undef ENDFILE_SPEC | 34 #undef ENDFILE_SPEC |
34 #undef SIZE_TYPE | 35 #undef SIZE_TYPE |
35 #undef PTRDIFF_TYPE | 36 #undef PTRDIFF_TYPE |
36 #undef WCHAR_TYPE | 37 #undef WCHAR_TYPE |
60 %{mcpu=*:-mmangle-cpu} \ | 61 %{mcpu=*:-mmangle-cpu} \ |
61 %{EB:%{EL:%emay not use both -EB and -EL}} \ | 62 %{EB:%{EL:%emay not use both -EB and -EL}} \ |
62 %{EB:-mbig-endian} %{EL:-mlittle-endian} \ | 63 %{EB:-mbig-endian} %{EL:-mlittle-endian} \ |
63 " | 64 " |
64 | 65 |
65 #define ASM_SPEC "%{v} %{EB} %{EL}" | 66 #define ASM_SPEC "%{EB} %{EL}" |
66 | 67 |
67 #define LINK_SPEC "%{v} %{EB} %{EL}" | 68 #define LINK_SPEC "%{v} %{EB} %{EL}" |
69 | |
70 #define LIB_SPEC "-lc" | |
68 | 71 |
69 #define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s" | 72 #define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s" |
70 | 73 |
71 #define ENDFILE_SPEC "crtfini.o%s" | 74 #define ENDFILE_SPEC "crtfini.o%s" |
72 | 75 |
80 extern int arc_cpu_type; | 83 extern int arc_cpu_type; |
81 | 84 |
82 /* Check if CPU is an extension and set `arc_cpu_type' and `arc_mangle_cpu' | 85 /* Check if CPU is an extension and set `arc_cpu_type' and `arc_mangle_cpu' |
83 appropriately. The result should be nonzero if the cpu is recognized, | 86 appropriately. The result should be nonzero if the cpu is recognized, |
84 otherwise zero. This is intended to be redefined in a cover file. | 87 otherwise zero. This is intended to be redefined in a cover file. |
85 This is used by arc_init. */ | 88 This is used by arc_handle_option. */ |
86 #define ARC_EXTENSION_CPU(cpu) 0 | 89 #define ARC_EXTENSION_CPU(cpu) 0 |
87 | 90 |
88 /* Sometimes certain combinations of command options do not make | |
89 sense on a particular target machine. You can define a macro | |
90 `OVERRIDE_OPTIONS' to take account of this. This macro, if | |
91 defined, is executed once just after all the command options have | |
92 been parsed. | |
93 | |
94 Don't use this macro to turn on various extra optimizations for | |
95 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ | |
96 | |
97 | |
98 #define OVERRIDE_OPTIONS \ | |
99 do { \ | |
100 /* These need to be done at start up. It's convenient to do them here. */ \ | |
101 arc_init (); \ | |
102 } while (0) | |
103 | 91 |
104 /* Target machine storage layout. */ | 92 /* Target machine storage layout. */ |
105 | 93 |
106 /* Define this if most significant bit is lowest numbered | 94 /* Define this if most significant bit is lowest numbered |
107 in instructions that operate on numbered bit-fields. */ | 95 in instructions that operate on numbered bit-fields. */ |
111 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN) | 99 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN) |
112 | 100 |
113 /* Define this if most significant word of a multiword number is the lowest | 101 /* Define this if most significant word of a multiword number is the lowest |
114 numbered. */ | 102 numbered. */ |
115 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN) | 103 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN) |
116 | |
117 /* Define this to set the endianness to use in libgcc2.c, which can | |
118 not depend on target_flags. */ | |
119 #ifdef __big_endian__ | |
120 #define LIBGCC2_WORDS_BIG_ENDIAN 1 | |
121 #else | |
122 #define LIBGCC2_WORDS_BIG_ENDIAN 0 | |
123 #endif | |
124 | 104 |
125 /* Width of a word, in units (bytes). */ | 105 /* Width of a word, in units (bytes). */ |
126 #define UNITS_PER_WORD 4 | 106 #define UNITS_PER_WORD 4 |
127 | 107 |
128 /* Define this macro if it is advisable to hold scalars in registers | 108 /* Define this macro if it is advisable to hold scalars in registers |
281 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31, \ | 261 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31, \ |
282 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ | 262 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ |
283 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, \ | 263 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, \ |
284 27, 28, 29, 30 } | 264 27, 28, 29, 30 } |
285 | 265 |
286 /* Macro to conditionally modify fixed_regs/call_used_regs. */ | |
287 #define CONDITIONAL_REGISTER_USAGE \ | |
288 do { \ | |
289 if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \ | |
290 { \ | |
291 fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ | |
292 call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ | |
293 } \ | |
294 } while (0) | |
295 | |
296 /* Return number of consecutive hard regs needed starting at reg REGNO | 266 /* Return number of consecutive hard regs needed starting at reg REGNO |
297 to hold something of mode MODE. | 267 to hold something of mode MODE. |
298 This is ordinarily the length in words of a value of mode MODE | 268 This is ordinarily the length in words of a value of mode MODE |
299 but can be less for certain modes in special long registers. */ | 269 but can be less for certain modes in special long registers. */ |
300 #define HARD_REGNO_NREGS(REGNO, MODE) \ | 270 #define HARD_REGNO_NREGS(REGNO, MODE) \ |
388 has been allocated, which happens in local-alloc.c. */ | 358 has been allocated, which happens in local-alloc.c. */ |
389 #define REGNO_OK_FOR_BASE_P(REGNO) \ | 359 #define REGNO_OK_FOR_BASE_P(REGNO) \ |
390 ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32) | 360 ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32) |
391 #define REGNO_OK_FOR_INDEX_P(REGNO) \ | 361 #define REGNO_OK_FOR_INDEX_P(REGNO) \ |
392 ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32) | 362 ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32) |
393 | |
394 /* Given an rtx X being reloaded into a reg required to be | |
395 in class CLASS, return the class of reg to actually use. | |
396 In general this is just CLASS; but on some machines | |
397 in some cases it is preferable to use a more restrictive class. */ | |
398 #define PREFERRED_RELOAD_CLASS(X,CLASS) \ | |
399 (CLASS) | |
400 | 363 |
401 /* Return the maximum number of consecutive registers | 364 /* Return the maximum number of consecutive registers |
402 needed to represent mode MODE in a register of class CLASS. */ | 365 needed to represent mode MODE in a register of class CLASS. */ |
403 #define CLASS_MAX_NREGS(CLASS, MODE) \ | 366 #define CLASS_MAX_NREGS(CLASS, MODE) \ |
404 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | 367 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) |
528 `crtl->outgoing_args_size'. No space will be pushed | 491 `crtl->outgoing_args_size'. No space will be pushed |
529 onto the stack for each call; instead, the function prologue should | 492 onto the stack for each call; instead, the function prologue should |
530 increase the stack frame size by this amount. */ | 493 increase the stack frame size by this amount. */ |
531 #define ACCUMULATE_OUTGOING_ARGS 1 | 494 #define ACCUMULATE_OUTGOING_ARGS 1 |
532 | 495 |
533 /* Value is the number of bytes of arguments automatically | |
534 popped when returning from a subroutine call. | |
535 FUNDECL is the declaration node of the function (as a tree), | |
536 FUNTYPE is the data type of the function (as a tree), | |
537 or for a library call it is an identifier node for the subroutine name. | |
538 SIZE is the number of bytes of arguments passed on the stack. */ | |
539 #define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0 | |
540 | |
541 /* Define a data type for recording info about an argument list | 496 /* Define a data type for recording info about an argument list |
542 during the scan of that argument list. This data type should | 497 during the scan of that argument list. This data type should |
543 hold all necessary information about the function itself | 498 hold all necessary information about the function itself |
544 and about the args processed so far, enough to enable macros | 499 and about the args processed so far, enough to enable macros |
545 such as FUNCTION_ARG to determine where the next arg should go. */ | 500 such as FUNCTION_ARG to determine where the next arg should go. */ |
556 | 511 |
557 /* 1 if N is a possible register number for function argument passing. */ | 512 /* 1 if N is a possible register number for function argument passing. */ |
558 #define FUNCTION_ARG_REGNO_P(N) \ | 513 #define FUNCTION_ARG_REGNO_P(N) \ |
559 ((unsigned) (N) < MAX_ARC_PARM_REGS) | 514 ((unsigned) (N) < MAX_ARC_PARM_REGS) |
560 | 515 |
561 /* The ROUND_ADVANCE* macros are local to this file. */ | |
562 /* Round SIZE up to a word boundary. */ | |
563 #define ROUND_ADVANCE(SIZE) \ | |
564 (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
565 | |
566 /* Round arg MODE/TYPE up to the next word boundary. */ | |
567 #define ROUND_ADVANCE_ARG(MODE, TYPE) \ | |
568 ((MODE) == BLKmode \ | |
569 ? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \ | |
570 : ROUND_ADVANCE (GET_MODE_SIZE (MODE))) | |
571 | |
572 /* Round CUM up to the necessary point for argument MODE/TYPE. */ | |
573 #define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \ | |
574 ((((MODE) == BLKmode ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) \ | |
575 > BITS_PER_WORD) \ | |
576 ? (((CUM) + 1) & ~1) \ | |
577 : (CUM)) | |
578 | |
579 /* Return boolean indicating arg of type TYPE and mode MODE will be passed in | |
580 a reg. This includes arguments that have to be passed by reference as the | |
581 pointer to them is passed in a reg if one is available (and that is what | |
582 we're given). | |
583 This macro is only used in this file. */ | |
584 #define PASS_IN_REG_P(CUM, MODE, TYPE) \ | |
585 ((CUM) < MAX_ARC_PARM_REGS \ | |
586 && ((ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \ | |
587 + ROUND_ADVANCE_ARG ((MODE), (TYPE)) \ | |
588 <= MAX_ARC_PARM_REGS))) | |
589 | |
590 /* Determine where to put an argument to a function. | |
591 Value is zero to push the argument on the stack, | |
592 or a hard register in which to store the argument. | |
593 | |
594 MODE is the argument's machine mode. | |
595 TYPE is the data type of the argument (as a tree). | |
596 This is null for libcalls where that information may | |
597 not be available. | |
598 CUM is a variable of type CUMULATIVE_ARGS which gives info about | |
599 the preceding args and about the function being called. | |
600 NAMED is nonzero if this argument is a named parameter | |
601 (otherwise it is an extra parameter matching an ellipsis). */ | |
602 /* On the ARC the first MAX_ARC_PARM_REGS args are normally in registers | |
603 and the rest are pushed. */ | |
604 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ | |
605 (PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \ | |
606 ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ | |
607 : 0) | |
608 | |
609 /* Update the data in CUM to advance over an argument | |
610 of mode MODE and data type TYPE. | |
611 (TYPE is null for libcalls where that information may not be available.) */ | |
612 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ | |
613 ((CUM) = (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \ | |
614 + ROUND_ADVANCE_ARG ((MODE), (TYPE)))) | |
615 | |
616 /* If defined, a C expression that gives the alignment boundary, in bits, | |
617 of an argument with the specified mode and type. If it is not defined, | |
618 PARM_BOUNDARY is used for all arguments. */ | |
619 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ | |
620 (((TYPE) ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) <= PARM_BOUNDARY \ | |
621 ? PARM_BOUNDARY \ | |
622 : 2 * PARM_BOUNDARY) | |
623 | 516 |
624 /* Function results. */ | 517 /* Function results. */ |
625 | 518 |
626 /* Define how to find the value returned by a function. | 519 /* Define how to find the value returned by a function. |
627 VALTYPE is the data type of the value (as a tree). | 520 VALTYPE is the data type of the value (as a tree). |