comparison gcc/config/xtensa/xtensa.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 Tensilica's Xtensa target machine for GNU compiler. 1 /* Definitions of Tensilica's Xtensa target machine for GNU compiler.
2 Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 2 Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. 4 Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
25 /* Standard GCC variables that we reference. */ 25 /* Standard GCC variables that we reference. */
26 extern int optimize; 26 extern int optimize;
27 27
28 /* External variables defined in xtensa.c. */ 28 /* External variables defined in xtensa.c. */
29 29
30 /* comparison type */
31 enum cmp_type {
32 CMP_SI, /* four byte integers */
33 CMP_DI, /* eight byte integers */
34 CMP_SF, /* single precision floats */
35 CMP_DF, /* double precision floats */
36 CMP_MAX /* max comparison type */
37 };
38
39 extern struct rtx_def * branch_cmp[2]; /* operands for compare */
40 extern enum cmp_type branch_type; /* what type of branch to use */
41 extern unsigned xtensa_current_frame_size; 30 extern unsigned xtensa_current_frame_size;
42 31
43 /* Macros used in the machine description to select various Xtensa 32 /* Macros used in the machine description to select various Xtensa
44 configuration options. */ 33 configuration options. */
45 #ifndef XCHAL_HAVE_MUL32_HIGH 34 #ifndef XCHAL_HAVE_MUL32_HIGH
389 access automatic variables in the stack frame. For Xtensa, this 378 access automatic variables in the stack frame. For Xtensa, this
390 register never appears in the output. It is always eliminated to 379 register never appears in the output. It is always eliminated to
391 either the stack pointer or the hard frame pointer. */ 380 either the stack pointer or the hard frame pointer. */
392 #define FRAME_POINTER_REGNUM (GP_REG_FIRST + 16) 381 #define FRAME_POINTER_REGNUM (GP_REG_FIRST + 16)
393 382
394 /* Value should be nonzero if functions must have frame pointers.
395 Zero means the frame pointer need not be set up (and parms
396 may be accessed via the stack pointer) in functions that seem suitable.
397 This is computed in 'reload', in reload1.c. */
398 #define FRAME_POINTER_REQUIRED xtensa_frame_pointer_required ()
399
400 /* Base register for access to arguments of the function. */ 383 /* Base register for access to arguments of the function. */
401 #define ARG_POINTER_REGNUM (GP_REG_FIRST + 17) 384 #define ARG_POINTER_REGNUM (GP_REG_FIRST + 17)
402
403 /* If the static chain is passed in memory, these macros provide rtx
404 giving 'mem' expressions that denote where they are stored.
405 'STATIC_CHAIN' and 'STATIC_CHAIN_INCOMING' give the locations as
406 seen by the calling and called functions, respectively. */
407
408 #define STATIC_CHAIN \
409 gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -5 * UNITS_PER_WORD))
410
411 #define STATIC_CHAIN_INCOMING \
412 gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -5 * UNITS_PER_WORD))
413 385
414 /* For now we don't try to use the full set of boolean registers. Without 386 /* For now we don't try to use the full set of boolean registers. Without
415 software pipelining of FP operations, there's not much to gain and it's 387 software pipelining of FP operations, there's not much to gain and it's
416 a real pain to get them reloaded. */ 388 a real pain to get them reloaded. */
417 #define FPCC_REGNUM (BR_REG_FIRST + 0) 389 #define FPCC_REGNUM (BR_REG_FIRST + 0)
539 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 511 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
540 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ 512 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
541 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 513 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
542 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} 514 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
543 515
544 #define CAN_ELIMINATE(FROM, TO) 1
545
546 /* Specify the initial difference between the specified pair of registers. */ 516 /* Specify the initial difference between the specified pair of registers. */
547 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 517 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
548 do { \ 518 do { \
549 compute_frame_size (get_frame_size ()); \ 519 compute_frame_size (get_frame_size ()); \
550 switch (FROM) \ 520 switch (FROM) \
599 /* Don't worry about compatibility with PCC. */ 569 /* Don't worry about compatibility with PCC. */
600 #define DEFAULT_PCC_STRUCT_RETURN 0 570 #define DEFAULT_PCC_STRUCT_RETURN 0
601 571
602 /* Define how to find the value returned by a library function 572 /* Define how to find the value returned by a library function
603 assuming the value has mode MODE. Because we have defined 573 assuming the value has mode MODE. Because we have defined
604 TARGET_PROMOTE_FUNCTION_RETURN that returns true, we have to 574 TARGET_PROMOTE_FUNCTION_MODE to promote everything, we have to
605 perform the same promotions as PROMOTE_MODE. */ 575 perform the same promotions as PROMOTE_MODE. */
606 #define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \ 576 #define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \
607 gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \ 577 gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \
608 && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ 578 && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
609 ? SImode : (MODE), \ 579 ? SImode : (MODE), \
694 } while (0) 664 } while (0)
695 665
696 /* Stack pointer value doesn't matter at exit. */ 666 /* Stack pointer value doesn't matter at exit. */
697 #define EXIT_IGNORE_STACK 1 667 #define EXIT_IGNORE_STACK 1
698 668
699 #define TRAMPOLINE_TEMPLATE(STREAM) xtensa_trampoline_template (STREAM)
700
701 /* Size in bytes of the trampoline, as an integer. Make sure this is 669 /* Size in bytes of the trampoline, as an integer. Make sure this is
702 a multiple of TRAMPOLINE_ALIGNMENT to avoid -Wpadded warnings. */ 670 a multiple of TRAMPOLINE_ALIGNMENT to avoid -Wpadded warnings. */
703 #define TRAMPOLINE_SIZE (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS ? 60 : 52) 671 #define TRAMPOLINE_SIZE (TARGET_CONST16 || TARGET_ABSOLUTE_LITERALS ? 60 : 52)
704 672
705 /* Alignment required for trampolines, in bits. */ 673 /* Alignment required for trampolines, in bits. */
706 #define TRAMPOLINE_ALIGNMENT 32 674 #define TRAMPOLINE_ALIGNMENT 32
707
708 /* A C statement to initialize the variable parts of a trampoline. */
709 #define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
710 xtensa_initialize_trampoline (ADDR, FUNC, CHAIN)
711
712 675
713 /* If defined, a C expression that produces the machine-specific code 676 /* If defined, a C expression that produces the machine-specific code
714 to setup the stack so that arbitrary frames can be accessed. 677 to setup the stack so that arbitrary frames can be accessed.
715 678
716 On Xtensa, a stack back-trace must always begin from the stack pointer, 679 On Xtensa, a stack back-trace must always begin from the stack pointer,
780 #define REG_OK_FOR_BASE_P(X) BASE_REG_P (X, REG_OK_STRICT_FLAG) 743 #define REG_OK_FOR_BASE_P(X) BASE_REG_P (X, REG_OK_STRICT_FLAG)
781 744
782 /* Maximum number of registers that can appear in a valid memory address. */ 745 /* Maximum number of registers that can appear in a valid memory address. */
783 #define MAX_REGS_PER_ADDRESS 1 746 #define MAX_REGS_PER_ADDRESS 1
784 747
785 /* Identify valid Xtensa addresses. */
786 #define GO_IF_LEGITIMATE_ADDRESS(MODE, ADDR, LABEL) \
787 do { \
788 if (xtensa_legitimate_address_p (MODE, ADDR, REG_OK_STRICT_FLAG)) \
789 goto LABEL; \
790 } while (0)
791
792 /* A C expression that is 1 if the RTX X is a constant which is a 748 /* A C expression that is 1 if the RTX X is a constant which is a
793 valid address. This is defined to be the same as 'CONSTANT_P (X)', 749 valid address. This is defined to be the same as 'CONSTANT_P (X)',
794 but rejecting CONST_DOUBLE. */ 750 but rejecting CONST_DOUBLE. */
795 #define CONSTANT_ADDRESS_P(X) \ 751 #define CONSTANT_ADDRESS_P(X) \
796 ((GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ 752 ((GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
807 #define LEGITIMATE_PIC_OPERAND_P(X) \ 763 #define LEGITIMATE_PIC_OPERAND_P(X) \
808 ((GET_CODE (X) != SYMBOL_REF \ 764 ((GET_CODE (X) != SYMBOL_REF \
809 || (SYMBOL_REF_LOCAL_P (X) && !SYMBOL_REF_EXTERNAL_P (X))) \ 765 || (SYMBOL_REF_LOCAL_P (X) && !SYMBOL_REF_EXTERNAL_P (X))) \
810 && GET_CODE (X) != LABEL_REF \ 766 && GET_CODE (X) != LABEL_REF \
811 && GET_CODE (X) != CONST) 767 && GET_CODE (X) != CONST)
812
813 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
814 do { \
815 rtx new_x = xtensa_legitimize_address (X, OLDX, MODE); \
816 if (new_x) \
817 { \
818 X = new_x; \
819 goto WIN; \
820 } \
821 } while (0)
822
823 768
824 /* Treat constant-pool references as "mode dependent" since they can 769 /* Treat constant-pool references as "mode dependent" since they can
825 only be accessed with SImode loads. This works around a bug in the 770 only be accessed with SImode loads. This works around a bug in the
826 combiner where a constant pool reference is temporarily converted 771 combiner where a constant pool reference is temporarily converted
827 to an HImode load, which is then assumed to zero-extend based on 772 to an HImode load, which is then assumed to zero-extend based on