comparison gcc/config/mmix/mmix.c @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
1 /* Definitions of target machine for GNU compiler, for MMIX. 1 /* Definitions of target machine for GNU compiler, for MMIX.
2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
3 2010
3 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
4 Contributed by Hans-Peter Nilsson (hp@bitrange.com) 5 Contributed by Hans-Peter Nilsson (hp@bitrange.com)
5 6
6 This file is part of GCC. 7 This file is part of GCC.
7 8
40 #include "debug.h" 41 #include "debug.h"
41 #include "tm_p.h" 42 #include "tm_p.h"
42 #include "integrate.h" 43 #include "integrate.h"
43 #include "target.h" 44 #include "target.h"
44 #include "target-def.h" 45 #include "target-def.h"
45 #include "real.h"
46 46
47 /* First some local helper definitions. */ 47 /* First some local helper definitions. */
48 #define MMIX_FIRST_GLOBAL_REGNUM 32 48 #define MMIX_FIRST_GLOBAL_REGNUM 32
49 49
50 /* We'd need a current_function_has_landing_pad. It's marked as such when 50 /* We'd need a current_function_has_landing_pad. It's marked as such when
136 static bool mmix_rtx_costs (rtx, int, int, int *, bool); 136 static bool mmix_rtx_costs (rtx, int, int, int *, bool);
137 static rtx mmix_struct_value_rtx (tree, int); 137 static rtx mmix_struct_value_rtx (tree, int);
138 static enum machine_mode mmix_promote_function_mode (const_tree, 138 static enum machine_mode mmix_promote_function_mode (const_tree,
139 enum machine_mode, 139 enum machine_mode,
140 int *, const_tree, int); 140 int *, const_tree, int);
141 static rtx mmix_function_value (const_tree, const_tree, bool);
142 static rtx mmix_libcall_value (enum machine_mode, const_rtx);
143 static bool mmix_function_value_regno_p (const unsigned int);
141 static bool mmix_pass_by_reference (CUMULATIVE_ARGS *, 144 static bool mmix_pass_by_reference (CUMULATIVE_ARGS *,
142 enum machine_mode, const_tree, bool); 145 enum machine_mode, const_tree, bool);
143 static bool mmix_frame_pointer_required (void); 146 static bool mmix_frame_pointer_required (void);
144 static void mmix_asm_trampoline_template (FILE *); 147 static void mmix_asm_trampoline_template (FILE *);
145 static void mmix_trampoline_init (rtx, tree, rtx); 148 static void mmix_trampoline_init (rtx, tree, rtx);
194 #define TARGET_MACHINE_DEPENDENT_REORG mmix_reorg 197 #define TARGET_MACHINE_DEPENDENT_REORG mmix_reorg
195 198
196 #undef TARGET_PROMOTE_FUNCTION_MODE 199 #undef TARGET_PROMOTE_FUNCTION_MODE
197 #define TARGET_PROMOTE_FUNCTION_MODE mmix_promote_function_mode 200 #define TARGET_PROMOTE_FUNCTION_MODE mmix_promote_function_mode
198 201
202 #undef TARGET_FUNCTION_VALUE
203 #define TARGET_FUNCTION_VALUE mmix_function_value
204 #undef TARGET_LIBCALL_VALUE
205 #define TARGET_LIBCALL_VALUE mmix_libcall_value
206 #undef TARGET_FUNCTION_VALUE_REGNO_P
207 #define TARGET_FUNCTION_VALUE_REGNO_P mmix_function_value_regno_p
199 208
200 #undef TARGET_STRUCT_VALUE_RTX 209 #undef TARGET_STRUCT_VALUE_RTX
201 #define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx 210 #define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx
202 #undef TARGET_SETUP_INCOMING_VARARGS 211 #undef TARGET_SETUP_INCOMING_VARARGS
203 #define TARGET_SETUP_INCOMING_VARARGS mmix_setup_incoming_varargs 212 #define TARGET_SETUP_INCOMING_VARARGS mmix_setup_incoming_varargs
652 661
653 return regno >= first_arg_regnum 662 return regno >= first_arg_regnum
654 && regno < first_arg_regnum + MMIX_MAX_ARGS_IN_REGS; 663 && regno < first_arg_regnum + MMIX_MAX_ARGS_IN_REGS;
655 } 664 }
656 665
657 /* FUNCTION_OUTGOING_VALUE. */ 666 /* Implements TARGET_FUNCTION_VALUE. */
658 667
659 rtx 668 static rtx
660 mmix_function_outgoing_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED) 669 mmix_function_value (const_tree valtype,
670 const_tree func ATTRIBUTE_UNUSED,
671 bool outgoing)
661 { 672 {
662 enum machine_mode mode = TYPE_MODE (valtype); 673 enum machine_mode mode = TYPE_MODE (valtype);
663 enum machine_mode cmode; 674 enum machine_mode cmode;
664 int first_val_regnum = MMIX_OUTGOING_RETURN_VALUE_REGNUM; 675 int first_val_regnum = MMIX_OUTGOING_RETURN_VALUE_REGNUM;
665 rtx vec[MMIX_MAX_REGS_FOR_VALUE]; 676 rtx vec[MMIX_MAX_REGS_FOR_VALUE];
666 int i; 677 int i;
667 int nregs; 678 int nregs;
668 679
680 if (!outgoing)
681 return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM);
682
669 /* Return values that fit in a register need no special handling. 683 /* Return values that fit in a register need no special handling.
670 There's no register hole when parameters are passed in global 684 There's no register hole when parameters are passed in global
671 registers. */ 685 registers. */
672 if (TARGET_ABI_GNU 686 if (TARGET_ABI_GNU
673 || GET_MODE_BITSIZE (mode) <= BITS_PER_WORD) 687 || GET_MODE_BITSIZE (mode) <= BITS_PER_WORD)
715 const0_rtx); 729 const0_rtx);
716 730
717 return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nregs, vec)); 731 return gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (nregs, vec));
718 } 732 }
719 733
720 /* FUNCTION_VALUE_REGNO_P. */ 734 /* Implements TARGET_LIBCALL_VALUE. */
721 735
722 int 736 static rtx
723 mmix_function_value_regno_p (int regno) 737 mmix_libcall_value (enum machine_mode mode,
738 const_rtx fun ATTRIBUTE_UNUSED)
739 {
740 return gen_rtx_REG (mode, MMIX_RETURN_VALUE_REGNUM);
741 }
742
743 /* Implements TARGET_FUNCTION_VALUE_REGNO_P. */
744
745 static bool
746 mmix_function_value_regno_p (const unsigned int regno)
724 { 747 {
725 return regno == MMIX_RETURN_VALUE_REGNUM; 748 return regno == MMIX_RETURN_VALUE_REGNUM;
726 } 749 }
727 750
728 /* EH_RETURN_DATA_REGNO. */ 751 /* EH_RETURN_DATA_REGNO. */