GCC Middle and Back End API Reference
hard-reg-set.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hard_reg_set_container
struct  hard_reg_set_iterator
struct  target_hard_regs

Macros

#define HARD_REG_SET   HARD_REG_ELT_TYPE
#define HARD_CONST(X)   ((HARD_REG_ELT_TYPE) (X))
#define UHOST_BITS_PER_WIDE_INT   ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
#define SET_HARD_REG_BIT(SET, BIT)   ((SET) |= HARD_CONST (1) << (BIT))
#define CLEAR_HARD_REG_BIT(SET, BIT)   ((SET) &= ~(HARD_CONST (1) << (BIT)))
#define TEST_HARD_REG_BIT(SET, BIT)   (!!((SET) & (HARD_CONST (1) << (BIT))))
#define CLEAR_HARD_REG_SET(TO)   ((TO) = HARD_CONST (0))
#define SET_HARD_REG_SET(TO)   ((TO) = ~ HARD_CONST (0))
#define COPY_HARD_REG_SET(TO, FROM)   ((TO) = (FROM))
#define COMPL_HARD_REG_SET(TO, FROM)   ((TO) = ~(FROM))
#define IOR_HARD_REG_SET(TO, FROM)   ((TO) |= (FROM))
#define IOR_COMPL_HARD_REG_SET(TO, FROM)   ((TO) |= ~ (FROM))
#define AND_HARD_REG_SET(TO, FROM)   ((TO) &= (FROM))
#define AND_COMPL_HARD_REG_SET(TO, FROM)   ((TO) &= ~ (FROM))
#define HARD_REG_ELT_BITS   UHOST_BITS_PER_WIDE_INT
#define EXECUTE_IF_SET_IN_HARD_REG_SET(SET, MIN, REGNUM, ITER)
#define this_target_hard_regs   (&default_target_hard_regs)
#define accessible_reg_set   (this_target_hard_regs->x_accessible_reg_set)
#define operand_reg_set   (this_target_hard_regs->x_operand_reg_set)
#define fixed_regs   (this_target_hard_regs->x_fixed_regs)
#define fixed_reg_set   (this_target_hard_regs->x_fixed_reg_set)
#define call_used_regs   (this_target_hard_regs->x_call_used_regs)
#define call_really_used_regs   (this_target_hard_regs->x_call_really_used_regs)
#define call_used_reg_set   (this_target_hard_regs->x_call_used_reg_set)
#define call_fixed_reg_set   (this_target_hard_regs->x_call_fixed_reg_set)
#define regs_invalidated_by_call   (this_target_hard_regs->x_regs_invalidated_by_call)
#define no_caller_save_reg_set   (this_target_hard_regs->x_no_caller_save_reg_set)
#define reg_alloc_order   (this_target_hard_regs->x_reg_alloc_order)
#define inv_reg_alloc_order   (this_target_hard_regs->x_inv_reg_alloc_order)
#define reg_class_contents   (this_target_hard_regs->x_reg_class_contents)
#define class_only_fixed_regs   (this_target_hard_regs->x_class_only_fixed_regs)
#define reg_class_size   (this_target_hard_regs->x_reg_class_size)
#define reg_class_subclasses   (this_target_hard_regs->x_reg_class_subclasses)
#define reg_class_subunion   (this_target_hard_regs->x_reg_class_subunion)
#define reg_class_superunion   (this_target_hard_regs->x_reg_class_superunion)
#define reg_names   (this_target_hard_regs->x_reg_names)
#define REG_CANNOT_CHANGE_MODE_P(REGN, FROM, TO)   CANNOT_CHANGE_MODE_CLASS (FROM, TO, REGNO_REG_CLASS (REGN))

Typedefs

typedef unsigned
HOST_WIDEST_FAST_INT 
HARD_REG_ELT_TYPE

Functions

static bool hard_reg_set_subset_p ()
static bool hard_reg_set_equal_p ()
static bool hard_reg_set_intersect_p ()
static bool hard_reg_set_empty_p ()
static void hard_reg_set_iter_init (hard_reg_set_iterator *iter, HARD_REG_SET set, unsigned min, unsigned *regno)
static bool hard_reg_set_iter_set ()
static void hard_reg_set_iter_next ()

Variables

char global_regs [FIRST_PSEUDO_REGISTER]
struct target_hard_regs default_target_hard_regs
const char * reg_class_names []

Macro Definition Documentation

#define accessible_reg_set   (this_target_hard_regs->x_accessible_reg_set)

Referenced by save_register_info().

#define AND_HARD_REG_SET (   TO,
  FROM 
)    ((TO) &= (FROM))
#define call_fixed_reg_set   (this_target_hard_regs->x_call_fixed_reg_set)
#define call_really_used_regs   (this_target_hard_regs->x_call_really_used_regs)

Referenced by save_register_info().

#define call_used_regs   (this_target_hard_regs->x_call_used_regs)
#define class_only_fixed_regs   (this_target_hard_regs->x_class_only_fixed_regs)
#define CLEAR_HARD_REG_BIT (   SET,
  BIT 
)    ((SET) &= ~(HARD_CONST (1) << (BIT)))
#define COMPL_HARD_REG_SET (   TO,
  FROM 
)    ((TO) = ~(FROM))
#define EXECUTE_IF_SET_IN_HARD_REG_SET (   SET,
  MIN,
  REGNUM,
  ITER 
)
Value:
for (hard_reg_set_iter_init (&(ITER), (SET), (MIN), &(REGNUM)); \
hard_reg_set_iter_set (&(ITER), &(REGNUM)); \
hard_reg_set_iter_next (&(ITER), &(REGNUM)))
#define fixed_reg_set   (this_target_hard_regs->x_fixed_reg_set)
#define HARD_CONST (   X)    ((HARD_REG_ELT_TYPE) (X))

HARD_CONST is used to cast a constant to the appropriate type for use with a HARD_REG_SET.

Referenced by hard_reg_set_equal_p(), and hard_reg_set_intersect_p().

#define HARD_REG_ELT_BITS   UHOST_BITS_PER_WIDE_INT

Referenced by hard_reg_set_iter_init().

#define inv_reg_alloc_order   (this_target_hard_regs->x_inv_reg_alloc_order)
#define IOR_COMPL_HARD_REG_SET (   TO,
  FROM 
)    ((TO) |= ~ (FROM))
#define IOR_HARD_REG_SET (   TO,
  FROM 
)    ((TO) |= (FROM))
#define no_caller_save_reg_set   (this_target_hard_regs->x_no_caller_save_reg_set)

Referenced by reg_restore_code().

#define operand_reg_set   (this_target_hard_regs->x_operand_reg_set)

Referenced by save_register_info().

#define reg_alloc_order   (this_target_hard_regs->x_reg_alloc_order)

Referenced by split_all_insns().

#define REG_CANNOT_CHANGE_MODE_P (   REGN,
  FROM,
  TO 
)    CANNOT_CHANGE_MODE_CLASS (FROM, TO, REGNO_REG_CLASS (REGN))

Given a hard REGN a FROM mode and a TO mode, return nonzero if REGN cannot change modes between the specified modes.

Referenced by validate_subreg().

#define reg_class_size   (this_target_hard_regs->x_reg_class_size)
#define reg_class_subclasses   (this_target_hard_regs->x_reg_class_subclasses)
#define reg_class_subunion   (this_target_hard_regs->x_reg_class_subunion)

Referenced by process_alt_operands().

#define reg_class_superunion   (this_target_hard_regs->x_reg_class_superunion)
#define regs_invalidated_by_call   (this_target_hard_regs->x_regs_invalidated_by_call)
#define SET_HARD_REG_SET (   TO)    ((TO) = ~ HARD_CONST (0))

Referenced by process_bb_node_lives().

#define this_target_hard_regs   (&default_target_hard_regs)
#define UHOST_BITS_PER_WIDE_INT   ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)

Define macros SET_HARD_REG_BIT, CLEAR_HARD_REG_BIT and TEST_HARD_REG_BIT to set, clear or test one bit in a hard reg set of type HARD_REG_SET. All three take two arguments: the set and the register number.

In the case where sets are arrays of longs, the first argument is actually a pointer to a long.

Define two macros for initializing a set: CLEAR_HARD_REG_SET and SET_HARD_REG_SET. These take just one argument.

Also define macros for copying hard reg sets: COPY_HARD_REG_SET and COMPL_HARD_REG_SET. These take two arguments TO and FROM; they read from FROM and store into TO. COMPL_HARD_REG_SET complements each bit.

Also define macros for combining hard reg sets: IOR_HARD_REG_SET and AND_HARD_REG_SET. These take two arguments TO and FROM; they read from FROM and combine bitwise into TO. Define also two variants IOR_COMPL_HARD_REG_SET and AND_COMPL_HARD_REG_SET which use the complement of the set FROM.

Also define:

hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y. hard_reg_set_equal_p (X, Y), which returns true if X and Y are equal. hard_reg_set_intersect_p (X, Y), which returns true if X and Y intersect. hard_reg_set_empty_p (X), which returns true if X is empty.


Typedef Documentation

Sets (bit vectors) of hard registers, and operations on them. Copyright (C) 1987-2013 Free Software Foundation, Inc.

This file is part of GCC

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. Define the type of a set of hard registers. HARD_REG_ELT_TYPE is a typedef of the unsigned integral type which will be used for hard reg sets, either alone or in an array.

If HARD_REG_SET is a macro, its definition is HARD_REG_ELT_TYPE, and it has enough bits to represent all the target machine's hard registers. Otherwise, it is a typedef for a suitably sized array of HARD_REG_ELT_TYPEs. HARD_REG_SET_LONGS is defined as how many.

Note that lots of code assumes that the first part of a regset is the same format as a HARD_REG_SET. To help make sure this is true, we only try the widest fast integer mode (HOST_WIDEST_FAST_INT) instead of all the smaller types. This approach loses only if there are very few registers and then only in the few cases where we have an array of HARD_REG_SETs, so it needn't be as complex as it used to be.


Function Documentation

static bool hard_reg_set_empty_p ( )
inlinestatic
static bool hard_reg_set_equal_p ( )
inlinestatic

References HARD_CONST.

Referenced by setup_uniform_class_p().

static bool hard_reg_set_intersect_p ( )
inlinestatic

References HARD_CONST.

Referenced by bucket_allocno_compare_func().

static void hard_reg_set_iter_init ( hard_reg_set_iterator iter,
HARD_REG_SET  set,
unsigned  min,
unsigned *  regno 
)
inlinestatic

The implementation of the iterator functions is fully analogous to the bitmap iterators.

This is required for correct search of the next bit.

References hard_reg_set_iterator::bits, HARD_REG_ELT_BITS, hard_reg_set_iterator::pelt, and hard_reg_set_iterator::word_no.

static void hard_reg_set_iter_next ( )
inlinestatic
static bool hard_reg_set_iter_set ( )
inlinestatic
     Return false when we're advanced past the end of the set.   
         Find the correct bit and return it.   
     Round to the beginning of the next word.   
     Find the next non-zero word.   
static bool hard_reg_set_subset_p ( )
inlinestatic

Variable Documentation

struct target_hard_regs default_target_hard_regs
char global_regs[FIRST_PSEUDO_REGISTER]

Define some standard sets of registers. Indexed by hard register number, contains 1 for registers that are being used for global register decls. These must be exempt from ordinary flow analysis and are also considered fixed.

Indexed by hard register number, contains 1 for registers that are being used for global register decls. These must be exempt from ordinary flow analysis and are also considered fixed.

Referenced by fprint_ul(), merge_overlapping_regs(), and split_all_insns().

const char* reg_class_names[]

Vector indexed by reg class giving its name.

Array containing all of the register class names.

Referenced by regrename_chain_from_id(), and scan_one_insn().