Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/m68k/m68k.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 | f6334be47118 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Definitions of target machine for GCC for Motorola 680x0/ColdFire. | 1 /* Definitions of target machine for GCC for Motorola 680x0/ColdFire. |
2 Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 2 Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
4 Free Software Foundation, Inc. | |
4 | 5 |
5 This file is part of GCC. | 6 This file is part of GCC. |
6 | 7 |
7 GCC is free software; you can redistribute it and/or modify | 8 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 | 9 it under the terms of the GNU General Public License as published by |
230 #define FL_ISA_APLUS (1 << 14) | 231 #define FL_ISA_APLUS (1 << 14) |
231 #define FL_ISA_B (1 << 15) | 232 #define FL_ISA_B (1 << 15) |
232 #define FL_ISA_C (1 << 16) | 233 #define FL_ISA_C (1 << 16) |
233 #define FL_FIDOA (1 << 17) | 234 #define FL_FIDOA (1 << 17) |
234 #define FL_MMU 0 /* Used by multilib machinery. */ | 235 #define FL_MMU 0 /* Used by multilib machinery. */ |
236 #define FL_UCLINUX 0 /* Used by multilib machinery. */ | |
235 | 237 |
236 #define TARGET_68010 ((m68k_cpu_flags & FL_ISA_68010) != 0) | 238 #define TARGET_68010 ((m68k_cpu_flags & FL_ISA_68010) != 0) |
237 #define TARGET_68020 ((m68k_cpu_flags & FL_ISA_68020) != 0) | 239 #define TARGET_68020 ((m68k_cpu_flags & FL_ISA_68020) != 0) |
238 #define TARGET_68040 ((m68k_cpu_flags & FL_ISA_68040) != 0) | 240 #define TARGET_68040 ((m68k_cpu_flags & FL_ISA_68040) != 0) |
239 #define TARGET_COLDFIRE ((m68k_cpu_flags & FL_COLDFIRE) != 0) | 241 #define TARGET_COLDFIRE ((m68k_cpu_flags & FL_COLDFIRE) != 0) |
451 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS | 453 /* Most m68k targets use %a6 as a frame pointer. The AmigaOS |
452 ABI uses %a6 for shared library calls, therefore the frame | 454 ABI uses %a6 for shared library calls, therefore the frame |
453 pointer is shifted to %a5 on this target. */ | 455 pointer is shifted to %a5 on this target. */ |
454 #define FRAME_POINTER_REGNUM A6_REG | 456 #define FRAME_POINTER_REGNUM A6_REG |
455 | 457 |
456 #define FRAME_POINTER_REQUIRED 0 | |
457 | |
458 /* Base register for access to arguments of the function. | 458 /* Base register for access to arguments of the function. |
459 * This isn't a hardware register. It will be eliminated to the | 459 * This isn't a hardware register. It will be eliminated to the |
460 * stack pointer or frame pointer. | 460 * stack pointer or frame pointer. |
461 */ | 461 */ |
462 #define ARG_POINTER_REGNUM 24 | 462 #define ARG_POINTER_REGNUM 24 |
614 /* Targets redefine this to invoke code to either flush the cache, | 614 /* Targets redefine this to invoke code to either flush the cache, |
615 or enable stack execution (or both). */ | 615 or enable stack execution (or both). */ |
616 #ifndef FINALIZE_TRAMPOLINE | 616 #ifndef FINALIZE_TRAMPOLINE |
617 #define FINALIZE_TRAMPOLINE(TRAMP) | 617 #define FINALIZE_TRAMPOLINE(TRAMP) |
618 #endif | 618 #endif |
619 | |
620 /* We generate a two-instructions program at address TRAMP : | |
621 movea.l &CXT,%a0 | |
622 jmp FNADDR */ | |
623 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ | |
624 { \ | |
625 emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \ | |
626 GEN_INT(0x207C + ((STATIC_CHAIN_REGNUM-8) << 9))); \ | |
627 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \ | |
628 emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), \ | |
629 GEN_INT(0x4EF9)); \ | |
630 emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), FNADDR); \ | |
631 FINALIZE_TRAMPOLINE(TRAMP); \ | |
632 } | |
633 | 619 |
634 /* This is the library routine that is used to transfer control from the | 620 /* This is the library routine that is used to transfer control from the |
635 trampoline to the actual nested function. It is defined for backward | 621 trampoline to the actual nested function. It is defined for backward |
636 compatibility, for linking with object code that used the old trampoline | 622 compatibility, for linking with object code that used the old trampoline |
637 definition. | 623 definition. |
662 #define ELIMINABLE_REGS \ | 648 #define ELIMINABLE_REGS \ |
663 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ | 649 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ |
664 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \ | 650 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \ |
665 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }} | 651 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }} |
666 | 652 |
667 #define CAN_ELIMINATE(FROM, TO) \ | |
668 ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1) | |
669 | |
670 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ | 653 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ |
671 (OFFSET) = m68k_initial_elimination_offset(FROM, TO) | 654 (OFFSET) = m68k_initial_elimination_offset(FROM, TO) |
672 | 655 |
673 /* Addressing modes, and classification of registers for them. */ | 656 /* Addressing modes, and classification of registers for them. */ |
674 | 657 |
749 #define REG_STRICT_P 1 | 732 #define REG_STRICT_P 1 |
750 #endif | 733 #endif |
751 | 734 |
752 #define LEGITIMATE_PIC_OPERAND_P(X) \ | 735 #define LEGITIMATE_PIC_OPERAND_P(X) \ |
753 (!symbolic_operand (X, VOIDmode) \ | 736 (!symbolic_operand (X, VOIDmode) \ |
754 || (TARGET_PCREL && REG_STRICT_P)) | 737 || (TARGET_PCREL && REG_STRICT_P) \ |
738 || m68k_tls_reference_p (X, true)) | |
755 | 739 |
756 #define REG_OK_FOR_BASE_P(X) \ | 740 #define REG_OK_FOR_BASE_P(X) \ |
757 m68k_legitimate_base_reg_p (X, REG_STRICT_P) | 741 m68k_legitimate_base_reg_p (X, REG_STRICT_P) |
758 | 742 |
759 #define REG_OK_FOR_INDEX_P(X) \ | 743 #define REG_OK_FOR_INDEX_P(X) \ |
760 m68k_legitimate_index_reg_p (X, REG_STRICT_P) | 744 m68k_legitimate_index_reg_p (X, REG_STRICT_P) |
761 | 745 |
762 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ | 746 |
763 do \ | |
764 { \ | |
765 if (m68k_legitimate_address_p (MODE, X, REG_STRICT_P)) \ | |
766 goto ADDR; \ | |
767 } \ | |
768 while (0) | |
769 | |
770 /* This address is OK as it stands. */ | 747 /* This address is OK as it stands. */ |
771 #define PIC_CASE_VECTOR_ADDRESS(index) index | 748 #define PIC_CASE_VECTOR_ADDRESS(index) index |
772 | |
773 /* For the 68000, we handle X+REG by loading X into a register R and | |
774 using R+REG. R will go in an address reg and indexing will be used. | |
775 However, if REG is a broken-out memory address or multiplication, | |
776 nothing needs to be done because REG can certainly go in an address reg. */ | |
777 #define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = 1; } | |
778 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ | |
779 { register int ch = (X) != (OLDX); \ | |
780 if (GET_CODE (X) == PLUS) \ | |
781 { int copied = 0; \ | |
782 if (GET_CODE (XEXP (X, 0)) == MULT) \ | |
783 { COPY_ONCE (X); XEXP (X, 0) = force_operand (XEXP (X, 0), 0);} \ | |
784 if (GET_CODE (XEXP (X, 1)) == MULT) \ | |
785 { COPY_ONCE (X); XEXP (X, 1) = force_operand (XEXP (X, 1), 0);} \ | |
786 if (ch && GET_CODE (XEXP (X, 1)) == REG \ | |
787 && GET_CODE (XEXP (X, 0)) == REG) \ | |
788 { if (TARGET_COLDFIRE_FPU \ | |
789 && GET_MODE_CLASS (MODE) == MODE_FLOAT) \ | |
790 { COPY_ONCE (X); X = force_operand (X, 0);} \ | |
791 goto WIN; } \ | |
792 if (ch) { GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); } \ | |
793 if (GET_CODE (XEXP (X, 0)) == REG \ | |
794 || (GET_CODE (XEXP (X, 0)) == SIGN_EXTEND \ | |
795 && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG \ | |
796 && GET_MODE (XEXP (XEXP (X, 0), 0)) == HImode)) \ | |
797 { register rtx temp = gen_reg_rtx (Pmode); \ | |
798 register rtx val = force_operand (XEXP (X, 1), 0); \ | |
799 emit_move_insn (temp, val); \ | |
800 COPY_ONCE (X); \ | |
801 XEXP (X, 1) = temp; \ | |
802 if (TARGET_COLDFIRE_FPU && GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
803 && GET_CODE (XEXP (X, 0)) == REG) \ | |
804 X = force_operand (X, 0); \ | |
805 goto WIN; } \ | |
806 else if (GET_CODE (XEXP (X, 1)) == REG \ | |
807 || (GET_CODE (XEXP (X, 1)) == SIGN_EXTEND \ | |
808 && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG \ | |
809 && GET_MODE (XEXP (XEXP (X, 1), 0)) == HImode)) \ | |
810 { register rtx temp = gen_reg_rtx (Pmode); \ | |
811 register rtx val = force_operand (XEXP (X, 0), 0); \ | |
812 emit_move_insn (temp, val); \ | |
813 COPY_ONCE (X); \ | |
814 XEXP (X, 0) = temp; \ | |
815 if (TARGET_COLDFIRE_FPU && GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
816 && GET_CODE (XEXP (X, 1)) == REG) \ | |
817 X = force_operand (X, 0); \ | |
818 goto WIN; }}} | |
819 | |
820 /* On the 68000, only predecrement and postincrement address depend thus | |
821 (the amount of decrement or increment being the length of the operand). | |
822 These are now treated generically in recog.c. */ | |
823 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) | |
824 | |
825 #define CASE_VECTOR_MODE HImode | 749 #define CASE_VECTOR_MODE HImode |
826 #define CASE_VECTOR_PC_RELATIVE 1 | 750 #define CASE_VECTOR_PC_RELATIVE 1 |
827 | 751 |
828 #define DEFAULT_SIGNED_CHAR 1 | 752 #define DEFAULT_SIGNED_CHAR 1 |
829 #define MOVE_MAX 4 | 753 #define MOVE_MAX 4 |
1013 best we can and don't complain. */ | 937 best we can and don't complain. */ |
1014 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | 938 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ |
1015 if ((LOG) >= 1) \ | 939 if ((LOG) >= 1) \ |
1016 fprintf (FILE, "\t.even\n"); | 940 fprintf (FILE, "\t.even\n"); |
1017 | 941 |
942 #ifdef HAVE_GAS_BALIGN_AND_P2ALIGN | |
943 /* Use "move.l %a4,%a4" to advance within code. */ | |
944 #define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG) \ | |
945 if ((LOG) > 0) \ | |
946 fprintf ((FILE), "\t.balignw %u,0x284c\n", 1 << (LOG)); | |
947 #endif | |
948 | |
1018 #define ASM_OUTPUT_SKIP(FILE,SIZE) \ | 949 #define ASM_OUTPUT_SKIP(FILE,SIZE) \ |
1019 fprintf (FILE, "\t.skip %u\n", (int)(SIZE)) | 950 fprintf (FILE, "\t.skip %u\n", (int)(SIZE)) |
1020 | 951 |
1021 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ | 952 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ |
1022 ( fputs (".comm ", (FILE)), \ | 953 ( fputs (".comm ", (FILE)), \ |
1025 | 956 |
1026 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ | 957 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ |
1027 ( fputs (".lcomm ", (FILE)), \ | 958 ( fputs (".lcomm ", (FILE)), \ |
1028 assemble_name ((FILE), (NAME)), \ | 959 assemble_name ((FILE), (NAME)), \ |
1029 fprintf ((FILE), ",%u\n", (int)(ROUNDED))) | 960 fprintf ((FILE), ",%u\n", (int)(ROUNDED))) |
961 | |
962 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \ | |
963 m68k_final_prescan_insn (INSN, OPVEC, NOPERANDS) | |
1030 | 964 |
1031 /* On the 68000, we use several CODE characters: | 965 /* On the 68000, we use several CODE characters: |
1032 '.' for dot needed in Motorola-style opcode names. | 966 '.' for dot needed in Motorola-style opcode names. |
1033 '-' for an operand pushing on the stack: | 967 '-' for an operand pushing on the stack: |
1034 sp@-, -(sp) or -(%sp) depending on the style of syntax. | 968 sp@-, -(sp) or -(%sp) depending on the style of syntax. |
1112 m68k_fk_interrupt_thread | 1046 m68k_fk_interrupt_thread |
1113 }; | 1047 }; |
1114 | 1048 |
1115 /* Variables in m68k.c; see there for details. */ | 1049 /* Variables in m68k.c; see there for details. */ |
1116 extern const char *m68k_library_id_string; | 1050 extern const char *m68k_library_id_string; |
1117 extern int m68k_last_compare_had_fp_operands; | |
1118 extern enum target_device m68k_cpu; | 1051 extern enum target_device m68k_cpu; |
1119 extern enum uarch_type m68k_tune; | 1052 extern enum uarch_type m68k_tune; |
1120 extern enum fpu_type m68k_fpu; | 1053 extern enum fpu_type m68k_fpu; |
1121 extern unsigned int m68k_cpu_flags; | 1054 extern unsigned int m68k_cpu_flags; |
1122 extern unsigned int m68k_tune_flags; | 1055 extern unsigned int m68k_tune_flags; |