annotate gcc/hard-reg-set.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Sets (bit vectors) of hard registers, and operations on them.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 1987-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 #ifndef GCC_HARD_REG_SET_H
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
21 #define GCC_HARD_REG_SET_H
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
23 #include "array-traits.h"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
24
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 /* Define the type of a set of hard registers. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 /* HARD_REG_ELT_TYPE is a typedef of the unsigned integral type which
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 will be used for hard reg sets, either alone or in an array.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 If HARD_REG_SET is a macro, its definition is HARD_REG_ELT_TYPE,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 and it has enough bits to represent all the target machine's hard
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 registers. Otherwise, it is a typedef for a suitably sized array
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 of HARD_REG_ELT_TYPEs. HARD_REG_SET_LONGS is defined as how many.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 Note that lots of code assumes that the first part of a regset is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 the same format as a HARD_REG_SET. To help make sure this is true,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 we only try the widest fast integer mode (HOST_WIDEST_FAST_INT)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 instead of all the smaller types. This approach loses only if
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 there are very few registers and then only in the few cases where
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 we have an array of HARD_REG_SETs, so it needn't be as complex as
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 it used to be. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 typedef unsigned HOST_WIDEST_FAST_INT HARD_REG_ELT_TYPE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 #if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDEST_FAST_INT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
47 typedef HARD_REG_ELT_TYPE HARD_REG_SET;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
48 typedef const HARD_REG_SET const_hard_reg_set;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 #define HARD_REG_SET_LONGS \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 ((FIRST_PSEUDO_REGISTER + HOST_BITS_PER_WIDEST_FAST_INT - 1) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 / HOST_BITS_PER_WIDEST_FAST_INT)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
55
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
56 struct HARD_REG_SET
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
57 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
58 HARD_REG_SET
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
59 operator~ () const
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
60 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
61 HARD_REG_SET res;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
62 for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
63 res.elts[i] = ~elts[i];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
64 return res;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
65 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
66
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
67 HARD_REG_SET
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
68 operator& (const HARD_REG_SET &other) const
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
69 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
70 HARD_REG_SET res;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
71 for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
72 res.elts[i] = elts[i] & other.elts[i];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
73 return res;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
74 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
75
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 HARD_REG_SET &
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
77 operator&= (const HARD_REG_SET &other)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
78 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
79 for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
80 elts[i] &= other.elts[i];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
81 return *this;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
82 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
83
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
84 HARD_REG_SET
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
85 operator| (const HARD_REG_SET &other) const
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
86 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
87 HARD_REG_SET res;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
88 for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
89 res.elts[i] = elts[i] | other.elts[i];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
90 return res;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
92
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
93 HARD_REG_SET &
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
94 operator|= (const HARD_REG_SET &other)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
95 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
96 for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
97 elts[i] |= other.elts[i];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
98 return *this;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
99 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
100
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
101 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
102 operator== (const HARD_REG_SET &other) const
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
103 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
104 HARD_REG_ELT_TYPE bad = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
105 for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
106 bad |= (elts[i] ^ other.elts[i]);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
107 return bad == 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
108 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
109
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
110 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
111 operator!= (const HARD_REG_SET &other) const
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
112 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
113 return !operator== (other);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
114 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
115
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
116 HARD_REG_ELT_TYPE elts[HARD_REG_SET_LONGS];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
117 };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
118 typedef const HARD_REG_SET &const_hard_reg_set;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
119
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
120 template<>
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
121 struct array_traits<HARD_REG_SET>
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
122 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
123 typedef HARD_REG_ELT_TYPE element_type;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
124 static const bool has_constant_size = true;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
125 static const size_t constant_size = HARD_REG_SET_LONGS;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
126 static const element_type *base (const HARD_REG_SET &x) { return x.elts; }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
127 static size_t size (const HARD_REG_SET &) { return HARD_REG_SET_LONGS; }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
128 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131
111
kono
parents: 67
diff changeset
132 /* HARD_REG_SET wrapped into a structure, to make it possible to
kono
parents: 67
diff changeset
133 use HARD_REG_SET even in APIs that should not include
kono
parents: 67
diff changeset
134 hard-reg-set.h. */
kono
parents: 67
diff changeset
135 struct hard_reg_set_container
kono
parents: 67
diff changeset
136 {
kono
parents: 67
diff changeset
137 HARD_REG_SET set;
kono
parents: 67
diff changeset
138 };
kono
parents: 67
diff changeset
139
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 /* HARD_CONST is used to cast a constant to the appropriate type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 for use with a HARD_REG_SET. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 #define HARD_CONST(X) ((HARD_REG_ELT_TYPE) (X))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 /* Define macros SET_HARD_REG_BIT, CLEAR_HARD_REG_BIT and TEST_HARD_REG_BIT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 to set, clear or test one bit in a hard reg set of type HARD_REG_SET.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 All three take two arguments: the set and the register number.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 In the case where sets are arrays of longs, the first argument
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 is actually a pointer to a long.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 Define two macros for initializing a set:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 CLEAR_HARD_REG_SET and SET_HARD_REG_SET.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 These take just one argument.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 Also define:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 hard_reg_set_intersect_p (X, Y), which returns true if X and Y intersect.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 hard_reg_set_empty_p (X), which returns true if X is empty. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 #define UHOST_BITS_PER_WIDE_INT ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
164 #if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDEST_FAST_INT
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 #define SET_HARD_REG_BIT(SET, BIT) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 ((SET) |= HARD_CONST (1) << (BIT))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 #define CLEAR_HARD_REG_BIT(SET, BIT) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 ((SET) &= ~(HARD_CONST (1) << (BIT)))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 #define TEST_HARD_REG_BIT(SET, BIT) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 (!!((SET) & (HARD_CONST (1) << (BIT))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 #define CLEAR_HARD_REG_SET(TO) ((TO) = HARD_CONST (0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 #define SET_HARD_REG_SET(TO) ((TO) = ~ HARD_CONST (0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 static inline bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
177 hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 return (x & ~y) == HARD_CONST (0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 static inline bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
183 hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 return (x & y) != HARD_CONST (0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 static inline bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
189 hard_reg_set_empty_p (const_hard_reg_set x)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 return x == HARD_CONST (0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
196 inline void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
197 SET_HARD_REG_BIT (HARD_REG_SET &set, unsigned int bit)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
199 set.elts[bit / UHOST_BITS_PER_WIDE_INT]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
200 |= HARD_CONST (1) << (bit % UHOST_BITS_PER_WIDE_INT);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
203 inline void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
204 CLEAR_HARD_REG_BIT (HARD_REG_SET &set, unsigned int bit)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
206 set.elts[bit / UHOST_BITS_PER_WIDE_INT]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
207 &= ~(HARD_CONST (1) << (bit % UHOST_BITS_PER_WIDE_INT));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
210 inline bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
211 TEST_HARD_REG_BIT (const_hard_reg_set set, unsigned int bit)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
213 return (set.elts[bit / UHOST_BITS_PER_WIDE_INT]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
214 & (HARD_CONST (1) << (bit % UHOST_BITS_PER_WIDE_INT)));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
217 inline void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
218 CLEAR_HARD_REG_SET (HARD_REG_SET &set)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
220 for (unsigned int i = 0; i < ARRAY_SIZE (set.elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
221 set.elts[i] = 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
224 inline void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
225 SET_HARD_REG_SET (HARD_REG_SET &set)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
227 for (unsigned int i = 0; i < ARRAY_SIZE (set.elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
228 set.elts[i] = -1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 static inline bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
232 hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
234 HARD_REG_ELT_TYPE bad = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
235 for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
236 bad |= (x.elts[i] & ~y.elts[i]);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
237 return bad == 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 static inline bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
241 hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
243 HARD_REG_ELT_TYPE good = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
244 for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
245 good |= (x.elts[i] & y.elts[i]);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
246 return good != 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 static inline bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
250 hard_reg_set_empty_p (const_hard_reg_set x)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
252 HARD_REG_ELT_TYPE bad = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
253 for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
254 bad |= x.elts[i];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
255 return bad == 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 /* Iterator for hard register sets. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
111
kono
parents: 67
diff changeset
261 struct hard_reg_set_iterator
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 /* Pointer to the current element. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
264 const HARD_REG_ELT_TYPE *pelt;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 /* The length of the set. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 unsigned short length;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 /* Word within the current element. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 unsigned short word_no;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 /* Contents of the actually processed word. When finding next bit
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 it is shifted right, so that the actual bit is always the least
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 significant bit of ACTUAL. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 HARD_REG_ELT_TYPE bits;
111
kono
parents: 67
diff changeset
276 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 #define HARD_REG_ELT_BITS UHOST_BITS_PER_WIDE_INT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
280 /* The implementation of the iterator functions is fully analogous to
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 the bitmap iterators. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
283 hard_reg_set_iter_init (hard_reg_set_iterator *iter, const_hard_reg_set set,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 unsigned min, unsigned *regno)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 #ifdef HARD_REG_SET_LONGS
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
287 iter->pelt = set.elts;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 iter->length = HARD_REG_SET_LONGS;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 iter->pelt = &set;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 iter->length = 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 iter->word_no = min / HARD_REG_ELT_BITS;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 if (iter->word_no < iter->length)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 iter->bits = iter->pelt[iter->word_no];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 iter->bits >>= min % HARD_REG_ELT_BITS;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 /* This is required for correct search of the next bit. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 min += !iter->bits;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 *regno = min;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
305 static inline bool
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 hard_reg_set_iter_set (hard_reg_set_iterator *iter, unsigned *regno)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 while (1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 /* Return false when we're advanced past the end of the set. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 if (iter->word_no >= iter->length)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 if (iter->bits)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 /* Find the correct bit and return it. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 while (!(iter->bits & 1))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 iter->bits >>= 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 *regno += 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 return (*regno < FIRST_PSEUDO_REGISTER);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 }
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
324
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 /* Round to the beginning of the next word. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 *regno = (*regno + HARD_REG_ELT_BITS - 1);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 *regno -= *regno % HARD_REG_ELT_BITS;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329 /* Find the next non-zero word. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 while (++iter->word_no < iter->length)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 iter->bits = iter->pelt[iter->word_no];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 if (iter->bits)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 break;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 *regno += HARD_REG_ELT_BITS;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 static inline void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 iter->bits >>= 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 *regno += 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 #define EXECUTE_IF_SET_IN_HARD_REG_SET(SET, MIN, REGNUM, ITER) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 for (hard_reg_set_iter_init (&(ITER), (SET), (MIN), &(REGNUM)); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 hard_reg_set_iter_set (&(ITER), &(REGNUM)); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 hard_reg_set_iter_next (&(ITER), &(REGNUM)))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 /* Define some standard sets of registers. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 /* Indexed by hard register number, contains 1 for registers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 that are being used for global register decls.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 These must be exempt from ordinary flow analysis
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 and are also considered fixed. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 extern char global_regs[FIRST_PSEUDO_REGISTER];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
362 class simplifiable_subreg;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
363 class subreg_shape;
111
kono
parents: 67
diff changeset
364
kono
parents: 67
diff changeset
365 struct simplifiable_subregs_hasher : nofree_ptr_hash <simplifiable_subreg>
kono
parents: 67
diff changeset
366 {
kono
parents: 67
diff changeset
367 typedef const subreg_shape *compare_type;
kono
parents: 67
diff changeset
368
kono
parents: 67
diff changeset
369 static inline hashval_t hash (const simplifiable_subreg *);
kono
parents: 67
diff changeset
370 static inline bool equal (const simplifiable_subreg *, const subreg_shape *);
kono
parents: 67
diff changeset
371 };
kono
parents: 67
diff changeset
372
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
373 struct target_hard_regs {
111
kono
parents: 67
diff changeset
374 void finalize ();
kono
parents: 67
diff changeset
375
kono
parents: 67
diff changeset
376 /* The set of registers that actually exist on the current target. */
kono
parents: 67
diff changeset
377 HARD_REG_SET x_accessible_reg_set;
kono
parents: 67
diff changeset
378
kono
parents: 67
diff changeset
379 /* The set of registers that should be considered to be register
kono
parents: 67
diff changeset
380 operands. It is a subset of x_accessible_reg_set. */
kono
parents: 67
diff changeset
381 HARD_REG_SET x_operand_reg_set;
kono
parents: 67
diff changeset
382
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
383 /* Indexed by hard register number, contains 1 for registers
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
384 that are fixed use (stack pointer, pc, frame pointer, etc.;.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
385 These are the registers that cannot be used to allocate
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
386 a pseudo reg whose life does not cross calls. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
387 char x_fixed_regs[FIRST_PSEUDO_REGISTER];
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
388
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
389 /* The same info as a HARD_REG_SET. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
390 HARD_REG_SET x_fixed_reg_set;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
391
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
392 /* Indexed by hard register number, contains 1 for registers
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
393 that are fixed use or are clobbered by function calls.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
394 These are the registers that cannot be used to allocate
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
395 a pseudo reg whose life crosses calls. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
396 char x_call_used_regs[FIRST_PSEUDO_REGISTER];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
398 /* For targets that use reload rather than LRA, this is the set
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
399 of registers that we are able to save and restore around calls
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
400 (i.e. those for which we know a suitable mode and set of
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
401 load/store instructions exist). For LRA targets it contains
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
402 all registers.
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
403
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
404 This is legacy information and should be removed if all targets
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
405 switch to LRA. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
406 HARD_REG_SET x_savable_regs;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
407
111
kono
parents: 67
diff changeset
408 /* Contains registers that are fixed use -- i.e. in fixed_reg_set -- but
kono
parents: 67
diff changeset
409 only if they are not merely part of that set because they are global
kono
parents: 67
diff changeset
410 regs. Global regs that are not otherwise fixed can still take part
kono
parents: 67
diff changeset
411 in register allocation. */
kono
parents: 67
diff changeset
412 HARD_REG_SET x_fixed_nonglobal_reg_set;
kono
parents: 67
diff changeset
413
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
414 /* Contains 1 for registers that are set or clobbered by calls. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
415 /* ??? Ideally, this would be just call_used_regs plus global_regs, but
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
416 for someone's bright idea to have call_used_regs strictly include
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
417 fixed_regs. Which leaves us guessing as to the set of fixed_regs
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
418 that are actually preserved. We know for sure that those associated
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
419 with the local stack frame are safe, but scant others. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
420 HARD_REG_SET x_regs_invalidated_by_call;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
422 /* Table of register numbers in the order in which to try to use them. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
423 int x_reg_alloc_order[FIRST_PSEUDO_REGISTER];
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
424
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
425 /* The inverse of reg_alloc_order. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
426 int x_inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
428 /* For each reg class, a HARD_REG_SET saying which registers are in it. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
429 HARD_REG_SET x_reg_class_contents[N_REG_CLASSES];
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
430
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
431 /* For each reg class, a boolean saying whether the class contains only
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
432 fixed registers. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
433 bool x_class_only_fixed_regs[N_REG_CLASSES];
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
434
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
435 /* For each reg class, number of regs it contains. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
436 unsigned int x_reg_class_size[N_REG_CLASSES];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
438 /* For each reg class, table listing all the classes contained in it. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
439 enum reg_class x_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
440
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
441 /* For each pair of reg classes,
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
442 a largest reg class contained in their union. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
443 enum reg_class x_reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
445 /* For each pair of reg classes,
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
446 the smallest reg class that contains their union. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
447 enum reg_class x_reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
449 /* Vector indexed by hardware reg giving its name. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
450 const char *x_reg_names[FIRST_PSEUDO_REGISTER];
111
kono
parents: 67
diff changeset
451
kono
parents: 67
diff changeset
452 /* Records which registers can form a particular subreg, with the subreg
kono
parents: 67
diff changeset
453 being identified by its outer mode, inner mode and offset. */
kono
parents: 67
diff changeset
454 hash_table <simplifiable_subregs_hasher> *x_simplifiable_subregs;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
455 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
457 extern struct target_hard_regs default_target_hard_regs;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
458 #if SWITCHABLE_TARGET
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
459 extern struct target_hard_regs *this_target_hard_regs;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
460 #else
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
461 #define this_target_hard_regs (&default_target_hard_regs)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463
111
kono
parents: 67
diff changeset
464 #define accessible_reg_set \
kono
parents: 67
diff changeset
465 (this_target_hard_regs->x_accessible_reg_set)
kono
parents: 67
diff changeset
466 #define operand_reg_set \
kono
parents: 67
diff changeset
467 (this_target_hard_regs->x_operand_reg_set)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
468 #define fixed_regs \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
469 (this_target_hard_regs->x_fixed_regs)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
470 #define fixed_reg_set \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
471 (this_target_hard_regs->x_fixed_reg_set)
111
kono
parents: 67
diff changeset
472 #define fixed_nonglobal_reg_set \
kono
parents: 67
diff changeset
473 (this_target_hard_regs->x_fixed_nonglobal_reg_set)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
474 #ifdef IN_TARGET_CODE
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
475 #define call_used_regs \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
476 (this_target_hard_regs->x_call_used_regs)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
477 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
478 #define savable_regs \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
479 (this_target_hard_regs->x_savable_regs)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
480 #ifdef IN_TARGET_CODE
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
481 #define regs_invalidated_by_call \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
482 (this_target_hard_regs->x_regs_invalidated_by_call)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
483 #define call_used_or_fixed_regs \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
484 (regs_invalidated_by_call | fixed_reg_set)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
485 #endif
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
486 #define reg_alloc_order \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
487 (this_target_hard_regs->x_reg_alloc_order)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
488 #define inv_reg_alloc_order \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
489 (this_target_hard_regs->x_inv_reg_alloc_order)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
490 #define reg_class_contents \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
491 (this_target_hard_regs->x_reg_class_contents)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
492 #define class_only_fixed_regs \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
493 (this_target_hard_regs->x_class_only_fixed_regs)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
494 #define reg_class_size \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
495 (this_target_hard_regs->x_reg_class_size)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
496 #define reg_class_subclasses \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
497 (this_target_hard_regs->x_reg_class_subclasses)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
498 #define reg_class_subunion \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
499 (this_target_hard_regs->x_reg_class_subunion)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
500 #define reg_class_superunion \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
501 (this_target_hard_regs->x_reg_class_superunion)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
502 #define reg_names \
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
503 (this_target_hard_regs->x_reg_names)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 /* Vector indexed by reg class giving its name. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 extern const char * reg_class_names[];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
508
111
kono
parents: 67
diff changeset
509 /* Given a hard REGN a FROM mode and a TO mode, return true if
kono
parents: 67
diff changeset
510 REGN can change from mode FROM to mode TO. */
kono
parents: 67
diff changeset
511 #define REG_CAN_CHANGE_MODE_P(REGN, FROM, TO) \
kono
parents: 67
diff changeset
512 (targetm.can_change_mode_class (FROM, TO, REGNO_REG_CLASS (REGN)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
514 #ifdef IN_TARGET_CODE
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
515 /* Return true if register REGNO is either fixed or call-used
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
516 (aka call-clobbered). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
517
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
518 inline bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
519 call_used_or_fixed_reg_p (unsigned int regno)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
520 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
521 return fixed_regs[regno] || this_target_hard_regs->x_call_used_regs[regno];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
522 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
523 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
524
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 #endif /* ! GCC_HARD_REG_SET_H */