Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/alpha/alpha.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 /* Subroutines used for code generation on the DEC Alpha. | 1 /* Subroutines used for code generation on the DEC Alpha. |
2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | 3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
5 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) | 5 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) |
6 | 6 |
7 This file is part of GCC. | 7 This file is part of GCC. |
8 | 8 |
27 #include "tm.h" | 27 #include "tm.h" |
28 #include "rtl.h" | 28 #include "rtl.h" |
29 #include "tree.h" | 29 #include "tree.h" |
30 #include "regs.h" | 30 #include "regs.h" |
31 #include "hard-reg-set.h" | 31 #include "hard-reg-set.h" |
32 #include "real.h" | |
33 #include "insn-config.h" | 32 #include "insn-config.h" |
34 #include "conditions.h" | 33 #include "conditions.h" |
35 #include "output.h" | 34 #include "output.h" |
36 #include "insn-attr.h" | 35 #include "insn-attr.h" |
37 #include "flags.h" | 36 #include "flags.h" |
386 { | 385 { |
387 alpha_tune = cpu_table [i].processor; | 386 alpha_tune = cpu_table [i].processor; |
388 break; | 387 break; |
389 } | 388 } |
390 if (i == ct_size) | 389 if (i == ct_size) |
391 error ("bad value %qs for -mcpu switch", alpha_tune_string); | 390 error ("bad value %qs for -mtune switch", alpha_tune_string); |
392 } | 391 } |
393 | 392 |
394 /* Do some sanity checks on the above options. */ | 393 /* Do some sanity checks on the above options. */ |
395 | 394 |
396 if (TARGET_ABI_UNICOSMK && alpha_fptm != ALPHA_FPTM_N) | 395 if (TARGET_ABI_UNICOSMK && alpha_fptm != ALPHA_FPTM_N) |
1472 thus displacements from it are naturally alignable. */ | 1471 thus displacements from it are naturally alignable. */ |
1473 if (MEM_ALIGN (ref) >= 32) | 1472 if (MEM_ALIGN (ref) >= 32) |
1474 offset = 0; | 1473 offset = 0; |
1475 else | 1474 else |
1476 offset = disp & 3; | 1475 offset = disp & 3; |
1476 | |
1477 /* The location should not cross aligned word boundary. */ | |
1478 gcc_assert (offset + GET_MODE_SIZE (GET_MODE (ref)) | |
1479 <= GET_MODE_SIZE (SImode)); | |
1477 | 1480 |
1478 /* Access the entire aligned word. */ | 1481 /* Access the entire aligned word. */ |
1479 *paligned_mem = widen_memory_access (ref, SImode, -offset); | 1482 *paligned_mem = widen_memory_access (ref, SImode, -offset); |
1480 | 1483 |
1481 /* Convert the byte offset within the word to a bit offset. */ | 1484 /* Convert the byte offset within the word to a bit offset. */ |
4726 a dependency LINK or INSN on DEP_INSN. COST is the current cost. */ | 4729 a dependency LINK or INSN on DEP_INSN. COST is the current cost. */ |
4727 | 4730 |
4728 static int | 4731 static int |
4729 alpha_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) | 4732 alpha_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) |
4730 { | 4733 { |
4731 enum attr_type insn_type, dep_insn_type; | 4734 enum attr_type dep_insn_type; |
4732 | 4735 |
4733 /* If the dependence is an anti-dependence, there is no cost. For an | 4736 /* If the dependence is an anti-dependence, there is no cost. For an |
4734 output dependence, there is sometimes a cost, but it doesn't seem | 4737 output dependence, there is sometimes a cost, but it doesn't seem |
4735 worth handling those few cases. */ | 4738 worth handling those few cases. */ |
4736 if (REG_NOTE_KIND (link) != 0) | 4739 if (REG_NOTE_KIND (link) != 0) |
4738 | 4741 |
4739 /* If we can't recognize the insns, we can't really do anything. */ | 4742 /* If we can't recognize the insns, we can't really do anything. */ |
4740 if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) | 4743 if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) |
4741 return cost; | 4744 return cost; |
4742 | 4745 |
4743 insn_type = get_attr_type (insn); | |
4744 dep_insn_type = get_attr_type (dep_insn); | 4746 dep_insn_type = get_attr_type (dep_insn); |
4745 | 4747 |
4746 /* Bring in the user-defined memory latency. */ | 4748 /* Bring in the user-defined memory latency. */ |
4747 if (dep_insn_type == TYPE_ILD | 4749 if (dep_insn_type == TYPE_ILD |
4748 || dep_insn_type == TYPE_FLD | 4750 || dep_insn_type == TYPE_FLD |
5849 | 5851 |
5850 rtx | 5852 rtx |
5851 function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, | 5853 function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED, |
5852 enum machine_mode mode) | 5854 enum machine_mode mode) |
5853 { | 5855 { |
5854 unsigned int regnum, dummy; | 5856 unsigned int regnum, dummy ATTRIBUTE_UNUSED; |
5855 enum mode_class mclass; | 5857 enum mode_class mclass; |
5856 | 5858 |
5857 gcc_assert (!valtype || !alpha_return_in_memory (valtype, func)); | 5859 gcc_assert (!valtype || !alpha_return_in_memory (valtype, func)); |
5858 | 5860 |
5859 if (valtype) | 5861 if (valtype) |
7133 } | 7135 } |
7134 | 7136 |
7135 /* Fold one of our builtin functions. */ | 7137 /* Fold one of our builtin functions. */ |
7136 | 7138 |
7137 static tree | 7139 static tree |
7138 alpha_fold_builtin (tree fndecl, tree arglist, bool ignore ATTRIBUTE_UNUSED) | 7140 alpha_fold_builtin (tree fndecl, int n_args, tree *op, |
7139 { | 7141 bool ignore ATTRIBUTE_UNUSED) |
7140 tree op[MAX_ARGS], t; | 7142 { |
7141 unsigned HOST_WIDE_INT opint[MAX_ARGS]; | 7143 unsigned HOST_WIDE_INT opint[MAX_ARGS]; |
7142 long op_const = 0, arity = 0; | 7144 long op_const = 0; |
7143 | 7145 int i; |
7144 for (t = arglist; t ; t = TREE_CHAIN (t), ++arity) | 7146 |
7145 { | 7147 if (n_args >= MAX_ARGS) |
7146 tree arg = TREE_VALUE (t); | 7148 return NULL; |
7149 | |
7150 for (i = 0; i < n_args; i++) | |
7151 { | |
7152 tree arg = op[i]; | |
7147 if (arg == error_mark_node) | 7153 if (arg == error_mark_node) |
7148 return NULL; | 7154 return NULL; |
7149 if (arity >= MAX_ARGS) | 7155 |
7150 return NULL; | 7156 opint[i] = 0; |
7151 | |
7152 op[arity] = arg; | |
7153 opint[arity] = 0; | |
7154 if (TREE_CODE (arg) == INTEGER_CST) | 7157 if (TREE_CODE (arg) == INTEGER_CST) |
7155 { | 7158 { |
7156 op_const |= 1L << arity; | 7159 op_const |= 1L << i; |
7157 opint[arity] = int_cst_value (arg); | 7160 opint[i] = int_cst_value (arg); |
7158 } | 7161 } |
7159 } | 7162 } |
7160 | 7163 |
7161 switch (DECL_FUNCTION_CODE (fndecl)) | 7164 switch (DECL_FUNCTION_CODE (fndecl)) |
7162 { | 7165 { |