comparison gcc/config/mn10300/mn10300.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. 1 /* Definitions of target machine for GNU compiler.
2 Matsushita MN10300 series 2 Matsushita MN10300 series
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 2007, 2008 Free Software Foundation, Inc. 4 2007, 2008, 2009 Free Software Foundation, Inc.
5 Contributed by Jeff Law (law@cygnus.com). 5 Contributed by Jeff Law (law@cygnus.com).
6 6
7 This file is part of GCC. 7 This file is part of GCC.
8 8
9 GCC is free software; you can redistribute it and/or modify 9 GCC is free software; you can redistribute it and/or modify
482 #define ELIMINABLE_REGS \ 482 #define ELIMINABLE_REGS \
483 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 483 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
484 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ 484 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
485 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} 485 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
486 486
487 #define CAN_ELIMINATE(FROM, TO) 1
488
489 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 487 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
490 OFFSET = initial_offset (FROM, TO) 488 OFFSET = initial_offset (FROM, TO)
491 489
492 /* We can debug without frame pointers on the mn10300, so eliminate 490 /* We can debug without frame pointers on the mn10300, so eliminate
493 them whenever possible. */ 491 them whenever possible. */
494 #define FRAME_POINTER_REQUIRED 0
495 #define CAN_DEBUG_WITHOUT_FP 492 #define CAN_DEBUG_WITHOUT_FP
496 493
497 /* Value is the number of bytes of arguments automatically 494 /* Value is the number of bytes of arguments automatically
498 popped when returning from a subroutine call. 495 popped when returning from a subroutine call.
499 FUNDECL is the declaration node of the function (as a tree), 496 FUNDECL is the declaration node of the function (as a tree),
565 /* On the MN10300 all args are pushed. */ 562 /* On the MN10300 all args are pushed. */
566 563
567 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ 564 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
568 function_arg (&CUM, MODE, TYPE, NAMED) 565 function_arg (&CUM, MODE, TYPE, NAMED)
569 566
570 /* Define how to find the value returned by a function. 567 #define FUNCTION_VALUE_REGNO_P(N) mn10300_function_value_regno_p (N)
571 VALTYPE is the data type of the value (as a tree).
572 If the precise function being called is known, FUNC is its FUNCTION_DECL;
573 otherwise, FUNC is 0. */
574
575 #define FUNCTION_VALUE(VALTYPE, FUNC) \
576 mn10300_function_value (VALTYPE, FUNC, 0)
577 #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
578 mn10300_function_value (VALTYPE, FUNC, 1)
579
580 /* Define how to find the value returned by a library function
581 assuming the value has mode MODE. */
582
583 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM)
584
585 /* 1 if N is a possible register number for a function value. */
586
587 #define FUNCTION_VALUE_REGNO_P(N) \
588 ((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM)
589 568
590 #define DEFAULT_PCC_STRUCT_RETURN 0 569 #define DEFAULT_PCC_STRUCT_RETURN 0
591 570
592 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, 571 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
593 the stack pointer does not matter. The value is tested only in 572 the stack pointer does not matter. The value is tested only in
599 /* Output assembler code to FILE to increment profiler label # LABELNO 578 /* Output assembler code to FILE to increment profiler label # LABELNO
600 for profiling a function entry. */ 579 for profiling a function entry. */
601 580
602 #define FUNCTION_PROFILER(FILE, LABELNO) ; 581 #define FUNCTION_PROFILER(FILE, LABELNO) ;
603 582
604 #define TRAMPOLINE_TEMPLATE(FILE) \
605 do { \
606 fprintf (FILE, "\tadd -4,sp\n"); \
607 fprintf (FILE, "\t.long 0x0004fffa\n"); \
608 fprintf (FILE, "\tmov (0,sp),a0\n"); \
609 fprintf (FILE, "\tadd 4,sp\n"); \
610 fprintf (FILE, "\tmov (13,a0),a1\n"); \
611 fprintf (FILE, "\tmov (17,a0),a0\n"); \
612 fprintf (FILE, "\tjmp (a0)\n"); \
613 fprintf (FILE, "\t.long 0\n"); \
614 fprintf (FILE, "\t.long 0\n"); \
615 } while (0)
616
617 /* Length in units of the trampoline for entering a nested function. */ 583 /* Length in units of the trampoline for entering a nested function. */
618 584
619 #define TRAMPOLINE_SIZE 0x1b 585 #define TRAMPOLINE_SIZE 0x1b
620 586
621 #define TRAMPOLINE_ALIGNMENT 32 587 #define TRAMPOLINE_ALIGNMENT 32
622 588
623 /* Emit RTL insns to initialize the variable parts of a trampoline.
624 FNADDR is an RTX for the address of the function's pure code.
625 CXT is an RTX for the static chain value for the function. */
626
627 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
628 { \
629 emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x14)), \
630 (CXT)); \
631 emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x18)), \
632 (FNADDR)); \
633 }
634 /* A C expression whose value is RTL representing the value of the return 589 /* A C expression whose value is RTL representing the value of the return
635 address for the frame COUNT steps up from the current frame. 590 address for the frame COUNT steps up from the current frame.
636 591
637 On the mn10300, the return address is not at a constant location 592 On the mn10300, the return address is not at a constant location
638 due to the frame layout. Luckily, it is at a constant offset from 593 due to the frame layout. Luckily, it is at a constant offset from
643 #define RETURN_ADDR_RTX(COUNT, FRAME) \ 598 #define RETURN_ADDR_RTX(COUNT, FRAME) \
644 ((COUNT == 0) \ 599 ((COUNT == 0) \
645 ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \ 600 ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \
646 : (rtx) 0) 601 : (rtx) 0)
647 602
648 /* 1 if X is an rtx for a constant that is a valid address. */
649
650 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
651
652 /* Maximum number of registers that can appear in a valid memory address. */ 603 /* Maximum number of registers that can appear in a valid memory address. */
653 604
654 #define MAX_REGS_PER_ADDRESS 2 605 #define MAX_REGS_PER_ADDRESS 2
655 606
656 607
657 #define HAVE_POST_INCREMENT (TARGET_AM33) 608 #define HAVE_POST_INCREMENT (TARGET_AM33)
658
659 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
660 that is a valid memory address for an instruction.
661 The MODE argument is the machine mode for the MEM expression
662 that wants to use this address.
663
664 The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
665 except for CONSTANT_ADDRESS_P which is actually
666 machine-independent.
667
668 On the mn10300, the value in the address register must be
669 in the same memory space/segment as the effective address.
670
671 This is problematical for reload since it does not understand
672 that base+index != index+base in a memory reference.
673
674 Note it is still possible to use reg+reg addressing modes,
675 it's just much more difficult. For a discussion of a possible
676 workaround and solution, see the comments in pa.c before the
677 function record_unscaled_index_insn_codes. */
678 609
679 /* Accept either REG or SUBREG where a register is valid. */ 610 /* Accept either REG or SUBREG where a register is valid. */
680 611
681 #define RTX_OK_FOR_BASE_P(X, strict) \ 612 #define RTX_OK_FOR_BASE_P(X, strict) \
682 ((REG_P (X) && REGNO_STRICT_OK_FOR_BASE_P (REGNO (X), \ 613 ((REG_P (X) && REGNO_STRICT_OK_FOR_BASE_P (REGNO (X), \
683 (strict))) \ 614 (strict))) \
684 || (GET_CODE (X) == SUBREG && REG_P (SUBREG_REG (X)) \ 615 || (GET_CODE (X) == SUBREG && REG_P (SUBREG_REG (X)) \
685 && REGNO_STRICT_OK_FOR_BASE_P (REGNO (SUBREG_REG (X)), \ 616 && REGNO_STRICT_OK_FOR_BASE_P (REGNO (SUBREG_REG (X)), \
686 (strict)))) 617 (strict))))
687 618
688 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
689 do \
690 { \
691 if (legitimate_address_p ((MODE), (X), REG_STRICT)) \
692 goto ADDR; \
693 } \
694 while (0)
695
696 619
697 /* Try machine-dependent ways of modifying an illegitimate address
698 to be legitimate. If we find one, return the new, valid address.
699 This macro is used in only one place: `memory_address' in explow.c.
700
701 OLDX is the address as it was before break_out_memory_refs was called.
702 In some cases it is useful to look at this to decide what needs to be done.
703
704 MODE and WIN are passed so that this macro can use
705 GO_IF_LEGITIMATE_ADDRESS.
706
707 It is always safe for this macro to do nothing. It exists to recognize
708 opportunities to optimize the output. */
709
710 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
711 { rtx orig_x = (X); \
712 (X) = legitimize_address (X, OLDX, MODE); \
713 if ((X) != orig_x && memory_address_p (MODE, X)) \
714 goto WIN; }
715
716 /* Go to LABEL if ADDR (a legitimate address expression)
717 has an effect that depends on the machine mode it is used for. */
718
719 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
720 620
721 /* Nonzero if the constant value X is a legitimate general operand. 621 /* Nonzero if the constant value X is a legitimate general operand.
722 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ 622 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
723 623
724 #define LEGITIMATE_CONSTANT_P(X) 1 624 #define LEGITIMATE_CONSTANT_P(X) 1
813 713
814 /* Nonzero if access to memory by bytes or half words is no faster 714 /* Nonzero if access to memory by bytes or half words is no faster
815 than accessing full words. */ 715 than accessing full words. */
816 #define SLOW_BYTE_ACCESS 1 716 #define SLOW_BYTE_ACCESS 1
817 717
818 /* Dispatch tables on the mn10300 are extremely expensive in terms of code
819 and readonly data size. So we crank up the case threshold value to
820 encourage a series of if/else comparisons to implement many small switch
821 statements. In theory, this value could be increased much more if we
822 were solely optimizing for space, but we keep it "reasonable" to avoid
823 serious code efficiency lossage. */
824 #define CASE_VALUES_THRESHOLD 6
825
826 #define NO_FUNCTION_CSE 718 #define NO_FUNCTION_CSE
827 719
828 /* According expr.c, a value of around 6 should minimize code size, and 720 /* According expr.c, a value of around 6 should minimize code size, and
829 for the MN10300 series, that's our primary concern. */ 721 for the MN10300 series, that's our primary concern. */
830 #define MOVE_RATIO(speed) 6 722 #define MOVE_RATIO(speed) 6
843 /* Output to assembler file text saying following lines 735 /* Output to assembler file text saying following lines
844 no longer contain unusual constructs. */ 736 no longer contain unusual constructs. */
845 737
846 #define ASM_APP_OFF "#NO_APP\n" 738 #define ASM_APP_OFF "#NO_APP\n"
847 739
740 #undef USER_LABEL_PREFIX
741 #define USER_LABEL_PREFIX "_"
742
848 /* This says how to output the assembler to define a global 743 /* This says how to output the assembler to define a global
849 uninitialized but not common symbol. 744 uninitialized but not common symbol.
850 Try to use asm_output_bss to implement this macro. */ 745 Try to use asm_output_bss to implement this macro. */
851 746
852 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ 747 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
858 /* This is how to output a reference to a user-level label named NAME. 753 /* This is how to output a reference to a user-level label named NAME.
859 `assemble_name' uses this. */ 754 `assemble_name' uses this. */
860 755
861 #undef ASM_OUTPUT_LABELREF 756 #undef ASM_OUTPUT_LABELREF
862 #define ASM_OUTPUT_LABELREF(FILE, NAME) \ 757 #define ASM_OUTPUT_LABELREF(FILE, NAME) \
863 fprintf (FILE, "_%s", (*targetm.strip_name_encoding) (NAME)) 758 asm_fprintf (FILE, "%U%s", (*targetm.strip_name_encoding) (NAME))
864 759
865 #define ASM_PN_FORMAT "%s___%lu" 760 #define ASM_PN_FORMAT "%s___%lu"
866 761
867 /* This is how we tell the assembler that two symbols have the same value. */ 762 /* This is how we tell the assembler that two symbols have the same value. */
868 763