Line data Source code
1 : /* Sets (bit vectors) of hard registers, and operations on them.
2 : Copyright (C) 1987-2026 Free Software Foundation, Inc.
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 : #ifndef GCC_HARD_REG_SET_H
21 : #define GCC_HARD_REG_SET_H
22 :
23 : #include "array-traits.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 : typedef HARD_REG_ELT_TYPE HARD_REG_SET;
48 : typedef const HARD_REG_SET const_hard_reg_set;
49 :
50 : #else
51 :
52 : #define HARD_REG_SET_LONGS \
53 : ((FIRST_PSEUDO_REGISTER + HOST_BITS_PER_WIDEST_FAST_INT - 1) \
54 : / HOST_BITS_PER_WIDEST_FAST_INT)
55 :
56 : struct HARD_REG_SET
57 : {
58 : HARD_REG_SET
59 19193797340 : operator~ () const
60 : {
61 19193797340 : HARD_REG_SET res;
62 57581392020 : for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
63 38387594680 : res.elts[i] = ~elts[i];
64 19193797340 : return res;
65 : }
66 :
67 : HARD_REG_SET
68 19009661988 : operator& (const HARD_REG_SET &other) const
69 : {
70 19009661988 : HARD_REG_SET res;
71 57028985964 : for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
72 38019323976 : res.elts[i] = elts[i] & other.elts[i];
73 19009661988 : return res;
74 : }
75 :
76 : HARD_REG_SET &
77 2216390572 : operator&= (const HARD_REG_SET &other)
78 : {
79 6563580080 : for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
80 4434463560 : elts[i] &= other.elts[i];
81 2214923207 : return *this;
82 : }
83 :
84 : HARD_REG_SET
85 3947888065 : operator| (const HARD_REG_SET &other) const
86 : {
87 3947888065 : HARD_REG_SET res;
88 11843664195 : for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
89 7895776130 : res.elts[i] = elts[i] | other.elts[i];
90 3947888065 : return res;
91 : }
92 :
93 : HARD_REG_SET &
94 2516678320 : operator|= (const HARD_REG_SET &other)
95 : {
96 9470269856 : for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
97 6351181126 : elts[i] |= other.elts[i];
98 2485543701 : return *this;
99 : }
100 :
101 : bool
102 452810206 : operator== (const HARD_REG_SET &other) const
103 : {
104 452810206 : HARD_REG_ELT_TYPE bad = 0;
105 6000989601 : for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
106 4000659734 : bad |= (elts[i] ^ other.elts[i]);
107 1998830780 : return bad == 0;
108 : }
109 :
110 : bool
111 1499087 : operator!= (const HARD_REG_SET &other) const
112 : {
113 2998174 : return !operator== (other);
114 : }
115 :
116 : HARD_REG_ELT_TYPE elts[HARD_REG_SET_LONGS];
117 : };
118 : typedef const HARD_REG_SET &const_hard_reg_set;
119 :
120 : template<>
121 : struct array_traits<HARD_REG_SET>
122 : {
123 : typedef HARD_REG_ELT_TYPE element_type;
124 : static const bool has_constant_size = true;
125 : static const size_t constant_size = HARD_REG_SET_LONGS;
126 152204568 : static const element_type *base (const HARD_REG_SET &x) { return x.elts; }
127 152204568 : static size_t size (const HARD_REG_SET &) { return HARD_REG_SET_LONGS; }
128 : };
129 :
130 : #endif
131 :
132 : /* HARD_REG_SET wrapped into a structure, to make it possible to
133 : use HARD_REG_SET even in APIs that should not include
134 : hard-reg-set.h. */
135 : struct hard_reg_set_container
136 : {
137 : HARD_REG_SET set;
138 : };
139 :
140 : /* HARD_CONST is used to cast a constant to the appropriate type
141 : for use with a HARD_REG_SET. */
142 :
143 : #define HARD_CONST(X) ((HARD_REG_ELT_TYPE) (X))
144 :
145 : /* Define macros SET_HARD_REG_BIT, CLEAR_HARD_REG_BIT and TEST_HARD_REG_BIT
146 : to set, clear or test one bit in a hard reg set of type HARD_REG_SET.
147 : All three take two arguments: the set and the register number.
148 :
149 : In the case where sets are arrays of longs, the first argument
150 : is actually a pointer to a long.
151 :
152 : Define two macros for initializing a set:
153 : CLEAR_HARD_REG_SET and SET_HARD_REG_SET.
154 : These take just one argument.
155 :
156 : Also define:
157 :
158 : hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
159 : hard_reg_set_intersect_p (X, Y), which returns true if X and Y intersect.
160 : hard_reg_set_empty_p (X), which returns true if X is empty. */
161 :
162 : #define UHOST_BITS_PER_WIDE_INT ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
163 :
164 : #if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDEST_FAST_INT
165 :
166 : #define SET_HARD_REG_BIT(SET, BIT) \
167 : ((SET) |= HARD_CONST (1) << (BIT))
168 : #define CLEAR_HARD_REG_BIT(SET, BIT) \
169 : ((SET) &= ~(HARD_CONST (1) << (BIT)))
170 : #define TEST_HARD_REG_BIT(SET, BIT) \
171 : (!!((SET) & (HARD_CONST (1) << (BIT))))
172 :
173 : #define CLEAR_HARD_REG_SET(TO) ((TO) = HARD_CONST (0))
174 : #define SET_HARD_REG_SET(TO) ((TO) = ~ HARD_CONST (0))
175 :
176 : inline bool
177 : hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
178 : {
179 : return (x & ~y) == HARD_CONST (0);
180 : }
181 :
182 : inline bool
183 : hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
184 : {
185 : return (x & y) != HARD_CONST (0);
186 : }
187 :
188 : inline bool
189 : hard_reg_set_empty_p (const_hard_reg_set x)
190 : {
191 : return x == HARD_CONST (0);
192 : }
193 :
194 : inline int
195 : hard_reg_set_popcount (const_hard_reg_set x)
196 : {
197 : return popcount_hwi (x);
198 : }
199 :
200 : /* Return 0 if there aren't any differences between X and Y after the first
201 : SKIP registers, or 1 + the register number of the lowest-numbered
202 : difference, negated if it's set in Y. The return value is suitable for
203 : qsort. */
204 : inline int
205 : hard_reg_set_first_diff (const_hard_reg_set x, const_hard_reg_set y,
206 : unsigned skip)
207 : {
208 : if (skip >= UHOST_BITS_PER_WIDE_INT)
209 : return 0;
210 : const HARD_REG_ELT_TYPE full_mask = -1;
211 : HARD_REG_ELT_TYPE mask = full_mask << skip;
212 : HARD_REG_ELT_TYPE dif = (x ^ y) & mask;
213 : if (dif == 0)
214 : return 0;
215 : int bit = ctz_hwi (dif);
216 : int regp1 = bit + 1;
217 : if (y & (HARD_CONST (1) << bit))
218 : return -regp1;
219 : return regp1;
220 : }
221 :
222 : #else
223 :
224 : inline void
225 22599325010 : SET_HARD_REG_BIT (HARD_REG_SET &set, unsigned int bit)
226 : {
227 22599325010 : set.elts[bit / UHOST_BITS_PER_WIDE_INT]
228 8161048015 : |= HARD_CONST (1) << (bit % UHOST_BITS_PER_WIDE_INT);
229 15024142793 : }
230 :
231 : inline void
232 982999401 : CLEAR_HARD_REG_BIT (HARD_REG_SET &set, unsigned int bit)
233 : {
234 982999401 : set.elts[bit / UHOST_BITS_PER_WIDE_INT]
235 971579923 : &= ~(HARD_CONST (1) << (bit % UHOST_BITS_PER_WIDE_INT));
236 252916612 : }
237 :
238 : inline bool
239 83243080953 : TEST_HARD_REG_BIT (const_hard_reg_set set, unsigned int bit)
240 : {
241 83222825854 : return (set.elts[bit / UHOST_BITS_PER_WIDE_INT]
242 74907149694 : & (HARD_CONST (1) << (bit % UHOST_BITS_PER_WIDE_INT)));
243 : }
244 :
245 : inline void
246 6350264393 : CLEAR_HARD_REG_SET (HARD_REG_SET &set)
247 : {
248 25865811534 : for (unsigned int i = 0; i < ARRAY_SIZE (set.elts); ++i)
249 18698205360 : set.elts[i] = 0;
250 : }
251 :
252 : inline void
253 30240776 : SET_HARD_REG_SET (HARD_REG_SET &set)
254 : {
255 93140399 : for (unsigned int i = 0; i < ARRAY_SIZE (set.elts); ++i)
256 62096028 : set.elts[i] = -1;
257 : }
258 :
259 : inline bool
260 >11873*10^7 : hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
261 : {
262 >11873*10^7 : HARD_REG_ELT_TYPE bad = 0;
263 >59490*10^7 : for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
264 >39660*10^7 : bad |= (x.elts[i] & ~y.elts[i]);
265 >19829*10^7 : return bad == 0;
266 : }
267 :
268 : inline bool
269 60329632769 : hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
270 : {
271 61093505078 : HARD_REG_ELT_TYPE good = 0;
272 >21843*10^7 : for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
273 >14562*10^7 : good |= (x.elts[i] & y.elts[i]);
274 72811113211 : return good != 0;
275 : }
276 :
277 : inline bool
278 11060188277 : hard_reg_set_empty_p (const_hard_reg_set x)
279 : {
280 11060188277 : HARD_REG_ELT_TYPE bad = 0;
281 34060802955 : for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
282 22707201970 : bad |= x.elts[i];
283 11353600985 : return bad == 0;
284 : }
285 :
286 : inline int
287 60672834 : hard_reg_set_popcount (const_hard_reg_set x)
288 : {
289 60672834 : int count = 0;
290 182018502 : for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
291 121345668 : count += popcount_hwi (x.elts[i]);
292 60672834 : return count;
293 : }
294 :
295 : /* Return 0 if there aren't any differences between X and Y after the first
296 : SKIP registers, or 1 + the register number of the lowest-numbered
297 : difference, negated if it's set in Y. The return value is suitable for
298 : qsort. */
299 : inline int
300 2077589 : hard_reg_set_first_diff (const_hard_reg_set x, const_hard_reg_set y,
301 : unsigned skip)
302 : {
303 2077589 : const HARD_REG_ELT_TYPE full_mask = -1;
304 2077589 : HARD_REG_ELT_TYPE mask = full_mask << (skip % UHOST_BITS_PER_WIDE_INT);
305 2077589 : for (unsigned int i = skip / UHOST_BITS_PER_WIDE_INT;
306 2077927 : i < ARRAY_SIZE (x.elts); ++i)
307 : {
308 2077927 : HARD_REG_ELT_TYPE dif = (x.elts[i] ^ y.elts[i]) & mask;
309 2077927 : if (dif == 0)
310 : {
311 338 : mask = full_mask;
312 338 : continue;
313 : }
314 2077589 : int bit = ctz_hwi (dif);
315 2077589 : int regp1 = bit + 1 + i * UHOST_BITS_PER_WIDE_INT;
316 2077589 : if (y.elts[i] & (HARD_CONST (1) << bit))
317 1148626 : return -regp1;
318 : return regp1;
319 : }
320 : return 0;
321 : }
322 : #endif
323 :
324 : /* Iterator for hard register sets. */
325 :
326 : struct hard_reg_set_iterator
327 : {
328 : /* Pointer to the current element. */
329 : const HARD_REG_ELT_TYPE *pelt;
330 :
331 : /* The length of the set. */
332 : unsigned short length;
333 :
334 : /* Word within the current element. */
335 : unsigned short word_no;
336 :
337 : /* Contents of the actually processed word. When finding next bit
338 : it is shifted right, so that the actual bit is always the least
339 : significant bit of ACTUAL. */
340 : HARD_REG_ELT_TYPE bits;
341 : };
342 :
343 : #define HARD_REG_ELT_BITS UHOST_BITS_PER_WIDE_INT
344 :
345 : /* The implementation of the iterator functions is a simplified version of
346 : those of bitmap iterators. */
347 : inline void
348 268925563 : hard_reg_set_iter_init (hard_reg_set_iterator *iter, const_hard_reg_set set,
349 : unsigned min, unsigned *regno)
350 : {
351 : #ifdef HARD_REG_SET_LONGS
352 268925563 : iter->pelt = set.elts;
353 268925563 : iter->length = HARD_REG_SET_LONGS;
354 : #else
355 : iter->pelt = &set;
356 : iter->length = 1;
357 : #endif
358 268925563 : iter->word_no = min / HARD_REG_ELT_BITS;
359 268925563 : if (iter->word_no < iter->length)
360 : {
361 268925563 : iter->bits = iter->pelt[iter->word_no];
362 268925563 : iter->bits >>= min % HARD_REG_ELT_BITS;
363 268925563 : *regno = min;
364 : }
365 268925563 : }
366 :
367 : inline bool
368 4327561177 : hard_reg_set_iter_set (hard_reg_set_iterator *iter, unsigned *regno)
369 : {
370 4648699203 : while (1)
371 : {
372 : /* Return false when we're advanced past the end of the set. */
373 4648699203 : if (iter->word_no >= iter->length)
374 : return false;
375 :
376 4379774171 : if (iter->bits)
377 : {
378 4058636145 : unsigned skip = ctz_hwi (iter->bits);
379 4058636145 : iter->bits >>= skip;
380 4058636145 : *regno += skip;
381 4058636145 : return (*regno < FIRST_PSEUDO_REGISTER);
382 : }
383 :
384 : /* Find the next non-zero word. */
385 537850064 : while (++iter->word_no < iter->length)
386 : {
387 268925032 : iter->bits = iter->pelt[iter->word_no];
388 268925032 : if (iter->bits)
389 : {
390 52212994 : *regno = iter->word_no * HARD_REG_ELT_BITS;
391 52212994 : break;
392 : }
393 : }
394 : }
395 : }
396 :
397 : inline void
398 4058635614 : hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *)
399 : {
400 : /* Only clear the bit, so that we skip it in iter_set. */
401 4058635614 : iter->bits &= ~ HARD_CONST (1);
402 4058635614 : }
403 :
404 : template <typename T>
405 : inline void
406 : build_error_on_rvalue (T &&)
407 : {
408 : static_assert (!std::is_rvalue_reference<T&&>::value, "");
409 : }
410 :
411 : /* SET must not change throughout the iteration. Its lifetime must cover
412 : the entire loop so we call build_error_on_rvalue() to reject a temporary
413 : object as SET.
414 : REGNUM (and ITER) may only be changed by the iteration functions. */
415 : #define EXECUTE_IF_SET_IN_HARD_REG_SET(SET, MIN, REGNUM, ITER) \
416 : for (build_error_on_rvalue (SET), \
417 : hard_reg_set_iter_init (&(ITER), (SET), (MIN), &(REGNUM)); \
418 : hard_reg_set_iter_set (&(ITER), &(REGNUM)); \
419 : hard_reg_set_iter_next (&(ITER), &(REGNUM)))
420 :
421 :
422 : /* Define some standard sets of registers. */
423 :
424 : /* Indexed by hard register number, contains 1 for registers
425 : that are being used for global register decls.
426 : These must be exempt from ordinary flow analysis
427 : and are also considered fixed. */
428 :
429 : extern char global_regs[FIRST_PSEUDO_REGISTER];
430 :
431 : extern HARD_REG_SET global_reg_set;
432 :
433 : class simplifiable_subreg;
434 : class subreg_shape;
435 :
436 : struct simplifiable_subregs_hasher : nofree_ptr_hash <simplifiable_subreg>
437 : {
438 : typedef const subreg_shape *compare_type;
439 :
440 : static inline hashval_t hash (const simplifiable_subreg *);
441 : static inline bool equal (const simplifiable_subreg *, const subreg_shape *);
442 : };
443 :
444 : struct target_hard_regs {
445 : void finalize ();
446 :
447 : /* The set of registers that actually exist on the current target. */
448 : HARD_REG_SET x_accessible_reg_set;
449 :
450 : /* The set of registers that should be considered to be register
451 : operands. It is a subset of x_accessible_reg_set. */
452 : HARD_REG_SET x_operand_reg_set;
453 :
454 : /* Indexed by hard register number, contains 1 for registers
455 : that are fixed use (stack pointer, pc, frame pointer, etc.;.
456 : These are the registers that cannot be used to allocate
457 : a pseudo reg whose life does not cross calls. */
458 : char x_fixed_regs[FIRST_PSEUDO_REGISTER];
459 :
460 : /* The same info as a HARD_REG_SET. */
461 : HARD_REG_SET x_fixed_reg_set;
462 :
463 : /* Indexed by hard register number, contains 1 for registers
464 : that are fixed use or are clobbered by function calls.
465 : These are the registers that cannot be used to allocate
466 : a pseudo reg whose life crosses calls. */
467 : char x_call_used_regs[FIRST_PSEUDO_REGISTER];
468 :
469 : /* For targets that use reload rather than LRA, this is the set
470 : of registers that we are able to save and restore around calls
471 : (i.e. those for which we know a suitable mode and set of
472 : load/store instructions exist). For LRA targets it contains
473 : all registers.
474 :
475 : This is legacy information and should be removed if all targets
476 : switch to LRA. */
477 : HARD_REG_SET x_savable_regs;
478 :
479 : /* Contains registers that are fixed use -- i.e. in fixed_reg_set -- but
480 : only if they are not merely part of that set because they are global
481 : regs. Global regs that are not otherwise fixed can still take part
482 : in register allocation. */
483 : HARD_REG_SET x_fixed_nonglobal_reg_set;
484 :
485 : /* Contains 1 for registers that are set or clobbered by calls. */
486 : /* ??? Ideally, this would be just call_used_regs plus global_regs, but
487 : for someone's bright idea to have call_used_regs strictly include
488 : fixed_regs. Which leaves us guessing as to the set of fixed_regs
489 : that are actually preserved. We know for sure that those associated
490 : with the local stack frame are safe, but scant others. */
491 : HARD_REG_SET x_regs_invalidated_by_call;
492 :
493 : /* The set of registers that are used by EH_RETURN_DATA_REGNO. */
494 : HARD_REG_SET x_eh_return_data_regs;
495 :
496 : /* Table of register numbers in the order in which to try to use them. */
497 : int x_reg_alloc_order[FIRST_PSEUDO_REGISTER];
498 :
499 : /* The inverse of reg_alloc_order. */
500 : int x_inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
501 :
502 : /* For each reg class, a HARD_REG_SET saying which registers are in it. */
503 : HARD_REG_SET x_reg_class_contents[N_REG_CLASSES];
504 :
505 : /* For each reg class, a boolean saying whether the class contains only
506 : fixed registers. */
507 : bool x_class_only_fixed_regs[N_REG_CLASSES];
508 :
509 : /* For each reg class, number of regs it contains. */
510 : unsigned int x_reg_class_size[N_REG_CLASSES];
511 :
512 : /* For each reg class, table listing all the classes contained in it. */
513 : enum reg_class x_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
514 :
515 : /* For each pair of reg classes,
516 : a largest reg class contained in their union. */
517 : enum reg_class x_reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
518 :
519 : /* For each pair of reg classes,
520 : the smallest reg class that contains their union. */
521 : enum reg_class x_reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
522 :
523 : /* Vector indexed by hardware reg giving its name. */
524 : const char *x_reg_names[FIRST_PSEUDO_REGISTER];
525 :
526 : /* Records which registers can form a particular subreg, with the subreg
527 : being identified by its outer mode, inner mode and offset. */
528 : hash_table <simplifiable_subregs_hasher> *x_simplifiable_subregs;
529 : };
530 :
531 : extern struct target_hard_regs default_target_hard_regs;
532 : #if SWITCHABLE_TARGET
533 : extern struct target_hard_regs *this_target_hard_regs;
534 : #else
535 : #define this_target_hard_regs (&default_target_hard_regs)
536 : #endif
537 :
538 : #define accessible_reg_set \
539 : (this_target_hard_regs->x_accessible_reg_set)
540 : #define operand_reg_set \
541 : (this_target_hard_regs->x_operand_reg_set)
542 : #define fixed_regs \
543 : (this_target_hard_regs->x_fixed_regs)
544 : #define fixed_reg_set \
545 : (this_target_hard_regs->x_fixed_reg_set)
546 : #define fixed_nonglobal_reg_set \
547 : (this_target_hard_regs->x_fixed_nonglobal_reg_set)
548 : #ifdef IN_TARGET_CODE
549 : #define call_used_regs \
550 : (this_target_hard_regs->x_call_used_regs)
551 : #endif
552 : #define savable_regs \
553 : (this_target_hard_regs->x_savable_regs)
554 : #ifdef IN_TARGET_CODE
555 : #define regs_invalidated_by_call \
556 : (this_target_hard_regs->x_regs_invalidated_by_call)
557 : #define call_used_or_fixed_regs \
558 : (regs_invalidated_by_call | fixed_reg_set)
559 : #endif
560 : #define eh_return_data_regs \
561 : (this_target_hard_regs->x_eh_return_data_regs)
562 : #define reg_alloc_order \
563 : (this_target_hard_regs->x_reg_alloc_order)
564 : #define inv_reg_alloc_order \
565 : (this_target_hard_regs->x_inv_reg_alloc_order)
566 : #define reg_class_contents \
567 : (this_target_hard_regs->x_reg_class_contents)
568 : #define class_only_fixed_regs \
569 : (this_target_hard_regs->x_class_only_fixed_regs)
570 : #define reg_class_size \
571 : (this_target_hard_regs->x_reg_class_size)
572 : #define reg_class_subclasses \
573 : (this_target_hard_regs->x_reg_class_subclasses)
574 : #define reg_class_subunion \
575 : (this_target_hard_regs->x_reg_class_subunion)
576 : #define reg_class_superunion \
577 : (this_target_hard_regs->x_reg_class_superunion)
578 : #define reg_names \
579 : (this_target_hard_regs->x_reg_names)
580 :
581 : /* Vector indexed by reg class giving its name. */
582 :
583 : extern const char * reg_class_names[];
584 :
585 : /* Given a hard REGN a FROM mode and a TO mode, return true if
586 : REGN can change from mode FROM to mode TO. */
587 : #define REG_CAN_CHANGE_MODE_P(REGN, FROM, TO) \
588 : (targetm.can_change_mode_class (FROM, TO, REGNO_REG_CLASS (REGN)))
589 :
590 : #ifdef IN_TARGET_CODE
591 : /* Return true if register REGNO is either fixed or call-used
592 : (aka call-clobbered). */
593 :
594 : inline bool
595 374240067 : call_used_or_fixed_reg_p (unsigned int regno)
596 : {
597 374240067 : return fixed_regs[regno] || this_target_hard_regs->x_call_used_regs[regno];
598 : }
599 : #endif
600 :
601 : #endif /* ! GCC_HARD_REG_SET_H */
|