Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/pa/pa.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 GNU compiler, for the HP Spectrum. | 1 /* Definitions of target machine for GNU compiler, for the HP Spectrum. |
2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
3 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
4 Free Software Foundation, Inc. | |
4 Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support | 5 Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support |
5 and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for | 6 and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for |
6 Software Science at the University of Utah. | 7 Software Science at the University of Utah. |
7 | 8 |
8 This file is part of GCC. | 9 This file is part of GCC. |
18 GNU General Public License for more details. | 19 GNU General Public License for more details. |
19 | 20 |
20 You should have received a copy of the GNU General Public License | 21 You should have received a copy of the GNU General Public License |
21 along with GCC; see the file COPYING3. If not see | 22 along with GCC; see the file COPYING3. If not see |
22 <http://www.gnu.org/licenses/>. */ | 23 <http://www.gnu.org/licenses/>. */ |
23 | |
24 enum cmp_type /* comparison type */ | |
25 { | |
26 CMP_SI, /* compare integers */ | |
27 CMP_SF, /* compare single precision floats */ | |
28 CMP_DF, /* compare double precision floats */ | |
29 CMP_MAX /* max comparison type */ | |
30 }; | |
31 | 24 |
32 /* For long call handling. */ | 25 /* For long call handling. */ |
33 extern unsigned long total_code_bytes; | 26 extern unsigned long total_code_bytes; |
34 | 27 |
35 /* Which processor to schedule for. */ | 28 /* Which processor to schedule for. */ |
247 | 240 |
248 /* Show we can debug even without a frame pointer. */ | 241 /* Show we can debug even without a frame pointer. */ |
249 #define CAN_DEBUG_WITHOUT_FP | 242 #define CAN_DEBUG_WITHOUT_FP |
250 | 243 |
251 /* target machine storage layout */ | 244 /* target machine storage layout */ |
252 typedef struct machine_function GTY(()) | 245 typedef struct GTY(()) machine_function |
253 { | 246 { |
254 /* Flag indicating that a .NSUBSPA directive has been output for | 247 /* Flag indicating that a .NSUBSPA directive has been output for |
255 this function. */ | 248 this function. */ |
256 int in_nsubspa; | 249 int in_nsubspa; |
257 } machine_function; | 250 } machine_function; |
361 /* Register to use for pushing function arguments. */ | 354 /* Register to use for pushing function arguments. */ |
362 #define STACK_POINTER_REGNUM 30 | 355 #define STACK_POINTER_REGNUM 30 |
363 | 356 |
364 /* Base register for access to local variables of the function. */ | 357 /* Base register for access to local variables of the function. */ |
365 #define FRAME_POINTER_REGNUM 3 | 358 #define FRAME_POINTER_REGNUM 3 |
366 | |
367 /* Value should be nonzero if functions must have frame pointers. */ | |
368 #define FRAME_POINTER_REQUIRED \ | |
369 (cfun->calls_alloca) | |
370 | 359 |
371 /* Don't allow hard registers to be renamed into r2 unless r2 | 360 /* Don't allow hard registers to be renamed into r2 unless r2 |
372 is already live or already being saved (due to eh). */ | 361 is already live or already being saved (due to eh). */ |
373 | 362 |
374 #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \ | 363 #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \ |
579 FUNTYPE is the data type of the function (as a tree), | 568 FUNTYPE is the data type of the function (as a tree), |
580 or for a library call it is an identifier node for the subroutine name. */ | 569 or for a library call it is an identifier node for the subroutine name. */ |
581 | 570 |
582 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 | 571 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 |
583 | 572 |
584 /* Define how to find the value returned by a function. | |
585 VALTYPE is the data type of the value (as a tree). | |
586 If the precise function being called is known, FUNC is its FUNCTION_DECL; | |
587 otherwise, FUNC is 0. */ | |
588 | |
589 #define FUNCTION_VALUE(VALTYPE, FUNC) function_value (VALTYPE, FUNC) | |
590 | |
591 /* Define how to find the value returned by a library function | 573 /* Define how to find the value returned by a library function |
592 assuming the value has mode MODE. */ | 574 assuming the value has mode MODE. */ |
593 | 575 |
594 #define LIBCALL_VALUE(MODE) \ | 576 #define LIBCALL_VALUE(MODE) \ |
595 gen_rtx_REG (MODE, \ | 577 gen_rtx_REG (MODE, \ |
753 || int_size_in_bytes (TYPE) <= UNITS_PER_WORD) \ | 735 || int_size_in_bytes (TYPE) <= UNITS_PER_WORD) \ |
754 : GET_MODE_SIZE(MODE) <= UNITS_PER_WORD) \ | 736 : GET_MODE_SIZE(MODE) <= UNITS_PER_WORD) \ |
755 ? PARM_BOUNDARY : MAX_PARM_BOUNDARY) | 737 ? PARM_BOUNDARY : MAX_PARM_BOUNDARY) |
756 | 738 |
757 | 739 |
758 extern GTY(()) rtx hppa_compare_op0; | |
759 extern GTY(()) rtx hppa_compare_op1; | |
760 extern enum cmp_type hppa_branch_type; | |
761 | |
762 /* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than | 740 /* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than |
763 as assembly via FUNCTION_PROFILER. Just output a local label. | 741 as assembly via FUNCTION_PROFILER. Just output a local label. |
764 We can't use the function label because the GAS SOM target can't | 742 We can't use the function label because the GAS SOM target can't |
765 handle the difference of a global symbol and a local symbol. */ | 743 handle the difference of a global symbol and a local symbol. */ |
766 | 744 |
791 | 769 |
792 #define EXIT_IGNORE_STACK \ | 770 #define EXIT_IGNORE_STACK \ |
793 (get_frame_size () != 0 \ | 771 (get_frame_size () != 0 \ |
794 || cfun->calls_alloca || crtl->outgoing_args_size) | 772 || cfun->calls_alloca || crtl->outgoing_args_size) |
795 | 773 |
796 /* Output assembler code for a block containing the constant parts | |
797 of a trampoline, leaving space for the variable parts.\ | |
798 | |
799 The trampoline sets the static chain pointer to STATIC_CHAIN_REGNUM | |
800 and then branches to the specified routine. | |
801 | |
802 This code template is copied from text segment to stack location | |
803 and then patched with INITIALIZE_TRAMPOLINE to contain | |
804 valid values, and then entered as a subroutine. | |
805 | |
806 It is best to keep this as small as possible to avoid having to | |
807 flush multiple lines in the cache. */ | |
808 | |
809 #define TRAMPOLINE_TEMPLATE(FILE) \ | |
810 { \ | |
811 if (!TARGET_64BIT) \ | |
812 { \ | |
813 fputs ("\tldw 36(%r22),%r21\n", FILE); \ | |
814 fputs ("\tbb,>=,n %r21,30,.+16\n", FILE); \ | |
815 if (ASSEMBLER_DIALECT == 0) \ | |
816 fputs ("\tdepi 0,31,2,%r21\n", FILE); \ | |
817 else \ | |
818 fputs ("\tdepwi 0,31,2,%r21\n", FILE); \ | |
819 fputs ("\tldw 4(%r21),%r19\n", FILE); \ | |
820 fputs ("\tldw 0(%r21),%r21\n", FILE); \ | |
821 if (TARGET_PA_20) \ | |
822 { \ | |
823 fputs ("\tbve (%r21)\n", FILE); \ | |
824 fputs ("\tldw 40(%r22),%r29\n", FILE); \ | |
825 fputs ("\t.word 0\n", FILE); \ | |
826 fputs ("\t.word 0\n", FILE); \ | |
827 } \ | |
828 else \ | |
829 { \ | |
830 fputs ("\tldsid (%r21),%r1\n", FILE); \ | |
831 fputs ("\tmtsp %r1,%sr0\n", FILE); \ | |
832 fputs ("\tbe 0(%sr0,%r21)\n", FILE); \ | |
833 fputs ("\tldw 40(%r22),%r29\n", FILE); \ | |
834 } \ | |
835 fputs ("\t.word 0\n", FILE); \ | |
836 fputs ("\t.word 0\n", FILE); \ | |
837 fputs ("\t.word 0\n", FILE); \ | |
838 fputs ("\t.word 0\n", FILE); \ | |
839 } \ | |
840 else \ | |
841 { \ | |
842 fputs ("\t.dword 0\n", FILE); \ | |
843 fputs ("\t.dword 0\n", FILE); \ | |
844 fputs ("\t.dword 0\n", FILE); \ | |
845 fputs ("\t.dword 0\n", FILE); \ | |
846 fputs ("\tmfia %r31\n", FILE); \ | |
847 fputs ("\tldd 24(%r31),%r1\n", FILE); \ | |
848 fputs ("\tldd 24(%r1),%r27\n", FILE); \ | |
849 fputs ("\tldd 16(%r1),%r1\n", FILE); \ | |
850 fputs ("\tbve (%r1)\n", FILE); \ | |
851 fputs ("\tldd 32(%r31),%r31\n", FILE); \ | |
852 fputs ("\t.dword 0 ; fptr\n", FILE); \ | |
853 fputs ("\t.dword 0 ; static link\n", FILE); \ | |
854 } \ | |
855 } | |
856 | |
857 /* Length in units of the trampoline for entering a nested function. */ | 774 /* Length in units of the trampoline for entering a nested function. */ |
858 | 775 |
859 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52) | 776 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52) |
860 | 777 |
861 /* Length in units of the trampoline instruction code. */ | 778 /* Alignment required by the trampoline. */ |
862 | 779 |
863 #define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 32 : 40)) | 780 #define TRAMPOLINE_ALIGNMENT BITS_PER_WORD |
864 | 781 |
865 /* Minimum length of a cache line. A length of 16 will work on all | 782 /* Minimum length of a cache line. A length of 16 will work on all |
866 PA-RISC processors. All PA 1.1 processors have a cache line of | 783 PA-RISC processors. All PA 1.1 processors have a cache line of |
867 32 bytes. Most but not all PA 2.0 processors have a cache line | 784 32 bytes. Most but not all PA 2.0 processors have a cache line |
868 of 64 bytes. As cache flushes are expensive and we don't support | 785 of 64 bytes. As cache flushes are expensive and we don't support |
869 PA 1.0, we use a minimum length of 32. */ | 786 PA 1.0, we use a minimum length of 32. */ |
870 | 787 |
871 #define MIN_CACHELINE_SIZE 32 | 788 #define MIN_CACHELINE_SIZE 32 |
872 | 789 |
873 /* Emit RTL insns to initialize the variable parts of a trampoline. | |
874 FNADDR is an RTX for the address of the function's pure code. | |
875 CXT is an RTX for the static chain value for the function. | |
876 | |
877 Move the function address to the trampoline template at offset 36. | |
878 Move the static chain value to trampoline template at offset 40. | |
879 Move the trampoline address to trampoline template at offset 44. | |
880 Move r19 to trampoline template at offset 48. The latter two | |
881 words create a plabel for the indirect call to the trampoline. | |
882 | |
883 A similar sequence is used for the 64-bit port but the plabel is | |
884 at the beginning of the trampoline. | |
885 | |
886 Finally, the cache entries for the trampoline code are flushed. | |
887 This is necessary to ensure that the trampoline instruction sequence | |
888 is written to memory prior to any attempts at prefetching the code | |
889 sequence. */ | |
890 | |
891 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ | |
892 { \ | |
893 rtx start_addr = gen_reg_rtx (Pmode); \ | |
894 rtx end_addr = gen_reg_rtx (Pmode); \ | |
895 rtx line_length = gen_reg_rtx (Pmode); \ | |
896 rtx tmp; \ | |
897 \ | |
898 if (!TARGET_64BIT) \ | |
899 { \ | |
900 tmp = memory_address (Pmode, plus_constant ((TRAMP), 36)); \ | |
901 emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \ | |
902 tmp = memory_address (Pmode, plus_constant ((TRAMP), 40)); \ | |
903 emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \ | |
904 \ | |
905 /* Create a fat pointer for the trampoline. */ \ | |
906 tmp = memory_address (Pmode, plus_constant ((TRAMP), 44)); \ | |
907 emit_move_insn (gen_rtx_MEM (Pmode, tmp), (TRAMP)); \ | |
908 tmp = memory_address (Pmode, plus_constant ((TRAMP), 48)); \ | |
909 emit_move_insn (gen_rtx_MEM (Pmode, tmp), \ | |
910 gen_rtx_REG (Pmode, 19)); \ | |
911 \ | |
912 /* fdc and fic only use registers for the address to flush, \ | |
913 they do not accept integer displacements. We align the \ | |
914 start and end addresses to the beginning of their respective \ | |
915 cache lines to minimize the number of lines flushed. */ \ | |
916 tmp = force_reg (Pmode, (TRAMP)); \ | |
917 emit_insn (gen_andsi3 (start_addr, tmp, \ | |
918 GEN_INT (-MIN_CACHELINE_SIZE))); \ | |
919 tmp = force_reg (Pmode, \ | |
920 plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \ | |
921 emit_insn (gen_andsi3 (end_addr, tmp, \ | |
922 GEN_INT (-MIN_CACHELINE_SIZE))); \ | |
923 emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \ | |
924 emit_insn (gen_dcacheflushsi (start_addr, end_addr, line_length));\ | |
925 emit_insn (gen_icacheflushsi (start_addr, end_addr, line_length, \ | |
926 gen_reg_rtx (Pmode), \ | |
927 gen_reg_rtx (Pmode))); \ | |
928 } \ | |
929 else \ | |
930 { \ | |
931 tmp = memory_address (Pmode, plus_constant ((TRAMP), 56)); \ | |
932 emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \ | |
933 tmp = memory_address (Pmode, plus_constant ((TRAMP), 64)); \ | |
934 emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \ | |
935 \ | |
936 /* Create a fat pointer for the trampoline. */ \ | |
937 tmp = memory_address (Pmode, plus_constant ((TRAMP), 16)); \ | |
938 emit_move_insn (gen_rtx_MEM (Pmode, tmp), \ | |
939 force_reg (Pmode, plus_constant ((TRAMP), 32))); \ | |
940 tmp = memory_address (Pmode, plus_constant ((TRAMP), 24)); \ | |
941 emit_move_insn (gen_rtx_MEM (Pmode, tmp), \ | |
942 gen_rtx_REG (Pmode, 27)); \ | |
943 \ | |
944 /* fdc and fic only use registers for the address to flush, \ | |
945 they do not accept integer displacements. We align the \ | |
946 start and end addresses to the beginning of their respective \ | |
947 cache lines to minimize the number of lines flushed. */ \ | |
948 tmp = force_reg (Pmode, plus_constant ((TRAMP), 32)); \ | |
949 emit_insn (gen_anddi3 (start_addr, tmp, \ | |
950 GEN_INT (-MIN_CACHELINE_SIZE))); \ | |
951 tmp = force_reg (Pmode, \ | |
952 plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \ | |
953 emit_insn (gen_anddi3 (end_addr, tmp, \ | |
954 GEN_INT (-MIN_CACHELINE_SIZE))); \ | |
955 emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \ | |
956 emit_insn (gen_dcacheflushdi (start_addr, end_addr, line_length));\ | |
957 emit_insn (gen_icacheflushdi (start_addr, end_addr, line_length, \ | |
958 gen_reg_rtx (Pmode), \ | |
959 gen_reg_rtx (Pmode))); \ | |
960 } \ | |
961 } | |
962 | |
963 /* Perform any machine-specific adjustment in the address of the trampoline. | |
964 ADDR contains the address that was passed to INITIALIZE_TRAMPOLINE. | |
965 Adjust the trampoline address to point to the plabel at offset 44. */ | |
966 | |
967 #define TRAMPOLINE_ADJUST_ADDRESS(ADDR) \ | |
968 if (!TARGET_64BIT) (ADDR) = memory_address (Pmode, plus_constant ((ADDR), 46)) | |
969 | 790 |
970 /* Addressing modes, and classification of registers for them. | 791 /* Addressing modes, and classification of registers for them. |
971 | 792 |
972 Using autoincrement addressing modes on PA8000 class machines is | 793 Using autoincrement addressing modes on PA8000 class machines is |
973 not profitable. */ | 794 not profitable. */ |
1419 } \ | 1240 } \ |
1420 } \ | 1241 } \ |
1421 } while (0) | 1242 } while (0) |
1422 | 1243 |
1423 | 1244 |
1424 | |
1425 | |
1426 /* Try machine-dependent ways of modifying an illegitimate address | |
1427 to be legitimate. If we find one, return the new, valid address. | |
1428 This macro is used in only one place: `memory_address' in explow.c. | |
1429 | |
1430 OLDX is the address as it was before break_out_memory_refs was called. | |
1431 In some cases it is useful to look at this to decide what needs to be done. | |
1432 | |
1433 MODE and WIN are passed so that this macro can use | |
1434 GO_IF_LEGITIMATE_ADDRESS. | |
1435 | |
1436 It is always safe for this macro to do nothing. It exists to recognize | |
1437 opportunities to optimize the output. */ | |
1438 | |
1439 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ | |
1440 { rtx orig_x = (X); \ | |
1441 (X) = hppa_legitimize_address (X, OLDX, MODE); \ | |
1442 if ((X) != orig_x && memory_address_p (MODE, X)) \ | |
1443 goto WIN; } | |
1444 | |
1445 /* Go to LABEL if ADDR (a legitimate address expression) | |
1446 has an effect that depends on the machine mode it is used for. */ | |
1447 | |
1448 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) | |
1449 | 1245 |
1450 #define TARGET_ASM_SELECT_SECTION pa_select_section | 1246 #define TARGET_ASM_SELECT_SECTION pa_select_section |
1451 | 1247 |
1452 /* Return a nonzero value if DECL has a section attribute. */ | 1248 /* Return a nonzero value if DECL has a section attribute. */ |
1453 #define IN_NAMED_SECTION_P(DECL) \ | 1249 #define IN_NAMED_SECTION_P(DECL) \ |