Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/alpha/alpha.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 DEC Alpha. | 1 /* Definitions of target machine for GNU compiler, for DEC Alpha. |
2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 2000, 2001, 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. | 3 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009 |
4 Free Software Foundation, Inc. | |
4 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) | 5 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) |
5 | 6 |
6 This file is part of GCC. | 7 This file is part of GCC. |
7 | 8 |
8 GCC is free software; you can redistribute it and/or modify | 9 GCC is free software; you can redistribute it and/or modify |
445 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. | 446 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. |
446 On Alpha, the integer registers can hold any mode. The floating-point | 447 On Alpha, the integer registers can hold any mode. The floating-point |
447 registers can hold 64-bit integers as well, but not smaller values. */ | 448 registers can hold 64-bit integers as well, but not smaller values. */ |
448 | 449 |
449 #define HARD_REGNO_MODE_OK(REGNO, MODE) \ | 450 #define HARD_REGNO_MODE_OK(REGNO, MODE) \ |
450 ((REGNO) >= 32 && (REGNO) <= 62 \ | 451 (IN_RANGE ((REGNO), 32, 62) \ |
451 ? (MODE) == SFmode || (MODE) == DFmode || (MODE) == DImode \ | 452 ? (MODE) == SFmode || (MODE) == DFmode || (MODE) == DImode \ |
452 || (MODE) == SCmode || (MODE) == DCmode \ | 453 || (MODE) == SCmode || (MODE) == DCmode \ |
453 : 1) | 454 : 1) |
454 | 455 |
455 /* A C expression that is nonzero if a value of mode | 456 /* A C expression that is nonzero if a value of mode |
472 /* Register to use for pushing function arguments. */ | 473 /* Register to use for pushing function arguments. */ |
473 #define STACK_POINTER_REGNUM 30 | 474 #define STACK_POINTER_REGNUM 30 |
474 | 475 |
475 /* Base register for access to local variables of the function. */ | 476 /* Base register for access to local variables of the function. */ |
476 #define HARD_FRAME_POINTER_REGNUM 15 | 477 #define HARD_FRAME_POINTER_REGNUM 15 |
477 | |
478 /* Value should be nonzero if functions must have frame pointers. | |
479 Zero means the frame pointer need not be set up (and parms | |
480 may be accessed via the stack pointer) in functions that seem suitable. | |
481 This is computed in `reload', in reload1.c. */ | |
482 #define FRAME_POINTER_REQUIRED 0 | |
483 | 478 |
484 /* Base register for access to arguments of the function. */ | 479 /* Base register for access to arguments of the function. */ |
485 #define ARG_POINTER_REGNUM 31 | 480 #define ARG_POINTER_REGNUM 31 |
486 | 481 |
487 /* Base register for access to local variables of function. */ | 482 /* Base register for access to local variables of function. */ |
574 #define REGNO_REG_CLASS(REGNO) \ | 569 #define REGNO_REG_CLASS(REGNO) \ |
575 ((REGNO) == 0 ? R0_REG \ | 570 ((REGNO) == 0 ? R0_REG \ |
576 : (REGNO) == 24 ? R24_REG \ | 571 : (REGNO) == 24 ? R24_REG \ |
577 : (REGNO) == 25 ? R25_REG \ | 572 : (REGNO) == 25 ? R25_REG \ |
578 : (REGNO) == 27 ? R27_REG \ | 573 : (REGNO) == 27 ? R27_REG \ |
579 : (REGNO) >= 32 && (REGNO) <= 62 ? FLOAT_REGS \ | 574 : IN_RANGE ((REGNO), 32, 62) ? FLOAT_REGS \ |
580 : GENERAL_REGS) | 575 : GENERAL_REGS) |
581 | 576 |
582 /* The class value for index registers, and the one for base regs. */ | 577 /* The class value for index registers, and the one for base regs. */ |
583 #define INDEX_REG_CLASS NO_REGS | 578 #define INDEX_REG_CLASS NO_REGS |
584 #define BASE_REG_CLASS GENERAL_REGS | 579 #define BASE_REG_CLASS GENERAL_REGS |
694 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | 689 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ |
695 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ | 690 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ |
696 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | 691 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ |
697 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} | 692 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} |
698 | 693 |
699 /* Given FROM and TO register numbers, say whether this elimination is allowed. | |
700 Frame pointer elimination is automatically handled. | |
701 | |
702 All eliminations are valid since the cases where FP can't be | |
703 eliminated are already handled. */ | |
704 | |
705 #define CAN_ELIMINATE(FROM, TO) 1 | |
706 | |
707 /* Round up to a multiple of 16 bytes. */ | 694 /* Round up to a multiple of 16 bytes. */ |
708 #define ALPHA_ROUND(X) (((X) + 15) & ~ 15) | 695 #define ALPHA_ROUND(X) (((X) + 15) & ~ 15) |
709 | 696 |
710 /* Define the offset between two registers, one to be eliminated, and the other | 697 /* Define the offset between two registers, one to be eliminated, and the other |
711 its replacement, at the start of a routine. */ | 698 its replacement, at the start of a routine. */ |
750 | 737 |
751 /* 1 if N is a possible register number for function argument passing. | 738 /* 1 if N is a possible register number for function argument passing. |
752 On Alpha, these are $16-$21 and $f16-$f21. */ | 739 On Alpha, these are $16-$21 and $f16-$f21. */ |
753 | 740 |
754 #define FUNCTION_ARG_REGNO_P(N) \ | 741 #define FUNCTION_ARG_REGNO_P(N) \ |
755 (((N) >= 16 && (N) <= 21) || ((N) >= 16 + 32 && (N) <= 21 + 32)) | 742 (IN_RANGE ((N), 16, 21) || ((N) >= 16 + 32 && (N) <= 21 + 32)) |
756 | 743 |
757 /* Define a data type for recording info about an argument list | 744 /* Define a data type for recording info about an argument list |
758 during the scan of that argument list. This data type should | 745 during the scan of that argument list. This data type should |
759 hold all necessary information about the function itself | 746 hold all necessary information about the function itself |
760 and about the args processed so far, enough to enable macros | 747 and about the args processed so far, enough to enable macros |
807 and the rest are pushed. */ | 794 and the rest are pushed. */ |
808 | 795 |
809 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ | 796 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ |
810 function_arg((CUM), (MODE), (TYPE), (NAMED)) | 797 function_arg((CUM), (MODE), (TYPE), (NAMED)) |
811 | 798 |
812 /* Try to output insns to set TARGET equal to the constant C if it can be | |
813 done in less than N insns. Do all computations in MODE. Returns the place | |
814 where the output has been placed if it can be done and the insns have been | |
815 emitted. If it would take more than N insns, zero is returned and no | |
816 insns and emitted. */ | |
817 | |
818 /* Define the information needed to generate branch and scc insns. This is | |
819 stored from the compare operation. Note that we can't use "rtx" here | |
820 since it hasn't been defined! */ | |
821 | |
822 struct alpha_compare | |
823 { | |
824 struct rtx_def *op0, *op1; | |
825 int fp_p; | |
826 }; | |
827 | |
828 extern struct alpha_compare alpha_compare; | |
829 | |
830 /* Make (or fake) .linkage entry for function call. | 799 /* Make (or fake) .linkage entry for function call. |
831 IS_LOCAL is 0 if name is used in call, 1 if name is used in definition. */ | 800 IS_LOCAL is 0 if name is used in call, 1 if name is used in definition. */ |
832 | 801 |
833 /* This macro defines the start of an assembly comment. */ | 802 /* This macro defines the start of an assembly comment. */ |
834 | 803 |
867 | 836 |
868 /* Define registers used by the epilogue and return instruction. */ | 837 /* Define registers used by the epilogue and return instruction. */ |
869 | 838 |
870 #define EPILOGUE_USES(REGNO) ((REGNO) == 26) | 839 #define EPILOGUE_USES(REGNO) ((REGNO) == 26) |
871 | 840 |
872 /* Output assembler code for a block containing the constant parts | |
873 of a trampoline, leaving space for the variable parts. | |
874 | |
875 The trampoline should set the static chain pointer to value placed | |
876 into the trampoline and should branch to the specified routine. | |
877 Note that $27 has been set to the address of the trampoline, so we can | |
878 use it for addressability of the two data items. */ | |
879 | |
880 #define TRAMPOLINE_TEMPLATE(FILE) \ | |
881 do { \ | |
882 fprintf (FILE, "\tldq $1,24($27)\n"); \ | |
883 fprintf (FILE, "\tldq $27,16($27)\n"); \ | |
884 fprintf (FILE, "\tjmp $31,($27),0\n"); \ | |
885 fprintf (FILE, "\tnop\n"); \ | |
886 fprintf (FILE, "\t.quad 0,0\n"); \ | |
887 } while (0) | |
888 | |
889 /* Section in which to place the trampoline. On Alpha, instructions | |
890 may only be placed in a text segment. */ | |
891 | |
892 #define TRAMPOLINE_SECTION text_section | |
893 | |
894 /* Length in units of the trampoline for entering a nested function. */ | 841 /* Length in units of the trampoline for entering a nested function. */ |
895 | 842 |
896 #define TRAMPOLINE_SIZE 32 | 843 #define TRAMPOLINE_SIZE 32 |
897 | 844 |
898 /* The alignment of a trampoline, in bits. */ | 845 /* The alignment of a trampoline, in bits. */ |
899 | 846 |
900 #define TRAMPOLINE_ALIGNMENT 64 | 847 #define TRAMPOLINE_ALIGNMENT 64 |
901 | |
902 /* Emit RTL insns to initialize the variable parts of a trampoline. | |
903 FNADDR is an RTX for the address of the function's pure code. | |
904 CXT is an RTX for the static chain value for the function. */ | |
905 | |
906 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ | |
907 alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, 8) | |
908 | 848 |
909 /* A C expression whose value is RTL representing the value of the return | 849 /* A C expression whose value is RTL representing the value of the return |
910 address for the frame COUNT steps up from the current frame. | 850 address for the frame COUNT steps up from the current frame. |
911 FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of | 851 FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of |
912 the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined. */ | 852 the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined. */ |
913 | 853 |
914 #define RETURN_ADDR_RTX alpha_return_addr | 854 #define RETURN_ADDR_RTX alpha_return_addr |
855 | |
856 /* Provide a definition of DWARF_FRAME_REGNUM here so that fallback unwinders | |
857 can use DWARF_ALT_FRAME_RETURN_COLUMN defined below. This is just the same | |
858 as the default definition in dwarf2out.c. */ | |
859 #undef DWARF_FRAME_REGNUM | |
860 #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG) | |
915 | 861 |
916 /* Before the prologue, RA lives in $26. */ | 862 /* Before the prologue, RA lives in $26. */ |
917 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26) | 863 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26) |
918 #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26) | 864 #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26) |
919 #define DWARF_ALT_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (64) | 865 #define DWARF_ALT_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (64) |
947 /* Recognize any constant value that is a valid address. For the Alpha, | 893 /* Recognize any constant value that is a valid address. For the Alpha, |
948 there are only constants none since we want to use LDA to load any | 894 there are only constants none since we want to use LDA to load any |
949 symbolic addresses into registers. */ | 895 symbolic addresses into registers. */ |
950 | 896 |
951 #define CONSTANT_ADDRESS_P(X) \ | 897 #define CONSTANT_ADDRESS_P(X) \ |
952 (GET_CODE (X) == CONST_INT \ | 898 (CONST_INT_P (X) \ |
953 && (unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000) | 899 && (unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000) |
954 | 900 |
955 /* Include all constant integers and constant doubles, but not | 901 /* Include all constant integers and constant doubles, but not |
956 floating-point, except for floating-point zero. */ | 902 floating-point, except for floating-point zero. */ |
957 | 903 |
996 #define REG_OK_FOR_BASE_P(X) STRICT_REG_OK_FOR_BASE_P (X) | 942 #define REG_OK_FOR_BASE_P(X) STRICT_REG_OK_FOR_BASE_P (X) |
997 #else | 943 #else |
998 #define REG_OK_FOR_BASE_P(X) NONSTRICT_REG_OK_FOR_BASE_P (X) | 944 #define REG_OK_FOR_BASE_P(X) NONSTRICT_REG_OK_FOR_BASE_P (X) |
999 #endif | 945 #endif |
1000 | 946 |
1001 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a | |
1002 valid memory address for an instruction. */ | |
1003 | |
1004 #ifdef REG_OK_STRICT | |
1005 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \ | |
1006 do { \ | |
1007 if (alpha_legitimate_address_p (MODE, X, 1)) \ | |
1008 goto WIN; \ | |
1009 } while (0) | |
1010 #else | |
1011 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \ | |
1012 do { \ | |
1013 if (alpha_legitimate_address_p (MODE, X, 0)) \ | |
1014 goto WIN; \ | |
1015 } while (0) | |
1016 #endif | |
1017 | |
1018 /* Try machine-dependent ways of modifying an illegitimate address | |
1019 to be legitimate. If we find one, return the new, valid address. | |
1020 This macro is used in only one place: `memory_address' in explow.c. */ | |
1021 | |
1022 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ | |
1023 do { \ | |
1024 rtx new_x = alpha_legitimize_address (X, NULL_RTX, MODE); \ | |
1025 if (new_x) \ | |
1026 { \ | |
1027 X = new_x; \ | |
1028 goto WIN; \ | |
1029 } \ | |
1030 } while (0) | |
1031 | |
1032 /* Try a machine-dependent way of reloading an illegitimate address | 947 /* Try a machine-dependent way of reloading an illegitimate address |
1033 operand. If we find one, push the reload and jump to WIN. This | 948 operand. If we find one, push the reload and jump to WIN. This |
1034 macro is used in only one place: `find_reloads_address' in reload.c. */ | 949 macro is used in only one place: `find_reloads_address' in reload.c. */ |
1035 | 950 |
1036 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_L,WIN) \ | 951 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_L,WIN) \ |
1123 /* Canonicalize a comparison from one we don't have to one we do have. */ | 1038 /* Canonicalize a comparison from one we don't have to one we do have. */ |
1124 | 1039 |
1125 #define CANONICALIZE_COMPARISON(CODE,OP0,OP1) \ | 1040 #define CANONICALIZE_COMPARISON(CODE,OP0,OP1) \ |
1126 do { \ | 1041 do { \ |
1127 if (((CODE) == GE || (CODE) == GT || (CODE) == GEU || (CODE) == GTU) \ | 1042 if (((CODE) == GE || (CODE) == GT || (CODE) == GEU || (CODE) == GTU) \ |
1128 && (GET_CODE (OP1) == REG || (OP1) == const0_rtx)) \ | 1043 && (REG_P (OP1) || (OP1) == const0_rtx)) \ |
1129 { \ | 1044 { \ |
1130 rtx tem = (OP0); \ | 1045 rtx tem = (OP0); \ |
1131 (OP0) = (OP1); \ | 1046 (OP0) = (OP1); \ |
1132 (OP1) = tem; \ | 1047 (OP1) = tem; \ |
1133 (CODE) = swap_condition (CODE); \ | 1048 (CODE) = swap_condition (CODE); \ |
1134 } \ | 1049 } \ |
1135 if (((CODE) == LT || (CODE) == LTU) \ | 1050 if (((CODE) == LT || (CODE) == LTU) \ |
1136 && GET_CODE (OP1) == CONST_INT && INTVAL (OP1) == 256) \ | 1051 && CONST_INT_P (OP1) && INTVAL (OP1) == 256) \ |
1137 { \ | 1052 { \ |
1138 (CODE) = (CODE) == LT ? LE : LEU; \ | 1053 (CODE) = (CODE) == LT ? LE : LEU; \ |
1139 (OP1) = GEN_INT (255); \ | 1054 (OP1) = GEN_INT (255); \ |
1140 } \ | 1055 } \ |
1141 } while (0) | 1056 } while (0) |