Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/h8300/h8300.h @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Definitions of target machine for GNU compiler. | 1 /* Definitions of target machine for GNU compiler. |
2 Renesas H8/300 (generic) | 2 Renesas H8/300 (generic) |
3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, | 3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, |
4 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 | 4 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 |
5 Free Software Foundation, Inc. | 5 Free Software Foundation, Inc. |
6 Contributed by Steve Chamberlain (sac@cygnus.com), | 6 Contributed by Steve Chamberlain (sac@cygnus.com), |
7 Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). | 7 Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). |
8 | 8 |
9 This file is part of GCC. | 9 This file is part of GCC. |
145 #endif | 145 #endif |
146 | 146 |
147 /* Show we can debug even without a frame pointer. */ | 147 /* Show we can debug even without a frame pointer. */ |
148 /* #define CAN_DEBUG_WITHOUT_FP */ | 148 /* #define CAN_DEBUG_WITHOUT_FP */ |
149 | 149 |
150 /* We want dwarf2 info available to gdb... */ | |
151 #define DWARF2_DEBUGGING_INFO 1 | |
152 /* ... but we don't actually support full dwarf2 EH. */ | |
153 #define MUST_USE_SJLJ_EXCEPTIONS 1 | |
154 | |
155 /* The return address is pushed on the stack. */ | |
156 #define INCOMING_RETURN_ADDR_RTX gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, STACK_POINTER_REGNUM)) | |
157 #define INCOMING_FRAME_SP_OFFSET (POINTER_SIZE / 8) | |
158 | |
159 #define DWARF_CIE_DATA_ALIGNMENT 2 | |
160 | |
150 /* Define this if addresses of constant functions | 161 /* Define this if addresses of constant functions |
151 shouldn't be put through pseudo regs where they can be cse'd. | 162 shouldn't be put through pseudo regs where they can be cse'd. |
152 Desirable on machines where ordinary constants are expensive | 163 Desirable on machines where ordinary constants are expensive |
153 but a CALL with constant address is cheap. | 164 but a CALL with constant address is cheap. |
154 | 165 |
297 /* Base register for access to local variables of the function. */ | 308 /* Base register for access to local variables of the function. */ |
298 #define HARD_FRAME_POINTER_REGNUM HFP_REG | 309 #define HARD_FRAME_POINTER_REGNUM HFP_REG |
299 | 310 |
300 /* Base register for access to local variables of the function. */ | 311 /* Base register for access to local variables of the function. */ |
301 #define FRAME_POINTER_REGNUM FP_REG | 312 #define FRAME_POINTER_REGNUM FP_REG |
302 | |
303 /* Value should be nonzero if functions must have frame pointers. | |
304 Zero means the frame pointer need not be set up (and parms | |
305 may be accessed via the stack pointer) in functions that seem suitable. | |
306 This is computed in `reload', in reload1.c. */ | |
307 #define FRAME_POINTER_REQUIRED 0 | |
308 | 313 |
309 /* Base register for access to arguments of the function. */ | 314 /* Base register for access to arguments of the function. */ |
310 #define ARG_POINTER_REGNUM AP_REG | 315 #define ARG_POINTER_REGNUM AP_REG |
311 | 316 |
312 /* Register in which static-chain is passed to a function. */ | 317 /* Register in which static-chain is passed to a function. */ |
562 { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | 567 { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ |
563 { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ | 568 { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ |
564 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | 569 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ |
565 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} | 570 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} |
566 | 571 |
567 /* Given FROM and TO register numbers, say whether this elimination is allowed. | |
568 Frame pointer elimination is automatically handled. | |
569 | |
570 For the h8300, if frame pointer elimination is being done, we would like to | |
571 convert ap and rp into sp, not fp. | |
572 | |
573 All other eliminations are valid. */ | |
574 | |
575 #define CAN_ELIMINATE(FROM, TO) \ | |
576 ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1) | |
577 | |
578 /* Define the offset between two registers, one to be eliminated, and the other | 572 /* Define the offset between two registers, one to be eliminated, and the other |
579 its replacement, at the start of a routine. */ | 573 its replacement, at the start of a routine. */ |
580 | 574 |
581 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ | 575 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ |
582 ((OFFSET) = h8300_initial_elimination_offset ((FROM), (TO))) | 576 ((OFFSET) = h8300_initial_elimination_offset ((FROM), (TO))) |
687 functions that have frame pointers. | 681 functions that have frame pointers. |
688 No definition is equivalent to always zero. */ | 682 No definition is equivalent to always zero. */ |
689 | 683 |
690 #define EXIT_IGNORE_STACK 0 | 684 #define EXIT_IGNORE_STACK 0 |
691 | 685 |
692 /* We emit the entire trampoline with INITIALIZE_TRAMPOLINE. | |
693 Depending on the pointer size, we use a different trampoline. | |
694 | |
695 Pmode == HImode | |
696 vvvv context | |
697 1 0000 7903xxxx mov.w #0x1234,r3 | |
698 2 0004 5A00xxxx jmp @0x1234 | |
699 ^^^^ function | |
700 | |
701 Pmode == SImode | |
702 vvvvvvvv context | |
703 2 0000 7A03xxxxxxxx mov.l #0x12345678,er3 | |
704 3 0006 5Axxxxxx jmp @0x123456 | |
705 ^^^^^^ function | |
706 */ | |
707 | |
708 /* Length in units of the trampoline for entering a nested function. */ | 686 /* Length in units of the trampoline for entering a nested function. */ |
709 | 687 |
710 #define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12) | 688 #define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12) |
711 | |
712 /* Emit RTL insns to build a trampoline. | |
713 FNADDR is an RTX for the address of the function's pure code. | |
714 CXT is an RTX for the static chain value for the function. */ | |
715 | |
716 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ | |
717 do \ | |
718 { \ | |
719 if (Pmode == HImode) \ | |
720 { \ | |
721 emit_move_insn (gen_rtx_MEM (HImode, (TRAMP)), GEN_INT (0x7903)); \ | |
722 emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), \ | |
723 (CXT)); \ | |
724 emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 4)), \ | |
725 GEN_INT (0x5a00)); \ | |
726 emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), \ | |
727 (FNADDR)); \ | |
728 } \ | |
729 else \ | |
730 { \ | |
731 rtx tem = gen_reg_rtx (Pmode); \ | |
732 \ | |
733 emit_move_insn (gen_rtx_MEM (HImode, (TRAMP)), GEN_INT (0x7a03)); \ | |
734 emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 2)), \ | |
735 (CXT)); \ | |
736 emit_move_insn (tem, (FNADDR)); \ | |
737 emit_insn (gen_andsi3 (tem, tem, GEN_INT (0x00ffffff))); \ | |
738 emit_insn (gen_iorsi3 (tem, tem, GEN_INT (0x5a000000))); \ | |
739 emit_move_insn (gen_rtx_MEM (Pmode, plus_constant ((TRAMP), 6)), \ | |
740 tem); \ | |
741 } \ | |
742 } \ | |
743 while (0) | |
744 | 689 |
745 /* Addressing modes, and classification of registers for them. */ | 690 /* Addressing modes, and classification of registers for them. */ |
746 | 691 |
747 #define HAVE_POST_INCREMENT 1 | 692 #define HAVE_POST_INCREMENT 1 |
748 #define HAVE_PRE_DECREMENT 1 | 693 #define HAVE_PRE_DECREMENT 1 |
925 we just test for W here. */ | 870 we just test for W here. */ |
926 #define EXTRA_MEMORY_CONSTRAINT(C, STR) \ | 871 #define EXTRA_MEMORY_CONSTRAINT(C, STR) \ |
927 ((C) == 'W') | 872 ((C) == 'W') |
928 | 873 |
929 | 874 |
930 #ifndef REG_OK_STRICT | |
931 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ | |
932 do \ | |
933 { \ | |
934 if (h8300_legitimate_address_p ((MODE), (X), 0)) \ | |
935 goto ADDR; \ | |
936 } \ | |
937 while (0) | |
938 #else | |
939 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ | |
940 do \ | |
941 { \ | |
942 if (h8300_legitimate_address_p ((MODE), (X), 1)) \ | |
943 goto ADDR; \ | |
944 } \ | |
945 while (0) | |
946 #endif | |
947 | |
948 /* Go to LABEL if ADDR (a legitimate address expression) | 875 /* Go to LABEL if ADDR (a legitimate address expression) |
949 has an effect that depends on the machine mode it is used for. | 876 has an effect that depends on the machine mode it is used for. |
950 | 877 |
951 On the H8/300, the predecrement and postincrement address depend thus | 878 On the H8/300, the predecrement and postincrement address depend thus |
952 (the amount of decrement or increment being the length of the operand). */ | 879 (the amount of decrement or increment being the length of the operand). */ |