GCC Middle and Back End API Reference
hwint.h File Reference

Go to the source code of this file.

Macros

#define HOST_BITS_PER_CHAR   CHAR_BIT
#define HOST_BITS_PER_SHORT   (CHAR_BIT * SIZEOF_SHORT)
#define HOST_BITS_PER_INT   (CHAR_BIT * SIZEOF_INT)
#define HOST_BITS_PER_LONG   (CHAR_BIT * SIZEOF_LONG)
#define HOST_LONG_FORMAT   "l"
#define HOST_LONG_LONG_FORMAT   "ll"
#define HOST_BITS_PER_WIDE_INT   HOST_BITS_PER_LONG
#define HOST_WIDE_INT   long
#define HOST_WIDE_INT_C(X)   X ## L
#define HOST_BITS_PER_HALF_WIDE_INT   (HOST_BITS_PER_WIDE_INT / 2)
#define HOST_HALF_WIDE_INT   long
#define HOST_HALF_WIDE_INT_PRINT   HOST_LONG_FORMAT
#define HOST_HALF_WIDE_INT_PRINT_C   "L"
#define HOST_HALF_WIDE_INT_PRINT_DEC   "%" HOST_HALF_WIDE_INT_PRINT "d"
#define HOST_HALF_WIDE_INT_PRINT_DEC_C   HOST_HALF_WIDE_INT_PRINT_DEC HOST_HALF_WIDE_INT_PRINT_C
#define HOST_HALF_WIDE_INT_PRINT_UNSIGNED   "%" HOST_HALF_WIDE_INT_PRINT "u"
#define HOST_HALF_WIDE_INT_PRINT_HEX   "%#" HOST_HALF_WIDE_INT_PRINT "x"
#define HOST_HALF_WIDE_INT_PRINT_HEX_PURE   "%" HOST_HALF_WIDE_INT_PRINT "x"
#define HOST_WIDE_INT_UC(X)   HOST_WIDE_INT_C (X ## U)
#define HOST_WIDE_INT_1   HOST_WIDE_INT_C (1)
#define HOST_WIDE_INT_1U   HOST_WIDE_INT_UC (1)
#define HOST_WIDE_INT_M1   HOST_WIDE_INT_C (-1)
#define HOST_WIDE_INT_M1U   HOST_WIDE_INT_UC (-1)
#define HOST_WIDE_INT_PRINT   HOST_LONG_FORMAT
#define HOST_WIDE_INT_PRINT_C   "L"
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX   "0x%" HOST_LONG_FORMAT "x%08" HOST_LONG_FORMAT "x"
#define HOST_WIDE_INT_PRINT_PADDED_HEX   "%08" HOST_LONG_FORMAT "x"
#define HOST_WIDE_INT_PRINT_DEC   "%" HOST_WIDE_INT_PRINT "d"
#define HOST_WIDE_INT_PRINT_DEC_C   HOST_WIDE_INT_PRINT_DEC HOST_WIDE_INT_PRINT_C
#define HOST_WIDE_INT_PRINT_UNSIGNED   "%" HOST_WIDE_INT_PRINT "u"
#define HOST_WIDE_INT_PRINT_HEX   "%#" HOST_WIDE_INT_PRINT "x"
#define HOST_WIDE_INT_PRINT_HEX_PURE   "%" HOST_WIDE_INT_PRINT "x"
#define HOST_WIDEST_INT   HOST_WIDE_INT
#define HOST_BITS_PER_WIDEST_INT   HOST_BITS_PER_WIDE_INT
#define HOST_WIDEST_INT_PRINT   HOST_WIDE_INT_PRINT
#define HOST_WIDEST_INT_PRINT_DEC   HOST_WIDE_INT_PRINT_DEC
#define HOST_WIDEST_INT_PRINT_DEC_C   HOST_WIDE_INT_PRINT_DEC_C
#define HOST_WIDEST_INT_PRINT_UNSIGNED   HOST_WIDE_INT_PRINT_UNSIGNED
#define HOST_WIDEST_INT_PRINT_HEX   HOST_WIDE_INT_PRINT_HEX
#define HOST_WIDEST_INT_PRINT_DOUBLE_HEX   HOST_WIDE_INT_PRINT_DOUBLE_HEX
#define HOST_WIDEST_INT_C(X)   HOST_WIDE_INT (X)
#define HOST_WIDEST_FAST_INT   long
#define HOST_BITS_PER_WIDEST_FAST_INT   HOST_BITS_PER_LONG
#define HOST_WIDE_INT_MIN
#define HOST_WIDE_INT_MAX   (~(HOST_WIDE_INT_MIN))

Typedefs

typedef HOST_WIDE_INT __gcc_host_wide_int__

Functions

int clz_hwi (unsigned HOST_WIDE_INT x)
int ctz_hwi (unsigned HOST_WIDE_INT x)
int ffs_hwi (unsigned HOST_WIDE_INT x)
int popcount_hwi (unsigned HOST_WIDE_INT x)
int exact_log2 (unsigned HOST_WIDE_INT)
int floor_log2 (unsigned HOST_WIDE_INT)
int ceil_log2 (unsigned HOST_WIDE_INT)
HOST_WIDE_INT abs_hwi (HOST_WIDE_INT)
unsigned HOST_WIDE_INT absu_hwi (HOST_WIDE_INT)
HOST_WIDE_INT gcd (HOST_WIDE_INT, HOST_WIDE_INT)
HOST_WIDE_INT pos_mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT)
HOST_WIDE_INT mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT)
HOST_WIDE_INT least_common_multiple (HOST_WIDE_INT, HOST_WIDE_INT)
static HOST_WIDE_INT sext_hwi ()
static unsigned HOST_WIDE_INT zext_hwi ()

Macro Definition Documentation

#define HOST_BITS_PER_CHAR   CHAR_BIT
   HOST_WIDE_INT definitions for the GNU compiler.
   Copyright (C) 1998-2013 Free Software Foundation, Inc.

   This file is part of GCC.

   Provide definitions for macros which depend on HOST_BITS_PER_INT
   and HOST_BITS_PER_LONG.  
   This describes the machine the compiler is hosted on.  
#define HOST_BITS_PER_HALF_WIDE_INT   (HOST_BITS_PER_WIDE_INT / 2)
   Print support for half a host wide int.  
#define HOST_BITS_PER_INT   (CHAR_BIT * SIZEOF_INT)
#define HOST_BITS_PER_SHORT   (CHAR_BIT * SIZEOF_SHORT)
#define HOST_BITS_PER_WIDE_INT   HOST_BITS_PER_LONG
   If HAVE_LONG_LONG and SIZEOF_LONG_LONG aren't defined, but
   GCC_VERSION >= 3000, assume this is the second or later stage of a
   bootstrap, we do have long long, and it's 64 bits.  (This is
   required by C99; we do have some ports that violate that assumption
   but they're all cross-compile-only.)  Just in case, force a
   constraint violation if that assumption is incorrect.  
   Set HOST_WIDE_INT.  This should be the widest efficient host
   integer type.  It can be 32 or 64 bits, except that if we are
   targeting a machine with 64-bit size_t then it has to be 64 bits.

   With a sane ABI, 'long' is the largest efficient host integer type.
   Thus, we use that unless we have to use 'long long' or '__int64'
   because we're targeting a 64-bit machine from a 32-bit host.  

Referenced by add_bit_offset_attribute(), bp_unpack_var_len_int(), build_vector_type_for_mode(), ctz_hwi(), find_afterward(), find_shift_sequence(), fold_builtin_cbrt(), double_int::from_buffer(), gcov_time(), int_const_binop_1(), lshift_double(), make_extraction(), double_int::max_value(), double_int::min_value(), double_int::multiple_of(), output_constant(), real_can_shorten_arithmetic(), rtx_to_double_int(), simplify_const_unary_operation(), simplify_relational_operation_1(), simplify_set(), stabstr_O(), streamer_read_hwi(), double_int::udiv(), and double_int::umod().

#define HOST_BITS_PER_WIDEST_FAST_INT   HOST_BITS_PER_LONG
#define HOST_BITS_PER_WIDEST_INT   HOST_BITS_PER_WIDE_INT
#define HOST_HALF_WIDE_INT   long
#define HOST_HALF_WIDE_INT_PRINT   HOST_LONG_FORMAT
#define HOST_HALF_WIDE_INT_PRINT_C   "L"
#define HOST_HALF_WIDE_INT_PRINT_DEC   "%" HOST_HALF_WIDE_INT_PRINT "d"
#define HOST_HALF_WIDE_INT_PRINT_DEC_C   HOST_HALF_WIDE_INT_PRINT_DEC HOST_HALF_WIDE_INT_PRINT_C
#define HOST_HALF_WIDE_INT_PRINT_HEX   "%#" HOST_HALF_WIDE_INT_PRINT "x"
#define HOST_HALF_WIDE_INT_PRINT_HEX_PURE   "%" HOST_HALF_WIDE_INT_PRINT "x"
#define HOST_HALF_WIDE_INT_PRINT_UNSIGNED   "%" HOST_HALF_WIDE_INT_PRINT "u"
#define HOST_LONG_FORMAT   "l"
   The string that should be inserted into a printf style format to
   indicate a "long" operand.  
#define HOST_LONG_LONG_FORMAT   "ll"
   The string that should be inserted into a printf style format to
   indicate a "long long" operand.  
#define HOST_WIDE_INT   long

Referenced by abs_hwi(), add_scope_conflicts(), add_subscript_strides(), anti_adjust_stack_and_probe(), asan_clear_shadow(), attr_hash_add_string(), bit_value_unop_1(), bp_pack_int_in_range(), bp_unpack_var_len_int(), called_as_built_in(), can_reassociate_p(), cfi_label_required_p(), change_cfi_row(), check_argument_store(), check_code_iterator(), compute_antic(), constant_pointer_difference(), convert_modes(), create_trace_edges(), default_asm_output_anchor(), delegitimize_mem_from_attrs(), determine_common_wider_type(), determine_use_iv_cost_address(), do_sd_constraint(), dse_step3(), dw2_asm_output_data_sleb128_raw(), dw2_asm_output_data_uleb128_raw(), dwarf2out_frame_debug_cfa_window_save(), dwarf2out_imported_module_or_decl_1(), oecount_hasher::equal(), expand_builtin_dwarf_sp_column(), expand_float(), expand_mult_highpart_adjust(), expand_stack_vars(), expand_switch_using_bit_tests_p(), find_afterward(), find_call_stack_args(), find_shift_sequence(), fold_builtin_cbrt(), double_int::from_buffer(), gcov_time(), generate_subtree_copies(), get_addr_base_and_unit_offset_1(), get_ancestor_addr_info(), get_loop_location(), get_or_alloc_constant_value_id(), get_or_create_ssa_default_def(), get_pointer_alignment(), get_ssa_def_if_simple_copy(), gimplify_init_ctor_eval(), initialize_iterators(), initialize_matrix_A(), inline_forbidden_p_stmt(), input_phi(), insert_regs(), instrument_builtin_call(), int_cst_hash_eq(), ipa_get_param_count(), ipa_load_from_parm_agg(), ipa_prop_write_all_agg_replacement(), ipa_set_ancestor_jf(), is_miss_rate_acceptable(), lambda_matrix_row_exchange(), lambda_vector_equal(), lookup_vi_for_tree(), lto_init_eh(), make_extraction(), make_fancy_name(), mark_nonreg_stores_2(), double_int::min_value(), move2add_use_add3_insn(), neg_const_int(), new_scalar_tmp_constraint_exp(), noce_emit_store_flag(), double_int::operator&=(), option_flag_var(), parm_ref_data_preserved_p(), powi_lookup_cost(), print_value(), push_block(), real_can_shorten_arithmetic(), recalculate_side_effects(), reconstruct_complex_type(), reg_saved_in(), release_mem_refs(), remap_edge_change_prob(), remove_invalid_refs(), remove_reg_equal_offset_note(), restore_operands(), reversed_condition(), same_type_for_tbaa(), set_mem_align(), shared_hash_find(), simplify_const_binary_operation(), simplify_const_unary_operation(), simplify_relational_operation_1(), stabstr_O(), stmt_overflow_infinity(), store_bit_field(), streamer_read_hwi(), streamer_read_hwi_in_range(), streamer_write_hwi_in_range(), strinfo_shared(), swap_commutative_operands_with_target(), type_like_member_ptr_p(), double_int::udiv(), double_int::umod(), undo_commit(), union_stack_vars(), unloop_loops(), vect_compute_data_ref_alignment(), vect_do_peeling_for_loop_bound(), vect_find_same_alignment_drs(), vect_permute_store_chain(), vn_reference_compute_hash(), and vn_reference_lookup_1().

#define HOST_WIDE_INT_1   HOST_WIDE_INT_C (1)
#define HOST_WIDE_INT_1U   HOST_WIDE_INT_UC (1)
#define HOST_WIDE_INT_C (   X)    X ## L
#define HOST_WIDE_INT_M1   HOST_WIDE_INT_C (-1)
#define HOST_WIDE_INT_M1U   HOST_WIDE_INT_UC (-1)
#define HOST_WIDE_INT_MAX   (~(HOST_WIDE_INT_MIN))
#define HOST_WIDE_INT_MIN
#define HOST_WIDE_INT_PRINT   HOST_LONG_FORMAT
   Various printf format strings for HOST_WIDE_INT.  
#define HOST_WIDE_INT_PRINT_C   "L"
#define HOST_WIDE_INT_PRINT_DEC_C   HOST_WIDE_INT_PRINT_DEC HOST_WIDE_INT_PRINT_C

Referenced by find_afterward().

#define HOST_WIDE_INT_PRINT_DOUBLE_HEX   "0x%" HOST_LONG_FORMAT "x%08" HOST_LONG_FORMAT "x"
     'long' might be 32 or 64 bits, and the number of leading zeroes
     must be tweaked accordingly.  
#define HOST_WIDE_INT_PRINT_HEX   "%#" HOST_WIDE_INT_PRINT "x"

Referenced by print_value(), and unmark_dies().

#define HOST_WIDE_INT_PRINT_HEX_PURE   "%" HOST_WIDE_INT_PRINT "x"
#define HOST_WIDE_INT_PRINT_PADDED_HEX   "%08" HOST_LONG_FORMAT "x"
#define HOST_WIDE_INT_PRINT_UNSIGNED   "%" HOST_WIDE_INT_PRINT "u"
#define HOST_WIDE_INT_UC (   X)    HOST_WIDE_INT_C (X ## U)
#define HOST_WIDEST_FAST_INT   long
   Define HOST_WIDEST_FAST_INT to the widest integer type supported
   efficiently in hardware.  (That is, the widest integer type that fits
   in a hardware register.)  Normally this is "long" but on some hosts it
   should be "long long" or "__int64".  This is no convenient way to
   autodetect this, so such systems must set a flag in config.host; see there
   for details.  
#define HOST_WIDEST_INT   HOST_WIDE_INT
   Set HOST_WIDEST_INT.  This is a 64-bit type unless the compiler
   in use has no 64-bit type at all; in that case it's 32 bits.  

Referenced by build_conflict_bit_table(), get_working_sets(), and streamer_read_tree_bitfields().

#define HOST_WIDEST_INT_C (   X)    HOST_WIDE_INT (X)
#define HOST_WIDEST_INT_PRINT   HOST_WIDE_INT_PRINT
#define HOST_WIDEST_INT_PRINT_DEC_C   HOST_WIDE_INT_PRINT_DEC_C
#define HOST_WIDEST_INT_PRINT_DOUBLE_HEX   HOST_WIDE_INT_PRINT_DOUBLE_HEX
#define HOST_WIDEST_INT_PRINT_HEX   HOST_WIDE_INT_PRINT_HEX
#define HOST_WIDEST_INT_PRINT_UNSIGNED   HOST_WIDE_INT_PRINT_UNSIGNED

Typedef Documentation

   This is a magic identifier which allows GCC to figure out the type
   of HOST_WIDE_INT for %wd specifier checks.  You must issue this
   typedef before using the __asm_fprintf__ format attribute.  

Function Documentation

unsigned HOST_WIDE_INT absu_hwi ( HOST_WIDE_INT  )
int ceil_log2 ( unsigned  HOST_WIDE_INT)
   Return the smallest n such that 2**n >= X.  
int clz_hwi ( unsigned HOST_WIDE_INT  x)
   Inline functions operating on HOST_WIDE_INT.  
int ctz_hwi ( unsigned HOST_WIDE_INT  x)
int exact_log2 ( unsigned  HOST_WIDE_INT)
   Return log2, or -1 if not exact.  
int ffs_hwi ( unsigned HOST_WIDE_INT  x)
int floor_log2 ( unsigned  HOST_WIDE_INT)
   Return floor of log2, with -1 for zero.  
HOST_WIDE_INT least_common_multiple ( HOST_WIDE_INT  ,
HOST_WIDE_INT   
)
int popcount_hwi ( unsigned HOST_WIDE_INT  x)
   Return the number of set bits in X.  
HOST_WIDE_INT pos_mul_hwi ( HOST_WIDE_INT  ,
HOST_WIDE_INT   
)
static HOST_WIDE_INT sext_hwi ( )
inlinestatic
   Sign extend SRC starting from PREC.  
static unsigned HOST_WIDE_INT zext_hwi ( )
inlinestatic
   Zero extend SRC starting from PREC.