comparison gcc/config/score/score.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 /* score.h for Sunplus S+CORE processor 1 /* score.h for Sunplus S+CORE processor
2 Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. 2 Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
3 Contributed by Sunnorth. 3 Contributed by Sunnorth.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it 7 GCC is free software; you can redistribute it and/or modify it
213 #undef DEFAULT_SIGNED_CHAR 213 #undef DEFAULT_SIGNED_CHAR
214 #define DEFAULT_SIGNED_CHAR 1 214 #define DEFAULT_SIGNED_CHAR 1
215 215
216 /* Default definitions for size_t and ptrdiff_t. */ 216 /* Default definitions for size_t and ptrdiff_t. */
217 #define SIZE_TYPE "unsigned int" 217 #define SIZE_TYPE "unsigned int"
218
219 #define UINTPTR_TYPE "long unsigned int"
218 220
219 /* Register Usage 221 /* Register Usage
220 222
221 S+core have: 223 S+core have:
222 - 32 integer registers 224 - 32 integer registers
553 555
554 /* Register in which static-chain is passed to a function. */ 556 /* Register in which static-chain is passed to a function. */
555 #define STATIC_CHAIN_REGNUM 23 557 #define STATIC_CHAIN_REGNUM 23
556 558
557 /* Elimination Frame Pointer and Arg Pointer */ 559 /* Elimination Frame Pointer and Arg Pointer */
558 /* Value should be nonzero if functions must have frame pointers.
559 Zero means the frame pointer need not be set up (and parms
560 may be accessed via the stack pointer) in functions that seem suitable.
561 This is computed in `reload', in reload1.c. */
562 #define FRAME_POINTER_REQUIRED cfun->calls_alloca
563 560
564 #define ELIMINABLE_REGS \ 561 #define ELIMINABLE_REGS \
565 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 562 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
566 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ 563 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
567 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 564 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
568 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} 565 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
569
570 /* We can always eliminate to the hard frame pointer. We can eliminate
571 to the stack pointer unless a frame pointer is needed. */
572 #define CAN_ELIMINATE(FROM, TO) \
573 (((TO) == HARD_FRAME_POINTER_REGNUM) \
574 || ((TO) == STACK_POINTER_REGNUM \
575 && !frame_pointer_needed))
576 566
577 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 567 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
578 (OFFSET) = score_initial_elimination_offset ((FROM), (TO)) 568 (OFFSET) = score_initial_elimination_offset ((FROM), (TO))
579 569
580 /* Passing Function Arguments on the Stack. */ 570 /* Passing Function Arguments on the Stack. */
681 fprintf (FILE, " jl _mcount \n"); \ 671 fprintf (FILE, " jl _mcount \n"); \
682 fprintf (FILE, " .set nor1 \n"); \ 672 fprintf (FILE, " .set nor1 \n"); \
683 } \ 673 } \
684 } while (0) 674 } while (0)
685 675
686 #define TRAMPOLINE_TEMPLATE(STREAM) \
687 do { \
688 if (TARGET_SCORE7) \
689 { \
690 fprintf (STREAM, "\t.set r1\n"); \
691 fprintf (STREAM, "\tmv r31, r3\n"); \
692 fprintf (STREAM, "\tbl nextinsn\n"); \
693 fprintf (STREAM, "nextinsn:\n"); \
694 fprintf (STREAM, "\tlw r1, [r3, 6*4-8]\n"); \
695 fprintf (STREAM, "\tlw r23, [r3, 6*4-4]\n"); \
696 fprintf (STREAM, "\tmv r3, r31\n"); \
697 fprintf (STREAM, "\tbr! r1\n"); \
698 fprintf (STREAM, "\tnop!\n"); \
699 fprintf (STREAM, "\t.set nor1\n"); \
700 } \
701 else if (TARGET_SCORE3) \
702 { \
703 fprintf (STREAM, "\t.set r1\n"); \
704 fprintf (STREAM, "\tmv! r31, r3\n"); \
705 fprintf (STREAM, "\tnop!\n"); \
706 fprintf (STREAM, "\tbl nextinsn\n"); \
707 fprintf (STREAM, "nextinsn:\n"); \
708 fprintf (STREAM, "\tlw! r1, [r3, 6*4-8]\n"); \
709 fprintf (STREAM, "\tnop!\n"); \
710 fprintf (STREAM, "\tlw r23, [r3, 6*4-4]\n"); \
711 fprintf (STREAM, "\tmv! r3, r31\n"); \
712 fprintf (STREAM, "\tnop!\n"); \
713 fprintf (STREAM, "\tbr! r1\n"); \
714 fprintf (STREAM, "\tnop!\n"); \
715 fprintf (STREAM, "\t.set nor1\n"); \
716 } \
717 } while (0)
718
719 /* Trampolines for Nested Functions. */ 676 /* Trampolines for Nested Functions. */
720 #define TRAMPOLINE_INSNS 6 677 #define TRAMPOLINE_INSNS 6
721 678
722 /* A C expression for the size in bytes of the trampoline, as an integer. */ 679 /* A C expression for the size in bytes of the trampoline, as an integer. */
723 #define TRAMPOLINE_SIZE (24 + GET_MODE_SIZE (ptr_mode) * 2) 680 #define TRAMPOLINE_SIZE (24 + GET_MODE_SIZE (ptr_mode) * 2)
724
725 /* A C statement to initialize the variable parts of a trampoline.
726 ADDR is an RTX for the address of the trampoline; FNADDR is an
727 RTX for the address of the nested function; STATIC_CHAIN is an
728 RTX for the static chain value that should be passed to the
729 function when it is called. */
730
731 #define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
732 score_initialize_trampoline (ADDR, FUNC, CHAIN)
733 681
734 #define HAVE_PRE_INCREMENT 1 682 #define HAVE_PRE_INCREMENT 1
735 #define HAVE_PRE_DECREMENT 1 683 #define HAVE_PRE_DECREMENT 1
736 #define HAVE_POST_INCREMENT 1 684 #define HAVE_POST_INCREMENT 1
737 #define HAVE_POST_DECREMENT 1 685 #define HAVE_POST_DECREMENT 1
738 #define HAVE_PRE_MODIFY_DISP 1 686 #define HAVE_PRE_MODIFY_DISP 1
739 #define HAVE_POST_MODIFY_DISP 1 687 #define HAVE_POST_MODIFY_DISP 1
740 #define HAVE_PRE_MODIFY_REG 0 688 #define HAVE_PRE_MODIFY_REG 0
741 #define HAVE_POST_MODIFY_REG 0 689 #define HAVE_POST_MODIFY_REG 0
742 690
743 /* Recognize any constant value that is a valid address. */
744 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
745
746 /* Maximum number of registers that can appear in a valid memory address. */ 691 /* Maximum number of registers that can appear in a valid memory address. */
747 #define MAX_REGS_PER_ADDRESS 1 692 #define MAX_REGS_PER_ADDRESS 1
748
749 #ifdef REG_OK_STRICT
750 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
751 if (score_address_p (MODE, X, 1)) \
752 goto LABEL;
753 #else
754 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
755 if (score_address_p (MODE, X, 0)) \
756 goto LABEL;
757 #endif
758 693
759 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx 694 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
760 and check its validity for a certain class. 695 and check its validity for a certain class.
761 We have two alternate definitions for each of them. 696 We have two alternate definitions for each of them.
762 The usual definition accepts all pseudo regs; the other rejects them all. 697 The usual definition accepts all pseudo regs; the other rejects them all.
773 #define REG_MODE_OK_FOR_BASE_P(X, MODE) \ 708 #define REG_MODE_OK_FOR_BASE_P(X, MODE) \
774 score_regno_mode_ok_for_base_p (REGNO (X), 1) 709 score_regno_mode_ok_for_base_p (REGNO (X), 1)
775 #endif 710 #endif
776 711
777 #define REG_OK_FOR_INDEX_P(X) 0 712 #define REG_OK_FOR_INDEX_P(X) 0
778
779 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
780 do { \
781 if (score_legitimize_address (&(X))) \
782 goto WIN; \
783 } while (0)
784
785 /* Go to LABEL if ADDR (a legitimate address expression)
786 has an effect that depends on the machine mode it is used for. */
787 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) {}
788 713
789 #define LEGITIMATE_CONSTANT_P(X) 1 714 #define LEGITIMATE_CONSTANT_P(X) 1
790 715
791 /* Condition Code Status. */ 716 /* Condition Code Status. */
792 #define SELECT_CC_MODE(OP, X, Y) score_select_cc_mode (OP, X, Y) 717 #define SELECT_CC_MODE(OP, X, Y) score_select_cc_mode (OP, X, Y)
1095 1020
1096 /* Give call MEMs SImode since it is the "most permissive" mode 1021 /* Give call MEMs SImode since it is the "most permissive" mode
1097 for 32-bit targets. */ 1022 for 32-bit targets. */
1098 #define FUNCTION_MODE Pmode 1023 #define FUNCTION_MODE Pmode
1099 1024
1100 struct extern_list GTY ((chain_next ("%h.next"))) 1025 struct GTY ((chain_next ("%h.next"))) extern_list
1101 { 1026 {
1102 struct extern_list *next; /* next external */ 1027 struct extern_list *next; /* next external */
1103 const char *name; /* name of the external */ 1028 const char *name; /* name of the external */
1104 int size; /* size in bytes */ 1029 int size; /* size in bytes */
1105 }; 1030 };