GCC Middle and Back End API Reference
hard-reg-set.h File Reference
#include "array-traits.h"
Include dependency graph for hard-reg-set.h:
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  simplifiable_subregs_hasher
 
struct  target_hard_regs
 

Macros

#define HARD_CONST(X)
 
#define UHOST_BITS_PER_WIDE_INT   ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
 
#define SET_HARD_REG_BIT(SET, BIT)
 
#define CLEAR_HARD_REG_BIT(SET, BIT)
 
#define TEST_HARD_REG_BIT(SET, BIT)
 
#define CLEAR_HARD_REG_SET(TO)
 
#define SET_HARD_REG_SET(TO)
 
#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 fixed_nonglobal_reg_set    (this_target_hard_regs->x_fixed_nonglobal_reg_set)
 
#define savable_regs    (this_target_hard_regs->x_savable_regs)
 
#define eh_return_data_regs    (this_target_hard_regs->x_eh_return_data_regs)
 
#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_CAN_CHANGE_MODE_P(REGN, FROM, TO)
 

Typedefs

typedef unsigned HOST_WIDEST_FAST_INT HARD_REG_ELT_TYPE
 
typedef HARD_REG_ELT_TYPE HARD_REG_SET
 
typedef const HARD_REG_SET const_hard_reg_set
 

Functions

bool hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
 
bool hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
 
bool hard_reg_set_empty_p (const_hard_reg_set x)
 
void hard_reg_set_iter_init (hard_reg_set_iterator *iter, const_hard_reg_set set, unsigned min, unsigned *regno)
 
bool hard_reg_set_iter_set (hard_reg_set_iterator *iter, unsigned *regno)
 
void hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno)
 

Variables

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

Macro Definition Documentation

◆ accessible_reg_set

◆ class_only_fixed_regs

#define class_only_fixed_regs    (this_target_hard_regs->x_class_only_fixed_regs)

Referenced by find_reloads(), and init_reg_sets_1().

◆ CLEAR_HARD_REG_BIT

◆ CLEAR_HARD_REG_SET

#define CLEAR_HARD_REG_SET ( TO)
Value:
((TO) = HARD_CONST (0))

Referenced by add_allocno_hard_regs_to_forest(), asm_clobber_reg_is_valid(), assign_parm_setup_reg(), call_clobbers_in_region(), function_abi_aggregator::caller_save_regs(), choose_reload_regs_init(), clarify_prohibited_class_mode_regs(), debug_value_data(), default_zero_call_used_regs(), df_get_call_refs(), df_hard_reg_init(), do_remat(), emit_reload_insns(), expand_asm_loc(), expand_asm_stmt(), fast_allocation(), find_all_hard_reg_sets(), find_first_parameter_load(), find_hard_regno_for(), find_reg(), find_reload_regs(), form_allocno_hard_regs_nodes_forest(), gen_call_used_regs_seq(), inherit_in_ebb(), init_reg_info(), init_reg_sets(), init_reg_sets_1(), init_rename_info(), init_resource_info(), initialize_lra_reg_info_element(), ira_build_conflicts(), ira_create_allocno(), ira_implicitly_set_insn_hard_regs(), ira_init_register_move_cost(), ira_setup_eliminable_regset(), lra_create_live_ranges_1(), lra_fp_pseudo_p(), lra_update_fp2sp_elimination(), mark_target_live_regs(), match_reload(), maybe_fix_stack_asms(), new_basic_block(), old_insns_match_p(), prepare_shrink_wrap(), process_alt_operands(), process_bb_lives(), reginfo_cc_finalize(), reload(), reload_as_needed(), reload_combine(), reload_cse_simplify_operands(), rename_chains(), requires_stack_frame_p(), save_call_clobbered_regs(), scan_loop(), setup_class_hard_regs(), setup_pressure_classes(), setup_profitable_hard_regs(), setup_prohibited_and_exclude_class_mode_regs(), setup_reg_mode_hard_regset(), setup_save_areas(), setup_stack_reg_pressure_class(), simplifiable_subreg::simplifiable_subreg(), try_combine(), try_shrink_wrapping(), update_eliminables_and_spill(), update_reg_eliminate(), and validate_value_data().

◆ eh_return_data_regs

#define eh_return_data_regs    (this_target_hard_regs->x_eh_return_data_regs)

◆ EXECUTE_IF_SET_IN_HARD_REG_SET

#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)))
void hard_reg_set_iter_init(hard_reg_set_iterator *iter, const_hard_reg_set set, unsigned min, unsigned *regno)
Definition hard-reg-set.h:283
#define MIN(X, Y)
Definition system.h:396

Referenced by compute_hash_table_work(), dataflow_set_clear_at_call(), invalidate_for_call(), record_dead_and_set_regs(), and record_opr_changes().

◆ fixed_nonglobal_reg_set

#define fixed_nonglobal_reg_set    (this_target_hard_regs->x_fixed_nonglobal_reg_set)

◆ fixed_reg_set

◆ fixed_regs

◆ HARD_CONST

#define HARD_CONST ( X)
Value:
unsigned HOST_WIDEST_FAST_INT HARD_REG_ELT_TYPE
Definition hard-reg-set.h:43
HARD_CONST is used to cast a constant to the appropriate type
for use with a HARD_REG_SET.   

Referenced by hard_reg_set_empty_p(), hard_reg_set_intersect_p(), and hard_reg_set_subset_p().

◆ HARD_REG_ELT_BITS

#define HARD_REG_ELT_BITS   UHOST_BITS_PER_WIDE_INT

◆ inv_reg_alloc_order

#define inv_reg_alloc_order    (this_target_hard_regs->x_inv_reg_alloc_order)

◆ operand_reg_set

◆ reg_alloc_order

#define reg_alloc_order    (this_target_hard_regs->x_reg_alloc_order)

◆ REG_CAN_CHANGE_MODE_P

#define REG_CAN_CHANGE_MODE_P ( REGN,
FROM,
TO )
Value:
(targetm.can_change_mode_class (FROM, TO, REGNO_REG_CLASS (REGN)))
struct gcc_target targetm
Given a hard REGN a FROM mode and a TO mode, return true if
REGN can change from mode FROM to mode TO.   

Referenced by insn_propagation::apply_to_rvalue_1(), choose_reload_regs(), copy_value(), find_oldest_value_reg(), general_operand(), inherit_piecemeal_p(), mode_change_ok(), move2add_valid_value_p(), push_reload(), reload_cse_simplify_operands(), reload_cse_simplify_set(), set_noop_p(), simplify_set(), simplify_subreg_regno(), and validate_subreg().

◆ reg_class_contents

#define reg_class_contents    (this_target_hard_regs->x_reg_class_contents)

Referenced by allocate_reload_reg(), assign_hard_reg(), calculate_allocation_cost(), choose_reload_regs(), choose_split_class(), combine_reloads(), curr_insn_transform(), detach_value(), enough_allocatable_hard_regs_p(), fast_allocation(), find_costs_and_classes(), find_dummy_reload(), find_equiv_reg(), find_hard_regno_for(), find_hard_regno_for_1(), find_oldest_value_reg(), find_reloads(), find_rename_reg(), find_reusable_reload(), find_valid_class(), find_valid_class_1(), gen_call_used_regs_seq(), get_conflict_and_start_profitable_regs(), in_class_p(), inherit_in_ebb(), init_caller_save(), init_reg_sets(), init_reg_sets_1(), init_set_costs(), ira_bad_reload_regno_1(), ira_build_conflicts(), ira_init_register_move_cost(), maybe_fix_stack_asms(), peep2_find_free_register(), print_allocno_conflicts(), process_alt_operands(), process_bb_node_for_hard_reg_moves(), process_single_reg_class_operands(), prohibited_class_reg_set_mode_p(), push_reload(), record_operand_costs(), reg_class_subset_p(), reg_classes_intersect_p(), reg_fits_class_p(), reload_adjust_reg_for_temp(), reload_combine(), reload_combine_recognize_pattern(), restrict_cost_classes(), setup_allocno_and_important_classes(), setup_allocno_assignment_flags(), setup_allocno_class_and_costs(), setup_class_hard_regs(), setup_class_subset_and_memory_move_costs(), setup_class_translate_array(), setup_live_pseudos_and_spill_after_risky_transforms(), setup_pressure_classes(), setup_prohibited_and_exclude_class_mode_regs(), setup_reg_class_relations(), setup_reg_subclasses(), setup_regno_cost_classes_by_aclass(), setup_regno_cost_classes_by_mode(), setup_stack_reg_pressure_class(), setup_try_hard_regno_pseudos(), simplify_operand_subreg(), update_and_check_small_class_inputs(), and update_costs_from_allocno().

◆ reg_class_size

◆ reg_class_subclasses

◆ reg_class_subunion

◆ reg_class_superunion

#define reg_class_superunion    (this_target_hard_regs->x_reg_class_superunion)

◆ reg_names

◆ savable_regs

#define savable_regs    (this_target_hard_regs->x_savable_regs)

◆ SET_HARD_REG_BIT

#define SET_HARD_REG_BIT ( SET,
BIT )
Value:
((SET) |= HARD_CONST (1) << (BIT))

Referenced by predefined_function_abi::add_full_reg_clobber(), add_range_to_hard_reg_set(), add_to_hard_reg_set(), assign_hard_reg(), choose_reload_regs(), clarify_prohibited_class_mode_regs(), collect_fn_hard_reg_usage(), create_new_chain(), debug_value_data(), default_zero_call_used_regs(), df_find_hard_reg_defs_1(), df_hard_reg_init(), do_remat(), emit_output_reload_insns(), emit_reload_insns(), expand_asm_stmt(), fill_slots_from_thread(), find_first_parameter_load(), find_hard_regno_for_1(), find_reg(), finish_spills(), form_allocno_hard_regs_nodes_forest(), gen_call_used_regs_seq(), globalize_reg(), improve_allocation(), inherit_in_ebb(), init_reg_sets(), init_reg_sets_1(), init_rename_info(), init_resource_info(), predefined_function_abi::initialize(), insert_save(), ira_build_conflicts(), ira_init_register_move_cost(), ira_setup_eliminable_regset(), make_hard_regno_dead(), make_hard_regno_dead(), make_hard_regno_live(), make_hard_regno_live(), mark_referenced_resources(), mark_set_regs(), mark_set_resources(), mark_target_live_regs(), match_reload(), maybe_fix_stack_asms(), merge_overlapping_regs(), old_insns_match_p(), peep2_find_free_register(), prepare_shrink_wrap(), process_bb_lives(), reg_set_to_hard_reg_set(), reload(), reload_as_needed(), reload_cse_simplify_operands(), save_call_clobbered_regs(), scan_rtx_reg(), setup_class_hard_regs(), setup_pressure_classes(), setup_prohibited_and_exclude_class_mode_regs(), setup_reg_mode_hard_regset(), setup_save_areas(), setup_stack_reg_pressure_class(), simplifiable_subregs(), spill_hard_reg(), spill_hard_reg_in_range(), update_eliminables(), update_live_status(), and validate_value_data().

◆ SET_HARD_REG_SET

◆ TEST_HARD_REG_BIT

#define TEST_HARD_REG_BIT ( SET,
BIT )
Value:
(!!((SET) & (HARD_CONST (1) << (BIT))))

Referenced by allocate_reload_reg(), assign_hard_reg(), assign_parm_setup_reg(), assign_spill_hard_regs(), build_insn_chain(), cant_combine_insn_p(), change_loop(), check_hard_reg_p(), check_new_reg_p(), choose_reload_regs(), choose_split_class(), clarify_prohibited_class_mode_regs(), function_abi::clobbers_at_least_part_of_reg_p(), predefined_function_abi::clobbers_at_least_part_of_reg_p(), function_abi::clobbers_full_reg_p(), predefined_function_abi::clobbers_full_reg_p(), combine_reloads(), constrain_operands(), debug_value_data(), default_zero_call_used_regs(), detach_value(), df_epilogue_uses_p(), df_get_call_refs(), df_ref_create_structure(), do_input_reload(), do_output_reload(), do_remat(), enough_allocatable_hard_regs_p(), expand_asm_reg_clobber_mem_blockage(), fast_allocation(), fill_simple_delay_slots(), fill_slots_from_thread(), find_dummy_reload(), find_hard_regno_for_1(), find_reg(), find_reloads(), find_rename_reg(), find_reusable_reload(), find_valid_class(), finish_spills(), forget_marked_reloads(), forget_old_reloads_1(), form_allocno_hard_regs_nodes_forest(), gen_call_used_regs_seq(), get_regno_pressure_class(), get_regno_pressure_class(), hard_reg_set_size(), in_class_p(), in_hard_reg_set_p(), init_caller_save(), init_reg_sets_1(), init_rename_info(), init_set_costs(), insert_restore(), insert_save(), invalidate_for_call(), invalidate_reg(), invariant_p(), ira_bad_reload_regno_1(), ira_hard_reg_in_set_p(), ira_hard_reg_set_intersection_p(), ira_propagate_hard_reg_costs(), ira_setup_eliminable_regset(), lra_create_live_ranges_1(), lra_eliminate_reg_if_possible(), make_hard_regno_dead(), make_hard_regno_live(), make_more_copies(), make_object_dead(), mark_hard_reg_dead(), mark_hard_reg_live(), maybe_fix_stack_asms(), move_spill_restore(), need_for_split_p(), overlaps_hard_reg_set_p(), parms_set(), peep2_find_free_register(), print_hard_reg_set(), print_hard_reg_set(), process_alt_operands(), process_bb_lives(), process_bb_node_for_hard_reg_moves(), process_bb_node_lives(), push_reload(), range_in_hard_reg_set_p(), range_overlaps_hard_reg_set_p(), record_operand_costs(), reg_dead_at_p(), reload_adjust_reg_for_temp(), reload_as_needed(), reload_combine(), reload_combine_recognize_pattern(), reload_cse_simplify_operands(), reload_reg_free_for_value_p(), reload_reg_free_p(), reload_reg_reaches_end_p(), replace_reg_with_saved_mem(), requires_stack_frame_p(), save_call_clobbered_regs(), setup_allocno_available_regs_num(), setup_allocno_class_and_costs(), setup_class_hard_regs(), setup_hard_regno_aclass(), setup_left_conflict_sizes_p(), setup_live_pseudos_and_spill_after_risky_transforms(), setup_profitable_hard_regs(), setup_save_areas(), spill_hard_reg_in_range(), spill_pseudos(), update_costs_from_allocno(), update_eliminables_and_spill(), update_equiv_regs_prescan(), validate_value_data(), verify_reg_in_set(), and zcur_select_mode_rtx().

◆ this_target_hard_regs

#define this_target_hard_regs   (&default_target_hard_regs)

Referenced by simplifiable_subregs().

◆ UHOST_BITS_PER_WIDE_INT

#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:

hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
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

◆ const_hard_reg_set

◆ HARD_REG_ELT_TYPE

Sets (bit vectors) of hard registers, and operations on them.
   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/>.   
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.   

◆ HARD_REG_SET

Function Documentation

◆ hard_reg_set_empty_p()

◆ hard_reg_set_intersect_p()

◆ hard_reg_set_iter_init()

void hard_reg_set_iter_init ( hard_reg_set_iterator * iter,
const_hard_reg_set set,
unsigned min,
unsigned * regno )
inline
The implementation of the iterator functions is fully analogous to
the bitmap iterators.   

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

◆ hard_reg_set_iter_next()

void hard_reg_set_iter_next ( hard_reg_set_iterator * iter,
unsigned * regno )
inline

◆ hard_reg_set_iter_set()

◆ hard_reg_set_subset_p()

Variable Documentation

◆ default_target_hard_regs

struct target_hard_regs default_target_hard_regs
extern

◆ global_reg_set

HARD_REG_SET global_reg_set
extern

◆ global_regs

char global_regs[FIRST_PSEUDO_REGISTER]
extern
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 can_combine_p(), can_move_insns_across(), check_new_reg_p(), clear_global_regs_cache(), copy_value(), deletable_insn_p(), df_get_call_refs(), df_get_entry_block_def_set(), df_get_exit_block_use_set(), df_lr_local_compute(), distribute_notes(), do_reload(), ext_dce_process_bb(), get_defs(), globalize_reg(), hash_rtx(), init_reg_sets_1(), init_resource_info(), ira_setup_eliminable_regset(), mark_referenced_resources(), mark_target_live_regs(), peep2_find_free_register(), reload_combine_recognize_pattern(), rename_chains(), simplify_context::simplify_plus_minus(), and rtx_properties::try_to_add_insn().

◆ reg_class_names