comparison gcc/config/m68hc11/m68hc11.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 b7f97abdc517
children
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* Definitions of target machine for GNU compiler. 1 /* Definitions of target machine for GNU compiler.
2 Motorola 68HC11 and 68HC12. 2 Motorola 68HC11 and 68HC12.
3 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 3 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 Contributed by Stephane Carrez (stcarrez@nerim.fr) 5 Contributed by Stephane Carrez (stcarrez@nerim.fr)
6 6
7 This file is part of GCC. 7 This file is part of GCC.
8 8
139 # endif 139 # endif
140 #endif 140 #endif
141 141
142 /* Print subsidiary information on the compiler version in use. */ 142 /* Print subsidiary information on the compiler version in use. */
143 #define TARGET_VERSION fprintf (stderr, " (MC68HC11/MC68HC12/MC68HCS12)") 143 #define TARGET_VERSION fprintf (stderr, " (MC68HC11/MC68HC12/MC68HCS12)")
144
145 /* Sometimes certain combinations of command options do not make
146 sense on a particular target machine. You can define a macro
147 `OVERRIDE_OPTIONS' to take account of this. This macro, if
148 defined, is executed once just after all the command options have
149 been parsed.
150
151 Don't use this macro to turn on various extra optimizations for
152 `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
153
154 #define OVERRIDE_OPTIONS m68hc11_override_options ()
155 144
156 145
157 /* Define cost parameters for a given processor variant. */ 146 /* Define cost parameters for a given processor variant. */
158 struct processor_costs { 147 struct processor_costs {
159 const int add; /* cost of an add instruction */ 148 const int add; /* cost of an add instruction */
380 registers, all are available. */ 369 registers, all are available. */
381 #define CALL_USED_REGISTERS \ 370 #define CALL_USED_REGISTERS \
382 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, SOFT_REG_USED, 1, 1} 371 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, SOFT_REG_USED, 1, 1}
383 /* X, D, Y, SP,PC,A, B, CCR, Z, FP, ZTMP,ZR,XYR, D1 - 32, SOFT-FP, AP */ 372 /* X, D, Y, SP,PC,A, B, CCR, Z, FP, ZTMP,ZR,XYR, D1 - 32, SOFT-FP, AP */
384 373
385
386 /* Define this macro to change register usage conditional on target flags.
387
388 The soft-registers are disabled or enabled according to the
389 -msoft-reg-count=<n> option. */
390
391
392 #define CONDITIONAL_REGISTER_USAGE (m68hc11_conditional_register_usage ())
393 374
394 /* List the order in which to allocate registers. Each register must be 375 /* List the order in which to allocate registers. Each register must be
395 listed once, even those in FIXED_REGISTERS. */ 376 listed once, even those in FIXED_REGISTERS. */
396 #define REG_ALLOC_ORDER \ 377 #define REG_ALLOC_ORDER \
397 { HARD_D_REGNUM, HARD_X_REGNUM, HARD_Y_REGNUM, \ 378 { HARD_D_REGNUM, HARD_X_REGNUM, HARD_Y_REGNUM, \
713 considered for use as a rename register for REGNO1 */ 694 considered for use as a rename register for REGNO1 */
714 695
715 #define HARD_REGNO_RENAME_OK(REGNO1,REGNO2) \ 696 #define HARD_REGNO_RENAME_OK(REGNO1,REGNO2) \
716 m68hc11_hard_regno_rename_ok ((REGNO1), (REGNO2)) 697 m68hc11_hard_regno_rename_ok ((REGNO1), (REGNO2))
717 698
718 /* A C expression whose value is nonzero if pseudos that have been
719 assigned to registers of class CLASS would likely be spilled
720 because registers of CLASS are needed for spill registers.
721
722 The default value of this macro returns 1 if CLASS has exactly one
723 register and zero otherwise. On most machines, this default
724 should be used. Only define this macro to some other expression
725 if pseudo allocated by `local-alloc.c' end up in memory because
726 their hard registers were needed for spill registers. If this
727 macro returns nonzero for those classes, those pseudos will only
728 be allocated by `global.c', which knows how to reallocate the
729 pseudo to another register. If there would not be another
730 register available for reallocation, you should not change the
731 definition of this macro since the only effect of such a
732 definition would be to slow down register allocation. */
733
734 #define CLASS_LIKELY_SPILLED_P(CLASS) \
735 (((CLASS) == D_REGS) \
736 || ((CLASS) == X_REGS) \
737 || ((CLASS) == Y_REGS) \
738 || ((CLASS) == A_REGS) \
739 || ((CLASS) == SP_REGS) \
740 || ((CLASS) == D_OR_X_REGS) \
741 || ((CLASS) == D_OR_Y_REGS) \
742 || ((CLASS) == X_OR_SP_REGS) \
743 || ((CLASS) == Y_OR_SP_REGS) \
744 || ((CLASS) == D_OR_SP_REGS))
745
746 /* Return the maximum number of consecutive registers needed to represent 699 /* Return the maximum number of consecutive registers needed to represent
747 mode MODE in a register of class CLASS. */ 700 mode MODE in a register of class CLASS. */
748 #define CLASS_MAX_NREGS(CLASS, MODE) \ 701 #define CLASS_MAX_NREGS(CLASS, MODE) \
749 (((CLASS) == DA_REGS || (CLASS) == DB_REGS \ 702 (((CLASS) == DA_REGS || (CLASS) == DB_REGS \
750 || (CLASS) == D8_REGS || (CLASS) == Q_REGS) ? GET_MODE_SIZE (MODE) \ 703 || (CLASS) == D8_REGS || (CLASS) == Q_REGS) ? GET_MODE_SIZE (MODE) \
894 847
895 /* If we generate an insn to push BYTES bytes, this says how many the 848 /* If we generate an insn to push BYTES bytes, this says how many the
896 stack pointer really advances by. No rounding or alignment needed 849 stack pointer really advances by. No rounding or alignment needed
897 for MC6811. */ 850 for MC6811. */
898 #define PUSH_ROUNDING(BYTES) (BYTES) 851 #define PUSH_ROUNDING(BYTES) (BYTES)
899
900 /* Value is 1 if returning from a function call automatically pops the
901 arguments described by the number-of-args field in the call. FUNTYPE is
902 the data type of the function (as a tree), or for a library call it is
903 an identifier node for the subroutine name.
904
905 The standard MC6811 call, with arg count word, includes popping the
906 args as part of the call template. */
907 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
908 852
909 /* Passing Arguments in Registers. */ 853 /* Passing Arguments in Registers. */
910 854
911 /* Define a data type for recording info about an argument list 855 /* Define a data type for recording info about an argument list
912 during the scan of that argument list. This data type should 856 during the scan of that argument list. This data type should
935 879
936 /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a 880 /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a
937 function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ 881 function whose data type is FNTYPE. For a library call, FNTYPE is 0. */
938 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ 882 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
939 (m68hc11_init_cumulative_args (&CUM, FNTYPE, LIBNAME)) 883 (m68hc11_init_cumulative_args (&CUM, FNTYPE, LIBNAME))
940
941 /* Update the data in CUM to advance over an argument of mode MODE and data
942 type TYPE. (TYPE is null for libcalls where that information may not be
943 available.) */
944 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
945 (m68hc11_function_arg_advance (&CUM, MODE, TYPE, NAMED))
946
947 /* Define where to put the arguments to a function.
948 Value is zero to push the argument on the stack,
949 or a hard register in which to store the argument.
950
951 MODE is the argument's machine mode.
952 TYPE is the data type of the argument (as a tree).
953 This is null for libcalls where that information may
954 not be available.
955 CUM is a variable of type CUMULATIVE_ARGS which gives info about
956 the preceding args and about the function being called.
957 NAMED is nonzero if this argument is a named parameter
958 (otherwise it is an extra parameter matching an ellipsis). */
959 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
960 (m68hc11_function_arg (&CUM, MODE, TYPE, NAMED))
961 884
962 /* Define the profitability of saving registers around calls. 885 /* Define the profitability of saving registers around calls.
963 886
964 Disable this because the saving instructions generated by 887 Disable this because the saving instructions generated by
965 caller-save need a reload and the way it is implemented, 888 caller-save need a reload and the way it is implemented,
1349 #define REGISTER_NAMES \ 1272 #define REGISTER_NAMES \
1350 { "x", "d", "y", "sp", "pc", "a", "b", "ccr", "z", \ 1273 { "x", "d", "y", "sp", "pc", "a", "b", "ccr", "z", \
1351 "*_.frame", "*_.tmp", "*_.z", "*_.xy", "*fake clobber", \ 1274 "*_.frame", "*_.tmp", "*_.z", "*_.xy", "*fake clobber", \
1352 SOFT_REG_NAMES, "*sframe", "*ap"} 1275 SOFT_REG_NAMES, "*sframe", "*ap"}
1353 1276
1354 /* Print an instruction operand X on file FILE. CODE is the code from the
1355 %-spec for printing this operand. If `%z3' was used to print operand
1356 3, then CODE is 'z'. */
1357
1358 #define PRINT_OPERAND(FILE, X, CODE) \
1359 print_operand (FILE, X, CODE)
1360
1361 /* Print a memory operand whose address is X, on file FILE. */
1362 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
1363 print_operand_address (FILE, ADDR)
1364
1365 /* This is how to output an insn to push/pop a register on the stack. 1277 /* This is how to output an insn to push/pop a register on the stack.
1366 It need not be very fast code. 1278 It need not be very fast code.
1367 1279
1368 Don't define because we don't know how to handle that with 1280 Don't define because we don't know how to handle that with
1369 the STATIC_CHAIN_REGNUM (soft register). Saving the static 1281 the STATIC_CHAIN_REGNUM (soft register). Saving the static