Mercurial > hg > CbC > CbC_gcc
annotate gcc/addresses.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | a06113de4d67 |
children | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 /* Inline functions to test validity of reg classes for addressing modes. |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2 Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc. |
0 | 3 |
4 This file is part of GCC. | |
5 | |
6 GCC is free software; you can redistribute it and/or modify it under | |
7 the terms of the GNU General Public License as published by the Free | |
8 Software Foundation; either version 3, or (at your option) any later | |
9 version. | |
10 | |
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GCC; see the file COPYING3. If not see | |
18 <http://www.gnu.org/licenses/>. */ | |
19 | |
20 /* Wrapper function to unify target macros MODE_CODE_BASE_REG_CLASS, | |
21 MODE_BASE_REG_REG_CLASS, MODE_BASE_REG_CLASS and BASE_REG_CLASS. | |
22 Arguments as for the MODE_CODE_BASE_REG_CLASS macro. */ | |
23 | |
24 static inline enum reg_class | |
25 base_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED, | |
26 enum rtx_code outer_code ATTRIBUTE_UNUSED, | |
27 enum rtx_code index_code ATTRIBUTE_UNUSED) | |
28 { | |
29 #ifdef MODE_CODE_BASE_REG_CLASS | |
30 return MODE_CODE_BASE_REG_CLASS (mode, outer_code, index_code); | |
31 #else | |
32 #ifdef MODE_BASE_REG_REG_CLASS | |
33 if (index_code == REG) | |
34 return MODE_BASE_REG_REG_CLASS (mode); | |
35 #endif | |
36 #ifdef MODE_BASE_REG_CLASS | |
37 return MODE_BASE_REG_CLASS (mode); | |
38 #else | |
39 return BASE_REG_CLASS; | |
40 #endif | |
41 #endif | |
42 } | |
43 | |
44 /* Wrapper function to unify target macros REGNO_MODE_CODE_OK_FOR_BASE_P, | |
45 REGNO_MODE_OK_FOR_REG_BASE_P, REGNO_MODE_OK_FOR_BASE_P and | |
46 REGNO_OK_FOR_BASE_P. | |
47 Arguments as for the REGNO_MODE_CODE_OK_FOR_BASE_P macro. */ | |
48 | |
49 static inline bool | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
50 ok_for_base_p_1 (unsigned regno ATTRIBUTE_UNUSED, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
51 enum machine_mode mode ATTRIBUTE_UNUSED, |
0 | 52 enum rtx_code outer_code ATTRIBUTE_UNUSED, |
53 enum rtx_code index_code ATTRIBUTE_UNUSED) | |
54 { | |
55 #ifdef REGNO_MODE_CODE_OK_FOR_BASE_P | |
56 return REGNO_MODE_CODE_OK_FOR_BASE_P (regno, mode, outer_code, index_code); | |
57 #else | |
58 #ifdef REGNO_MODE_OK_FOR_REG_BASE_P | |
59 if (index_code == REG) | |
60 return REGNO_MODE_OK_FOR_REG_BASE_P (regno, mode); | |
61 #endif | |
62 #ifdef REGNO_MODE_OK_FOR_BASE_P | |
63 return REGNO_MODE_OK_FOR_BASE_P (regno, mode); | |
64 #else | |
65 return REGNO_OK_FOR_BASE_P (regno); | |
66 #endif | |
67 #endif | |
68 } | |
69 | |
70 /* Wrapper around ok_for_base_p_1, for use after register allocation is | |
71 complete. Arguments as for the called function. */ | |
72 | |
73 static inline bool | |
74 regno_ok_for_base_p (unsigned regno, enum machine_mode mode, | |
75 enum rtx_code outer_code, enum rtx_code index_code) | |
76 { | |
77 if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0) | |
78 regno = reg_renumber[regno]; | |
79 | |
80 return ok_for_base_p_1 (regno, mode, outer_code, index_code); | |
81 } |