Mercurial > hg > CbC > CbC_gcc
annotate gcc/addresses.h @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
0 | 1 /* Inline functions to test validity of reg classes for addressing modes. |
145 | 2 Copyright (C) 2006-2020 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 | |
111 | 24 #ifndef GCC_ADDRESSES_H |
25 #define GCC_ADDRESSES_H | |
26 | |
0 | 27 static inline enum reg_class |
111 | 28 base_reg_class (machine_mode mode ATTRIBUTE_UNUSED, |
29 addr_space_t as ATTRIBUTE_UNUSED, | |
0 | 30 enum rtx_code outer_code ATTRIBUTE_UNUSED, |
31 enum rtx_code index_code ATTRIBUTE_UNUSED) | |
32 { | |
33 #ifdef MODE_CODE_BASE_REG_CLASS | |
131 | 34 return MODE_CODE_BASE_REG_CLASS (MACRO_MODE (mode), as, outer_code, |
35 index_code); | |
0 | 36 #else |
37 #ifdef MODE_BASE_REG_REG_CLASS | |
38 if (index_code == REG) | |
131 | 39 return MODE_BASE_REG_REG_CLASS (MACRO_MODE (mode)); |
0 | 40 #endif |
41 #ifdef MODE_BASE_REG_CLASS | |
131 | 42 return MODE_BASE_REG_CLASS (MACRO_MODE (mode)); |
0 | 43 #else |
44 return BASE_REG_CLASS; | |
45 #endif | |
46 #endif | |
47 } | |
48 | |
49 /* Wrapper function to unify target macros REGNO_MODE_CODE_OK_FOR_BASE_P, | |
50 REGNO_MODE_OK_FOR_REG_BASE_P, REGNO_MODE_OK_FOR_BASE_P and | |
51 REGNO_OK_FOR_BASE_P. | |
52 Arguments as for the REGNO_MODE_CODE_OK_FOR_BASE_P macro. */ | |
53 | |
54 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
|
55 ok_for_base_p_1 (unsigned regno ATTRIBUTE_UNUSED, |
111 | 56 machine_mode mode ATTRIBUTE_UNUSED, |
57 addr_space_t as ATTRIBUTE_UNUSED, | |
0 | 58 enum rtx_code outer_code ATTRIBUTE_UNUSED, |
59 enum rtx_code index_code ATTRIBUTE_UNUSED) | |
60 { | |
61 #ifdef REGNO_MODE_CODE_OK_FOR_BASE_P | |
131 | 62 return REGNO_MODE_CODE_OK_FOR_BASE_P (regno, MACRO_MODE (mode), as, |
111 | 63 outer_code, index_code); |
0 | 64 #else |
65 #ifdef REGNO_MODE_OK_FOR_REG_BASE_P | |
66 if (index_code == REG) | |
131 | 67 return REGNO_MODE_OK_FOR_REG_BASE_P (regno, MACRO_MODE (mode)); |
0 | 68 #endif |
69 #ifdef REGNO_MODE_OK_FOR_BASE_P | |
131 | 70 return REGNO_MODE_OK_FOR_BASE_P (regno, MACRO_MODE (mode)); |
0 | 71 #else |
72 return REGNO_OK_FOR_BASE_P (regno); | |
73 #endif | |
74 #endif | |
75 } | |
76 | |
77 /* Wrapper around ok_for_base_p_1, for use after register allocation is | |
78 complete. Arguments as for the called function. */ | |
79 | |
80 static inline bool | |
111 | 81 regno_ok_for_base_p (unsigned regno, machine_mode mode, addr_space_t as, |
0 | 82 enum rtx_code outer_code, enum rtx_code index_code) |
83 { | |
84 if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0) | |
85 regno = reg_renumber[regno]; | |
86 | |
111 | 87 return ok_for_base_p_1 (regno, mode, as, outer_code, index_code); |
0 | 88 } |
111 | 89 |
90 #endif /* GCC_ADDRESSES_H */ |