comparison gcc/config/s390/s390.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, for IBM S/390 1 /* Definitions of target machine for GNU compiler, for IBM S/390
2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
3 2007, 2008 Free Software Foundation, Inc. 3 2007, 2008, 2009 Free Software Foundation, Inc.
4 Contributed by Hartmut Penner (hpenner@de.ibm.com) and 4 Contributed by Hartmut Penner (hpenner@de.ibm.com) and
5 Ulrich Weigand (uweigand@de.ibm.com). 5 Ulrich Weigand (uweigand@de.ibm.com).
6 Andreas Krebbel (Andreas.Krebbel@de.ibm.com) 6 Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
7 7
8 This file is part of GCC. 8 This file is part of GCC.
21 along with GCC; see the file COPYING3. If not see 21 along with GCC; see the file COPYING3. If not see
22 <http://www.gnu.org/licenses/>. */ 22 <http://www.gnu.org/licenses/>. */
23 23
24 #ifndef _S390_H 24 #ifndef _S390_H
25 #define _S390_H 25 #define _S390_H
26
27 /* Override the __fixdfdi etc. routines when building libgcc2.
28 ??? This should be done in a cleaner way ... */
29 #if defined (IN_LIBGCC2) && !defined (__s390x__)
30 #include <config/s390/fixdfdi.h>
31 #endif
32 26
33 /* Which processor to generate code or schedule for. The cpu attribute 27 /* Which processor to generate code or schedule for. The cpu attribute
34 defines a list that mirrors this list, so changes to s390.md must be 28 defines a list that mirrors this list, so changes to s390.md must be
35 made at the same time. */ 29 made at the same time. */
36 30
56 PF_DFP = 16, 50 PF_DFP = 16,
57 PF_Z10 = 32 51 PF_Z10 = 32
58 }; 52 };
59 53
60 extern enum processor_type s390_tune; 54 extern enum processor_type s390_tune;
61 extern enum processor_flags s390_tune_flags; 55 extern int s390_tune_flags;
56
57 /* This is necessary to avoid a warning about comparing different enum
58 types. */
59 #define s390_tune_attr ((enum attr_cpu)s390_tune)
62 60
63 extern enum processor_type s390_arch; 61 extern enum processor_type s390_arch;
64 extern enum processor_flags s390_arch_flags; 62 extern int s390_arch_flags;
65 63
66 /* These flags indicate that the generated code should run on a cpu 64 /* These flags indicate that the generated code should run on a cpu
67 providing the respective hardware facility regardless of the 65 providing the respective hardware facility regardless of the
68 current cpu mode (ESA or z/Architecture). */ 66 current cpu mode (ESA or z/Architecture). */
69 67
174 #define S390_TDC_POSITIVE_DENORMALIZED_DFP_NUMBER (1 << 9) 172 #define S390_TDC_POSITIVE_DENORMALIZED_DFP_NUMBER (1 << 9)
175 #define S390_TDC_NEGATIVE_DENORMALIZED_DFP_NUMBER (1 << 8) 173 #define S390_TDC_NEGATIVE_DENORMALIZED_DFP_NUMBER (1 << 8)
176 #define S390_TDC_POSITIVE_NORMALIZED_DFP_NUMBER (1 << 7) 174 #define S390_TDC_POSITIVE_NORMALIZED_DFP_NUMBER (1 << 7)
177 #define S390_TDC_NEGATIVE_NORMALIZED_DFP_NUMBER (1 << 6) 175 #define S390_TDC_NEGATIVE_NORMALIZED_DFP_NUMBER (1 << 6)
178 176
179 /* For signbit, the BFP-DFP-difference makes no difference. */ 177 /* For signbit, the BFP-DFP-difference makes no difference. */
180 #define S390_TDC_SIGNBIT_SET (S390_TDC_NEGATIVE_ZERO \ 178 #define S390_TDC_SIGNBIT_SET (S390_TDC_NEGATIVE_ZERO \
181 | S390_TDC_NEGATIVE_NORMALIZED_BFP_NUMBER \ 179 | S390_TDC_NEGATIVE_NORMALIZED_BFP_NUMBER \
182 | S390_TDC_NEGATIVE_DENORMALIZED_BFP_NUMBER\ 180 | S390_TDC_NEGATIVE_DENORMALIZED_BFP_NUMBER\
183 | S390_TDC_NEGATIVE_INFINITY \ 181 | S390_TDC_NEGATIVE_INFINITY \
184 | S390_TDC_NEGATIVE_QUIET_NAN \ 182 | S390_TDC_NEGATIVE_QUIET_NAN \
210 #ifndef IN_LIBGCC2 208 #ifndef IN_LIBGCC2
211 #define MIN_UNITS_PER_WORD 4 209 #define MIN_UNITS_PER_WORD 4
212 #endif 210 #endif
213 #define MAX_BITS_PER_WORD 64 211 #define MAX_BITS_PER_WORD 64
214 212
215 /* Function arguments and return values are promoted to word size. */
216 #define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE) \
217 if (INTEGRAL_MODE_P (MODE) && \
218 GET_MODE_SIZE (MODE) < UNITS_PER_WORD) { \
219 (MODE) = Pmode; \
220 }
221
222 /* Allocation boundary (in *bits*) for storing arguments in argument list. */ 213 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
223 #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32) 214 #define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)
224 215
225 /* Boundary (in *bits*) on which stack pointer should be aligned. */ 216 /* Boundary (in *bits*) on which stack pointer should be aligned. */
226 #define STACK_BOUNDARY 64 217 #define STACK_BOUNDARY 64
292 283
293 Registers 32-35 are 'fake' hard registers that do not 284 Registers 32-35 are 'fake' hard registers that do not
294 correspond to actual hardware: 285 correspond to actual hardware:
295 Reg 32: Argument pointer 286 Reg 32: Argument pointer
296 Reg 33: Condition code 287 Reg 33: Condition code
297 Reg 34: Frame pointer 288 Reg 34: Frame pointer
298 Reg 35: Return address pointer 289 Reg 35: Return address pointer
299 290
300 Registers 36 and 37 are mapped to access registers 291 Registers 36 and 37 are mapped to access registers
301 0 and 1, used to implement thread-local storage. */ 292 0 and 1, used to implement thread-local storage. */
302 293
303 #define FIRST_PSEUDO_REGISTER 38 294 #define FIRST_PSEUDO_REGISTER 38
304 295
305 /* Standard register usage. */ 296 /* Standard register usage. */
449 are included amongst the address registers here. */ 440 are included amongst the address registers here. */
450 441
451 enum reg_class 442 enum reg_class
452 { 443 {
453 NO_REGS, CC_REGS, ADDR_REGS, GENERAL_REGS, ACCESS_REGS, 444 NO_REGS, CC_REGS, ADDR_REGS, GENERAL_REGS, ACCESS_REGS,
454 ADDR_CC_REGS, GENERAL_CC_REGS, 445 ADDR_CC_REGS, GENERAL_CC_REGS,
455 FP_REGS, ADDR_FP_REGS, GENERAL_FP_REGS, 446 FP_REGS, ADDR_FP_REGS, GENERAL_FP_REGS,
456 ALL_REGS, LIM_REG_CLASSES 447 ALL_REGS, LIM_REG_CLASSES
457 }; 448 };
458 #define N_REG_CLASSES (int) LIM_REG_CLASSES 449 #define N_REG_CLASSES (int) LIM_REG_CLASSES
459 450
569 /* Offset of first parameter from the argument pointer register value. 560 /* Offset of first parameter from the argument pointer register value.
570 We have a fake argument pointer register that points directly to 561 We have a fake argument pointer register that points directly to
571 the argument area. */ 562 the argument area. */
572 #define FIRST_PARM_OFFSET(FNDECL) 0 563 #define FIRST_PARM_OFFSET(FNDECL) 0
573 564
574 /* Defining this macro makes __builtin_frame_address(0) and 565 /* Defining this macro makes __builtin_frame_address(0) and
575 __builtin_return_address(0) work with -fomit-frame-pointer. */ 566 __builtin_return_address(0) work with -fomit-frame-pointer. */
576 #define INITIAL_FRAME_ADDRESS_RTX \ 567 #define INITIAL_FRAME_ADDRESS_RTX \
577 (plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)) 568 (plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET))
578 569
579 /* The return address of the current frame is retrieved 570 /* The return address of the current frame is retrieved
609 #define DWARF_FRAME_RETURN_COLUMN 14 600 #define DWARF_FRAME_RETURN_COLUMN 14
610 601
611 /* Describe how we implement __builtin_eh_return. */ 602 /* Describe how we implement __builtin_eh_return. */
612 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM) 603 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM)
613 #define EH_RETURN_HANDLER_RTX gen_rtx_MEM (Pmode, return_address_pointer_rtx) 604 #define EH_RETURN_HANDLER_RTX gen_rtx_MEM (Pmode, return_address_pointer_rtx)
614 605
615 /* Select a format to encode pointers in exception handling data. */ 606 /* Select a format to encode pointers in exception handling data. */
616 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ 607 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
617 (flag_pic \ 608 (flag_pic \
618 ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \ 609 ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
619 : DW_EH_PE_absptr) 610 : DW_EH_PE_absptr)
637 'fake' hard registers are added or removed. */ 628 'fake' hard registers are added or removed. */
638 #define DWARF_FRAME_REGISTERS 34 629 #define DWARF_FRAME_REGISTERS 34
639 630
640 631
641 /* Frame pointer and argument pointer elimination. */ 632 /* Frame pointer and argument pointer elimination. */
642
643 #define FRAME_POINTER_REQUIRED 0
644 633
645 #define ELIMINABLE_REGS \ 634 #define ELIMINABLE_REGS \
646 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ 635 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
647 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \ 636 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
648 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ 637 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
649 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \ 638 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
650 { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ 639 { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
651 { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \ 640 { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
652 { BASE_REGNUM, BASE_REGNUM }} 641 { BASE_REGNUM, BASE_REGNUM }}
653 642
654 #define CAN_ELIMINATE(FROM, TO) \
655 s390_can_eliminate ((FROM), (TO))
656
657 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 643 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
658 (OFFSET) = s390_initial_elimination_offset ((FROM), (TO)) 644 (OFFSET) = s390_initial_elimination_offset ((FROM), (TO))
659 645
660 646
661 /* Stack arguments. */ 647 /* Stack arguments. */
693 679
694 680
695 /* Scalar return values. */ 681 /* Scalar return values. */
696 682
697 #define FUNCTION_VALUE(VALTYPE, FUNC) \ 683 #define FUNCTION_VALUE(VALTYPE, FUNC) \
698 s390_function_value ((VALTYPE), VOIDmode) 684 s390_function_value ((VALTYPE), (FUNC), VOIDmode)
699 685
700 #define LIBCALL_VALUE(MODE) \ 686 #define LIBCALL_VALUE(MODE) \
701 s390_function_value (NULL, (MODE)) 687 s390_function_value (NULL, NULL, (MODE))
702 688
703 /* Only gpr 2 and fpr 0 are ever used as return registers. */ 689 /* Only gpr 2 and fpr 0 are ever used as return registers. */
704 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16) 690 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16)
705 691
706 692
718 #define PROFILE_BEFORE_PROLOGUE 1 704 #define PROFILE_BEFORE_PROLOGUE 1
719 705
720 706
721 /* Trampolines for nested functions. */ 707 /* Trampolines for nested functions. */
722 708
723 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16) 709 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16)
724 710 #define TRAMPOLINE_ALIGNMENT BITS_PER_WORD
725 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
726 s390_initialize_trampoline ((ADDR), (FNADDR), (CXT))
727
728 #define TRAMPOLINE_TEMPLATE(FILE) \
729 s390_trampoline_template (FILE)
730
731 711
732 /* Addressing modes, and classification of registers for them. */ 712 /* Addressing modes, and classification of registers for them. */
733 713
734 /* Recognize any constant value that is a valid address. */ 714 /* Recognize any constant value that is a valid address. */
735 #define CONSTANT_ADDRESS_P(X) 0 715 #define CONSTANT_ADDRESS_P(X) 0
736 716
737 /* Maximum number of registers that can appear in a valid memory address. */ 717 /* Maximum number of registers that can appear in a valid memory address. */
738 #define MAX_REGS_PER_ADDRESS 2 718 #define MAX_REGS_PER_ADDRESS 2
739 719
740 /* This definition replaces the formerly used 'm' constraint with a 720 /* This definition replaces the formerly used 'm' constraint with a
741 different constraint letter in order to avoid changing semantics of 721 different constraint letter in order to avoid changing semantics of
742 the 'm' constraint when accepting new address formats in 722 the 'm' constraint when accepting new address formats in
743 legitimate_address_p. The constraint letter defined here must not be 723 TARGET_LEGITIMATE_ADDRESS_P. The constraint letter defined here
744 used in insn definitions or inline assemblies. */ 724 must not be used in insn definitions or inline assemblies. */
745 #define TARGET_MEM_CONSTRAINT 'e' 725 #define TARGET_MEM_CONSTRAINT 'e'
746
747 /* S/390 has no mode dependent addresses. */
748 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
749
750 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
751 valid memory address for an instruction.
752 The MODE argument is the machine mode for the MEM expression
753 that wants to use this address. */
754 #ifdef REG_OK_STRICT
755 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
756 { \
757 if (legitimate_address_p (MODE, X, 1)) \
758 goto ADDR; \
759 }
760 #else
761 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
762 { \
763 if (legitimate_address_p (MODE, X, 0)) \
764 goto ADDR; \
765 }
766 #endif
767
768 /* Try machine-dependent ways of modifying an illegitimate address
769 to be legitimate. If we find one, return the new, valid address.
770 This macro is used in only one place: `memory_address' in explow.c. */
771 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
772 { \
773 (X) = legitimize_address (X, OLDX, MODE); \
774 if (memory_address_p (MODE, X)) \
775 goto WIN; \
776 }
777 726
778 /* Try a machine-dependent way of reloading an illegitimate address 727 /* Try a machine-dependent way of reloading an illegitimate address
779 operand. If we find one, push the reload and jump to WIN. This 728 operand. If we find one, push the reload and jump to WIN. This
780 macro is used in only one place: `find_reloads_address' in reload.c. */ 729 macro is used in only one place: `find_reloads_address' in reload.c. */
781 #define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \ 730 #define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
812 761
813 /* Canonicalize a comparison from one we don't have to one we do have. */ 762 /* Canonicalize a comparison from one we don't have to one we do have. */
814 #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \ 763 #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \
815 s390_canonicalize_comparison (&(CODE), &(OP0), &(OP1)) 764 s390_canonicalize_comparison (&(CODE), &(OP0), &(OP1))
816 765
817 /* Define the information needed to generate branch and scc insns. This is
818 stored from the compare operation. Note that we can't use "rtx" here
819 since it hasn't been defined! */
820 extern struct rtx_def *s390_compare_op0, *s390_compare_op1, *s390_compare_emitted;
821
822
823 /* Relative costs of operations. */ 766 /* Relative costs of operations. */
824 767
825 /* On s390, copy between fprs and gprs is expensive. */ 768 /* On s390, copy between fprs and gprs is expensive. */
826 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ 769 #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
827 (( ( reg_classes_intersect_p ((CLASS1), GENERAL_REGS) \ 770 (( ( reg_classes_intersect_p ((CLASS1), GENERAL_REGS) \
840 783
841 /* Nonzero if access to memory by bytes is slow and undesirable. */ 784 /* Nonzero if access to memory by bytes is slow and undesirable. */
842 #define SLOW_BYTE_ACCESS 1 785 #define SLOW_BYTE_ACCESS 1
843 786
844 /* An integer expression for the size in bits of the largest integer machine 787 /* An integer expression for the size in bits of the largest integer machine
845 mode that should actually be used. We allow pairs of registers. */ 788 mode that should actually be used. We allow pairs of registers. */
846 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode) 789 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode)
847 790
848 /* The maximum number of bytes that a single instruction can move quickly 791 /* The maximum number of bytes that a single instruction can move quickly
849 between memory and registers or between two memory locations. */ 792 between memory and registers or between two memory locations. */
850 #define MOVE_MAX (TARGET_64BIT ? 16 : 8) 793 #define MOVE_MAX (TARGET_64BIT ? 16 : 8)