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

Go to the source code of this file.

Macros

#define ALLOC_REG_SET(OBSTACK)   BITMAP_ALLOC (OBSTACK)
 
#define FREE_REG_SET(REGSET)   BITMAP_FREE (REGSET)
 
#define INIT_REG_SET(HEAD)   bitmap_initialize (HEAD, &reg_obstack)
 
#define CLEAR_REG_SET(HEAD)   bitmap_clear (HEAD)
 
#define REG_SET_EMPTY_P(HEAD)   bitmap_empty_p (HEAD)
 
#define COPY_REG_SET(TO, FROM)   bitmap_copy (TO, FROM)
 
#define REG_SET_EQUAL_P(A, B)   bitmap_equal_p (A, B)
 
#define AND_REG_SET(TO, FROM)   bitmap_and_into (TO, FROM)
 
#define AND_COMPL_REG_SET(TO, FROM)   bitmap_and_compl_into (TO, FROM)
 
#define IOR_REG_SET(TO, FROM)   bitmap_ior_into (TO, FROM)
 
#define IOR_REG_SET_HRS(TO, FROM)    bitmap_ior_into (TO, bitmap_view<HARD_REG_SET> (FROM))
 
#define XOR_REG_SET(TO, FROM)   bitmap_xor_into (TO, FROM)
 
#define IOR_AND_COMPL_REG_SET(TO, FROM1, FROM2)    bitmap_ior_and_compl_into (TO, FROM1, FROM2)
 
#define CLEAR_REGNO_REG_SET(HEAD, REG)   bitmap_clear_bit (HEAD, REG)
 
#define SET_REGNO_REG_SET(HEAD, REG)   bitmap_set_bit (HEAD, REG)
 
#define REGNO_REG_SET_P(TO, REG)   bitmap_bit_p (TO, REG)
 
#define REG_SET_TO_HARD_REG_SET(TO, FROM)
 
#define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, RSI)    EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, RSI)
 
#define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI)    EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI)
 
#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI)    EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) \
 

Typedefs

typedef bitmap_head regset_head
 
typedef bitmap regset
 
typedef bitmap_iterator reg_set_iterator
 

Functions

void reg_set_to_hard_reg_set (HARD_REG_SET *, const_bitmap)
 
void dump_regset (regset, FILE *)
 

Variables

bitmap_obstack reg_obstack
 

Macro Definition Documentation

◆ ALLOC_REG_SET

#define ALLOC_REG_SET ( OBSTACK)    BITMAP_ALLOC (OBSTACK)

◆ AND_COMPL_REG_SET

#define AND_COMPL_REG_SET ( TO,
FROM )   bitmap_and_compl_into (TO, FROM)
`and' the complement of a register set with a register set.   

Referenced by finish_spills().

◆ AND_REG_SET

#define AND_REG_SET ( TO,
FROM )   bitmap_and_into (TO, FROM)
`and' a register set with a second register set.   

◆ CLEAR_REG_SET

◆ CLEAR_REGNO_REG_SET

#define CLEAR_REGNO_REG_SET ( HEAD,
REG )   bitmap_clear_bit (HEAD, REG)
Clear a single register in a register set.   

Referenced by finish_spills(), ira_reassign_pseudos(), maybe_fix_stack_asms(), and move_insn_for_shrink_wrap().

◆ COPY_REG_SET

#define COPY_REG_SET ( TO,
FROM )   bitmap_copy (TO, FROM)
Copy a register set to another register set.   

Referenced by insert_one_insn(), peep2_fill_buffer(), peep2_reinit_state(), peep2_update_life(), and peephole2_optimize().

◆ EXECUTE_IF_AND_COMPL_IN_REG_SET

#define EXECUTE_IF_AND_COMPL_IN_REG_SET ( REGSET1,
REGSET2,
MIN,
REGNUM,
RSI )    EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI)
Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
REGNUM to the register number and executing CODE for all registers that are
set in the first regset and not set in the second.   

◆ EXECUTE_IF_AND_IN_REG_SET

#define EXECUTE_IF_AND_IN_REG_SET ( REGSET1,
REGSET2,
MIN,
REGNUM,
RSI )    EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) \
Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
REGNUM to the register number and executing CODE for all registers that are
set in both regsets.   

◆ EXECUTE_IF_SET_IN_REG_SET

#define EXECUTE_IF_SET_IN_REG_SET ( REGSET,
MIN,
REGNUM,
RSI )    EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, RSI)
Loop over all registers in REGSET, starting with MIN, setting REGNUM to the
register number and executing CODE for all registers that are set.   

Referenced by change_loop(), compute_use_by_pseudos(), create_bb_allocnos(), create_loop_allocnos(), dump_regset(), find_reg(), finish_spills(), forget_marked_reloads(), generate_edge_moves(), order_regs_for_reload(), save_call_clobbered_regs(), and setup_save_areas().

◆ FREE_REG_SET

#define FREE_REG_SET ( REGSET)    BITMAP_FREE (REGSET)
Do any cleanup needed on a regset when it is no longer used.   

Referenced by compute_hash_table_work(), free_gcse_mem(), one_cprop_pass(), and simplify_using_initial_values().

◆ INIT_REG_SET

#define INIT_REG_SET ( HEAD)    bitmap_initialize (HEAD, &reg_obstack)

◆ IOR_AND_COMPL_REG_SET

#define IOR_AND_COMPL_REG_SET ( TO,
FROM1,
FROM2 )    bitmap_ior_and_compl_into (TO, FROM1, FROM2)
Or into TO the register set FROM1 `and'ed with the complement of FROM2.   

◆ IOR_REG_SET

#define IOR_REG_SET ( TO,
FROM )   bitmap_ior_into (TO, FROM)
Inclusive or a register set with a second register set.   

Referenced by simplify_using_initial_values(), and try_head_merge_bb().

◆ IOR_REG_SET_HRS

#define IOR_REG_SET_HRS ( TO,
FROM )    bitmap_ior_into (TO, bitmap_view<HARD_REG_SET> (FROM))
Same, but with FROM being a HARD_REG_SET.   

Referenced by simplify_using_initial_values().

◆ REG_SET_EMPTY_P

#define REG_SET_EMPTY_P ( HEAD)    bitmap_empty_p (HEAD)
True if the register set is empty.   

Referenced by thread_jump().

◆ REG_SET_EQUAL_P

#define REG_SET_EQUAL_P ( A,
B )   bitmap_equal_p (A, B)
Compare two register sets.   

◆ REG_SET_TO_HARD_REG_SET

◆ REGNO_REG_SET_P

◆ SET_REGNO_REG_SET

◆ XOR_REG_SET

#define XOR_REG_SET ( TO,
FROM )   bitmap_xor_into (TO, FROM)
Exclusive or a register set with a second register set.   

Typedef Documentation

◆ reg_set_iterator

◆ regset

A pointer to a regset_head.   

◆ regset_head

Define regsets.
   Copyright (C) 1987-2024 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/>.   
TODO: regset is just a bitmap in its implementation.  The compiler does
not consistently use one or the other, i.e. sometimes variables are
declared as bitmap but they are actually regsets and regset accessors
are used, and vice versa, or mixed (see e.g. spilled_regs in IRA).

This should be cleaned up, either by just dropping the regset type, or
by changing all bitmaps that are really regsets to the regset type.  For
the latter option, a good start would be to change everything allocated
on the reg_obstack to regset.   
Head of register set linked list.   

Function Documentation

◆ dump_regset()

void dump_regset ( regset r,
FILE * outf )
extern
In df-core.cc (which should use regset consistently instead of bitmap...)   
Write information about registers and basic blocks into FILE.
This is part of making a debugging dump.   

References EXECUTE_IF_SET_IN_REG_SET, ggc_alloc(), i, NULL, r, and reg_names.

Referenced by debug_regset(), and dump_candidates_and_remat_bb_data().

◆ reg_set_to_hard_reg_set()

void reg_set_to_hard_reg_set ( HARD_REG_SET * to,
const_bitmap from )
extern
Copy the hard registers in a register set to the hard register set.   
Given a register bitmap, turn on the bits in a HARD_REG_SET that
correspond to the hard registers, if any, set in that map.  This
could be done far more efficiently by having all sorts of special-cases
with moving single words, but probably isn't worth the trouble.   

References EXECUTE_IF_SET_IN_BITMAP, ggc_alloc(), i, and SET_HARD_REG_BIT.

Variable Documentation

◆ reg_obstack