OSDN Git Service

gcc/fortran:
[pf3gnuchains/gcc-fork.git] / gcc / hard-reg-set.h
1 /* Sets (bit vectors) of hard registers, and operations on them.
2    Copyright (C) 1987, 1992, 1994, 2000, 2003, 2004, 2005
3    Free Software Foundation, Inc.
4
5 This file is part of GCC
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA.  */
21
22 #ifndef GCC_HARD_REG_SET_H
23 #define GCC_HARD_REG_SET_H 
24
25 /* Define the type of a set of hard registers.  */
26
27 /* HARD_REG_ELT_TYPE is a typedef of the unsigned integral type which
28    will be used for hard reg sets, either alone or in an array.
29
30    If HARD_REG_SET is a macro, its definition is HARD_REG_ELT_TYPE,
31    and it has enough bits to represent all the target machine's hard
32    registers.  Otherwise, it is a typedef for a suitably sized array
33    of HARD_REG_ELT_TYPEs.  HARD_REG_SET_LONGS is defined as how many.
34
35    Note that lots of code assumes that the first part of a regset is
36    the same format as a HARD_REG_SET.  To help make sure this is true,
37    we only try the widest fast integer mode (HOST_WIDEST_FAST_INT)
38    instead of all the smaller types.  This approach loses only if
39    there are very few registers and then only in the few cases where
40    we have an array of HARD_REG_SETs, so it needn't be as complex as
41    it used to be.  */
42
43 typedef unsigned HOST_WIDEST_FAST_INT HARD_REG_ELT_TYPE;
44
45 #if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDEST_FAST_INT
46
47 #define HARD_REG_SET HARD_REG_ELT_TYPE
48
49 #else
50
51 #define HARD_REG_SET_LONGS \
52  ((FIRST_PSEUDO_REGISTER + HOST_BITS_PER_WIDEST_FAST_INT - 1)   \
53   / HOST_BITS_PER_WIDEST_FAST_INT)
54 typedef HARD_REG_ELT_TYPE HARD_REG_SET[HARD_REG_SET_LONGS];
55
56 #endif
57
58 /* HARD_CONST is used to cast a constant to the appropriate type
59    for use with a HARD_REG_SET.  */
60
61 #define HARD_CONST(X) ((HARD_REG_ELT_TYPE) (X))
62
63 /* Define macros SET_HARD_REG_BIT, CLEAR_HARD_REG_BIT and TEST_HARD_REG_BIT
64    to set, clear or test one bit in a hard reg set of type HARD_REG_SET.
65    All three take two arguments: the set and the register number.
66
67    In the case where sets are arrays of longs, the first argument
68    is actually a pointer to a long.
69
70    Define two macros for initializing a set:
71    CLEAR_HARD_REG_SET and SET_HARD_REG_SET.
72    These take just one argument.
73
74    Also define macros for copying hard reg sets:
75    COPY_HARD_REG_SET and COMPL_HARD_REG_SET.
76    These take two arguments TO and FROM; they read from FROM
77    and store into TO.  COMPL_HARD_REG_SET complements each bit.
78
79    Also define macros for combining hard reg sets:
80    IOR_HARD_REG_SET and AND_HARD_REG_SET.
81    These take two arguments TO and FROM; they read from FROM
82    and combine bitwise into TO.  Define also two variants
83    IOR_COMPL_HARD_REG_SET and AND_COMPL_HARD_REG_SET
84    which use the complement of the set FROM.
85
86    Also define:
87
88    hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
89    hard_reg_set_equal_p (X, Y), which returns true if X and Y are equal.
90    hard_reg_set_intersect_p (X, Y), which returns true if X and Y intersect.
91    hard_reg_set_empty_p (X), which returns true if X is empty.  */
92
93 #ifdef HARD_REG_SET
94
95 #define SET_HARD_REG_BIT(SET, BIT)  \
96  ((SET) |= HARD_CONST (1) << (BIT))
97 #define CLEAR_HARD_REG_BIT(SET, BIT)  \
98  ((SET) &= ~(HARD_CONST (1) << (BIT)))
99 #define TEST_HARD_REG_BIT(SET, BIT)  \
100  (!!((SET) & (HARD_CONST (1) << (BIT))))
101
102 #define CLEAR_HARD_REG_SET(TO) ((TO) = HARD_CONST (0))
103 #define SET_HARD_REG_SET(TO) ((TO) = ~ HARD_CONST (0))
104
105 #define COPY_HARD_REG_SET(TO, FROM) ((TO) = (FROM))
106 #define COMPL_HARD_REG_SET(TO, FROM) ((TO) = ~(FROM))
107
108 #define IOR_HARD_REG_SET(TO, FROM) ((TO) |= (FROM))
109 #define IOR_COMPL_HARD_REG_SET(TO, FROM) ((TO) |= ~ (FROM))
110 #define AND_HARD_REG_SET(TO, FROM) ((TO) &= (FROM))
111 #define AND_COMPL_HARD_REG_SET(TO, FROM) ((TO) &= ~ (FROM))
112
113 static inline bool
114 hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
115 {
116   return (x & ~y) == HARD_CONST (0);
117 }
118
119 static inline bool
120 hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
121 {
122   return x == y;
123 }
124
125 static inline bool
126 hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
127 {
128   return (x & y) != HARD_CONST (0);
129 }
130
131 static inline bool
132 hard_reg_set_empty_p (const HARD_REG_SET x)
133 {
134   return x == HARD_CONST (0);
135 }
136
137 #else
138
139 #define UHOST_BITS_PER_WIDE_INT ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
140
141 #define SET_HARD_REG_BIT(SET, BIT)              \
142   ((SET)[(BIT) / UHOST_BITS_PER_WIDE_INT]       \
143    |= HARD_CONST (1) << ((BIT) % UHOST_BITS_PER_WIDE_INT))
144
145 #define CLEAR_HARD_REG_BIT(SET, BIT)            \
146   ((SET)[(BIT) / UHOST_BITS_PER_WIDE_INT]       \
147    &= ~(HARD_CONST (1) << ((BIT) % UHOST_BITS_PER_WIDE_INT)))
148
149 #define TEST_HARD_REG_BIT(SET, BIT)             \
150   (!!((SET)[(BIT) / UHOST_BITS_PER_WIDE_INT]    \
151       & (HARD_CONST (1) << ((BIT) % UHOST_BITS_PER_WIDE_INT))))
152
153 #if FIRST_PSEUDO_REGISTER <= 2*HOST_BITS_PER_WIDEST_FAST_INT
154 #define CLEAR_HARD_REG_SET(TO)  \
155 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
156      scan_tp_[0] = 0;                                           \
157      scan_tp_[1] = 0; } while (0)
158
159 #define SET_HARD_REG_SET(TO)  \
160 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
161      scan_tp_[0] = -1;                                          \
162      scan_tp_[1] = -1; } while (0)
163
164 #define COPY_HARD_REG_SET(TO, FROM)  \
165 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
166      scan_tp_[0] = scan_fp_[0];                                 \
167      scan_tp_[1] = scan_fp_[1]; } while (0)
168
169 #define COMPL_HARD_REG_SET(TO, FROM)  \
170 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
171      scan_tp_[0] = ~ scan_fp_[0];                               \
172      scan_tp_[1] = ~ scan_fp_[1]; } while (0)
173
174 #define AND_HARD_REG_SET(TO, FROM)  \
175 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
176      scan_tp_[0] &= scan_fp_[0];                                \
177      scan_tp_[1] &= scan_fp_[1]; } while (0)
178
179 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
180 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
181      scan_tp_[0] &= ~ scan_fp_[0];                              \
182      scan_tp_[1] &= ~ scan_fp_[1]; } while (0)
183
184 #define IOR_HARD_REG_SET(TO, FROM)  \
185 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
186      scan_tp_[0] |= scan_fp_[0];                                \
187      scan_tp_[1] |= scan_fp_[1]; } while (0)
188
189 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
190 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
191      scan_tp_[0] |= ~ scan_fp_[0];                              \
192      scan_tp_[1] |= ~ scan_fp_[1]; } while (0)
193
194 static inline bool
195 hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
196 {
197   return (x[0] & ~y[0]) == 0 && (x[1] & ~y[1]) == 0;
198 }
199
200 static inline bool
201 hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
202 {
203   return x[0] == y[0] && x[1] == y[1];
204 }
205
206 static inline bool
207 hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
208 {
209   return (x[0] & y[0]) != 0 || (x[1] & y[1]) != 0;
210 }
211
212 static inline bool
213 hard_reg_set_empty_p (const HARD_REG_SET x)
214 {
215   return x[0] == 0 && x[1] == 0;
216 }
217
218 #else
219 #if FIRST_PSEUDO_REGISTER <= 3*HOST_BITS_PER_WIDEST_FAST_INT
220 #define CLEAR_HARD_REG_SET(TO)  \
221 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
222      scan_tp_[0] = 0;                                           \
223      scan_tp_[1] = 0;                                           \
224      scan_tp_[2] = 0; } while (0)
225
226 #define SET_HARD_REG_SET(TO)  \
227 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
228      scan_tp_[0] = -1;                                          \
229      scan_tp_[1] = -1;                                          \
230      scan_tp_[2] = -1; } while (0)
231
232 #define COPY_HARD_REG_SET(TO, FROM)  \
233 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
234      scan_tp_[0] = scan_fp_[0];                                 \
235      scan_tp_[1] = scan_fp_[1];                                 \
236      scan_tp_[2] = scan_fp_[2]; } while (0)
237
238 #define COMPL_HARD_REG_SET(TO, FROM)  \
239 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
240      scan_tp_[0] = ~ scan_fp_[0];                               \
241      scan_tp_[1] = ~ scan_fp_[1];                               \
242      scan_tp_[2] = ~ scan_fp_[2]; } while (0)
243
244 #define AND_HARD_REG_SET(TO, FROM)  \
245 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
246      scan_tp_[0] &= scan_fp_[0];                                \
247      scan_tp_[1] &= scan_fp_[1];                                \
248      scan_tp_[2] &= scan_fp_[2]; } while (0)
249
250 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
251 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
252      scan_tp_[0] &= ~ scan_fp_[0];                              \
253      scan_tp_[1] &= ~ scan_fp_[1];                              \
254      scan_tp_[2] &= ~ scan_fp_[2]; } while (0)
255
256 #define IOR_HARD_REG_SET(TO, FROM)  \
257 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
258      scan_tp_[0] |= scan_fp_[0];                                \
259      scan_tp_[1] |= scan_fp_[1];                                \
260      scan_tp_[2] |= scan_fp_[2]; } while (0)
261
262 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
263 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
264      scan_tp_[0] |= ~ scan_fp_[0];                              \
265      scan_tp_[1] |= ~ scan_fp_[1];                              \
266      scan_tp_[2] |= ~ scan_fp_[2]; } while (0)
267
268 static inline bool
269 hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
270 {
271   return ((x[0] & ~y[0]) == 0
272           && (x[1] & ~y[1]) == 0
273           && (x[2] & ~y[2]) == 0);
274 }
275
276 static inline bool
277 hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
278 {
279   return x[0] == y[0] && x[1] == y[1] && x[2] == y[2];
280 }
281
282 static inline bool
283 hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
284 {
285   return ((x[0] & y[0]) != 0
286           || (x[1] & y[1]) != 0
287           || (x[2] & y[2]) != 0);
288 }
289
290 static inline bool
291 hard_reg_set_empty_p (const HARD_REG_SET x)
292 {
293   return x[0] == 0 && x[1] == 0 && x[2] == 0;
294 }
295
296 #else
297 #if FIRST_PSEUDO_REGISTER <= 4*HOST_BITS_PER_WIDEST_FAST_INT
298 #define CLEAR_HARD_REG_SET(TO)  \
299 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
300      scan_tp_[0] = 0;                                           \
301      scan_tp_[1] = 0;                                           \
302      scan_tp_[2] = 0;                                           \
303      scan_tp_[3] = 0; } while (0)
304
305 #define SET_HARD_REG_SET(TO)  \
306 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
307      scan_tp_[0] = -1;                                          \
308      scan_tp_[1] = -1;                                          \
309      scan_tp_[2] = -1;                                          \
310      scan_tp_[3] = -1; } while (0)
311
312 #define COPY_HARD_REG_SET(TO, FROM)  \
313 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
314      scan_tp_[0] = scan_fp_[0];                                 \
315      scan_tp_[1] = scan_fp_[1];                                 \
316      scan_tp_[2] = scan_fp_[2];                                 \
317      scan_tp_[3] = scan_fp_[3]; } while (0)
318
319 #define COMPL_HARD_REG_SET(TO, FROM)  \
320 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
321      scan_tp_[0] = ~ scan_fp_[0];                               \
322      scan_tp_[1] = ~ scan_fp_[1];                               \
323      scan_tp_[2] = ~ scan_fp_[2];                               \
324      scan_tp_[3] = ~ scan_fp_[3]; } while (0)
325
326 #define AND_HARD_REG_SET(TO, FROM)  \
327 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
328      scan_tp_[0] &= scan_fp_[0];                                \
329      scan_tp_[1] &= scan_fp_[1];                                \
330      scan_tp_[2] &= scan_fp_[2];                                \
331      scan_tp_[3] &= scan_fp_[3]; } while (0)
332
333 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
334 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
335      scan_tp_[0] &= ~ scan_fp_[0];                              \
336      scan_tp_[1] &= ~ scan_fp_[1];                              \
337      scan_tp_[2] &= ~ scan_fp_[2];                              \
338      scan_tp_[3] &= ~ scan_fp_[3]; } while (0)
339
340 #define IOR_HARD_REG_SET(TO, FROM)  \
341 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
342      scan_tp_[0] |= scan_fp_[0];                                \
343      scan_tp_[1] |= scan_fp_[1];                                \
344      scan_tp_[2] |= scan_fp_[2];                                \
345      scan_tp_[3] |= scan_fp_[3]; } while (0)
346
347 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
348 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
349      scan_tp_[0] |= ~ scan_fp_[0];                              \
350      scan_tp_[1] |= ~ scan_fp_[1];                              \
351      scan_tp_[2] |= ~ scan_fp_[2];                              \
352      scan_tp_[3] |= ~ scan_fp_[3]; } while (0)
353
354 static inline bool
355 hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
356 {
357   return ((x[0] & ~y[0]) == 0
358           && (x[1] & ~y[1]) == 0
359           && (x[2] & ~y[2]) == 0
360           && (x[3] & ~y[3]) == 0);
361 }
362
363 static inline bool
364 hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
365 {
366   return x[0] == y[0] && x[1] == y[1] && x[2] == y[2] && x[3] == y[3];
367 }
368
369 static inline bool
370 hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
371 {
372   return ((x[0] & y[0]) != 0
373           || (x[1] & y[1]) != 0
374           || (x[2] & y[2]) != 0
375           || (x[3] & y[3]) != 0);
376 }
377
378 static inline bool
379 hard_reg_set_empty_p (const HARD_REG_SET x)
380 {
381   return x[0] == 0 && x[1] == 0 && x[2] == 0 && x[3] == 0;
382 }
383
384 #else /* FIRST_PSEUDO_REGISTER > 3*HOST_BITS_PER_WIDEST_FAST_INT */
385
386 #define CLEAR_HARD_REG_SET(TO)  \
387 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
388      int i;                                                     \
389      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
390        *scan_tp_++ = 0; } while (0)
391
392 #define SET_HARD_REG_SET(TO)  \
393 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                        \
394      int i;                                                     \
395      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
396        *scan_tp_++ = -1; } while (0)
397
398 #define COPY_HARD_REG_SET(TO, FROM)  \
399 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
400      int i;                                                     \
401      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
402        *scan_tp_++ = *scan_fp_++; } while (0)
403
404 #define COMPL_HARD_REG_SET(TO, FROM)  \
405 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
406      int i;                                                     \
407      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
408        *scan_tp_++ = ~ *scan_fp_++; } while (0)
409
410 #define AND_HARD_REG_SET(TO, FROM)  \
411 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
412      int i;                                                     \
413      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
414        *scan_tp_++ &= *scan_fp_++; } while (0)
415
416 #define AND_COMPL_HARD_REG_SET(TO, FROM)  \
417 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
418      int i;                                                     \
419      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
420        *scan_tp_++ &= ~ *scan_fp_++; } while (0)
421
422 #define IOR_HARD_REG_SET(TO, FROM)  \
423 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
424      int i;                                                     \
425      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
426        *scan_tp_++ |= *scan_fp_++; } while (0)
427
428 #define IOR_COMPL_HARD_REG_SET(TO, FROM)  \
429 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO), *scan_fp_ = (FROM);    \
430      int i;                                                     \
431      for (i = 0; i < HARD_REG_SET_LONGS; i++)                   \
432        *scan_tp_++ |= ~ *scan_fp_++; } while (0)
433
434 static inline bool
435 hard_reg_set_subset_p (const HARD_REG_SET x, const HARD_REG_SET y)
436 {
437   int i;
438
439   for (i = 0; i < HARD_REG_SET_LONGS; i++)
440     if ((x[i] & ~y[i]) != 0)
441       return false;
442   return true;
443 }
444
445 static inline bool
446 hard_reg_set_equal_p (const HARD_REG_SET x, const HARD_REG_SET y)
447 {
448   int i;
449
450   for (i = 0; i < HARD_REG_SET_LONGS; i++)
451     if (x[i] != y[i])
452       return false;
453   return true;
454 }
455
456 static inline bool
457 hard_reg_set_intersect_p (const HARD_REG_SET x, const HARD_REG_SET y)
458 {
459   int i;
460
461   for (i = 0; i < HARD_REG_SET_LONGS; i++)
462     if ((x[i] & y[i]) != 0)
463       return true;
464   return false;
465 }
466
467 static inline bool
468 hard_reg_set_empty_p (const HARD_REG_SET x)
469 {
470   int i;
471
472   for (i = 0; i < HARD_REG_SET_LONGS; i++)
473     if (x[i] != 0)
474       return false;
475   return true;
476 }
477
478 #endif
479 #endif
480 #endif
481 #endif
482
483 /* Define some standard sets of registers.  */
484
485 /* Indexed by hard register number, contains 1 for registers
486    that are fixed use (stack pointer, pc, frame pointer, etc.).
487    These are the registers that cannot be used to allocate
488    a pseudo reg whose life does not cross calls.  */
489
490 extern char fixed_regs[FIRST_PSEUDO_REGISTER];
491
492 /* The same info as a HARD_REG_SET.  */
493
494 extern HARD_REG_SET fixed_reg_set;
495
496 /* Indexed by hard register number, contains 1 for registers
497    that are fixed use or are clobbered by function calls.
498    These are the registers that cannot be used to allocate
499    a pseudo reg whose life crosses calls.  */
500
501 extern char call_used_regs[FIRST_PSEUDO_REGISTER];
502
503 #ifdef CALL_REALLY_USED_REGISTERS
504 extern char call_really_used_regs[];
505 #endif
506
507 /* The same info as a HARD_REG_SET.  */
508
509 extern HARD_REG_SET call_used_reg_set;
510   
511 /* Registers that we don't want to caller save.  */
512 extern HARD_REG_SET losing_caller_save_reg_set;
513
514 /* Indexed by hard register number, contains 1 for registers that are
515    fixed use -- i.e. in fixed_regs -- or a function value return register
516    or TARGET_STRUCT_VALUE_RTX or STATIC_CHAIN_REGNUM.  These are the
517    registers that cannot hold quantities across calls even if we are
518    willing to save and restore them.  */
519
520 extern char call_fixed_regs[FIRST_PSEUDO_REGISTER];
521
522 /* The same info as a HARD_REG_SET.  */
523
524 extern HARD_REG_SET call_fixed_reg_set;
525
526 /* Indexed by hard register number, contains 1 for registers
527    that are being used for global register decls.
528    These must be exempt from ordinary flow analysis
529    and are also considered fixed.  */
530
531 extern char global_regs[FIRST_PSEUDO_REGISTER];
532
533 /* Contains 1 for registers that are set or clobbered by calls.  */
534 /* ??? Ideally, this would be just call_used_regs plus global_regs, but
535    for someone's bright idea to have call_used_regs strictly include
536    fixed_regs.  Which leaves us guessing as to the set of fixed_regs
537    that are actually preserved.  We know for sure that those associated
538    with the local stack frame are safe, but scant others.  */
539
540 extern HARD_REG_SET regs_invalidated_by_call;
541
542 #ifdef REG_ALLOC_ORDER
543 /* Table of register numbers in the order in which to try to use them.  */
544
545 extern int reg_alloc_order[FIRST_PSEUDO_REGISTER];
546
547 /* The inverse of reg_alloc_order.  */
548
549 extern int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
550 #endif
551
552 /* For each reg class, a HARD_REG_SET saying which registers are in it.  */
553
554 extern HARD_REG_SET reg_class_contents[N_REG_CLASSES];
555
556 /* For each reg class, number of regs it contains.  */
557
558 extern unsigned int reg_class_size[N_REG_CLASSES];
559
560 /* For each pair of reg classes,
561    a largest reg class contained in their union.  */
562
563 extern enum reg_class reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
564
565 /* For each pair of reg classes,
566    the smallest reg class that contains their union.  */
567
568 extern enum reg_class reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
569
570 /* Vector indexed by hardware reg giving its name.  */
571
572 extern const char * reg_names[FIRST_PSEUDO_REGISTER];
573
574 /* Vector indexed by reg class giving its name.  */
575
576 extern const char * reg_class_names[];
577
578 /* Given a hard REGN a FROM mode and a TO mode, return nonzero if
579    REGN cannot change modes between the specified modes.  */
580 #define REG_CANNOT_CHANGE_MODE_P(REGN, FROM, TO)                          \
581          CANNOT_CHANGE_MODE_CLASS (FROM, TO, REGNO_REG_CLASS (REGN))
582
583 #endif /* ! GCC_HARD_REG_SET_H */