GCC Middle and Back End API Reference
|
Go to the source code of this file.
Typedefs | |
typedef HOST_WIDE_INT | __gcc_host_wide_int__ |
Functions | |
unsigned HOST_WIDE_INT | least_bit_hwi (unsigned HOST_WIDE_INT x) |
bool | pow2_or_zerop (unsigned HOST_WIDE_INT x) |
bool | pow2p_hwi (unsigned HOST_WIDE_INT x) |
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) |
unsigned HOST_WIDE_INT | reflect_hwi (unsigned HOST_WIDE_INT, unsigned) |
int | ctz_or_zero (unsigned HOST_WIDE_INT x) |
HOST_WIDE_INT | sext_hwi (HOST_WIDE_INT src, unsigned int prec) |
unsigned HOST_WIDE_INT | zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec) |
HOST_WIDE_INT | add_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow) |
HOST_WIDE_INT | mul_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow) |
HOST_WIDE_INT | add_sat_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b) |
HOST_WIDE_INT | mul_sat_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b) |
#define fmt_size_t unsigned int |
Referenced by alloc_page(), build_conflict_bit_table(), ipa_icf::sem_item_optimizer::dump_cong_classes(), dump_dfa_stats(), dump_hash_table(), ggc_free(), ggc_internal_alloc(), htab_statistics(), htab_statistics(), print_debug_expr_statistics(), print_value_expr_statistics(), ipa_icf::sem_item_optimizer::process_cong_reduction(), write_insn_constraint_len(), and write_lookup_constraint_1().
#define GCC_PRI64 HOST_LONG_LONG_FORMAT |
Provide C99 <inttypes.h> style format definitions for 64bits.
#define GCC_PRISZ "" |
Similarly format modifier for printing size_t. As not all hosts support z modifier in printf, use GCC_PRISZ and cast argument to fmt_size_t. So, instead of doing fprintf ("%zu\n", sizeof (x) * y); use fprintf (HOST_SIZE_T_PRINT_UNSIGNED "\n", (fmt_size_t) (sizeof (x) * y));
#define HOST_BITS_PER_CHAR CHAR_BIT |
HOST_WIDE_INT definitions for the GNU compiler. Copyright (C) 1998-2024 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.
Referenced by attr_checksum(), attr_checksum_ordered(), output_die(), output_loc_operands(), size_of_die(), target_char_cast(), and target_char_cst_p().
#define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT) |
Referenced by choose_mult_variant(), expand_call(), find_costs_and_classes(), get_dynamic_stack_size(), get_int_token(), get_object_alignment_2(), get_pointer_alignment_1(), gimple_add_init_for_auto_var(), init_caller_save(), may_be_unaligned_p(), maybe_set_nonzero_bits(), try_combine(), and warn_uninit().
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG) |
Referenced by alloc_page(), bp_pack_real_value(), bp_unpack_real_value(), clear_marks(), clear_significand_below(), clear_significand_bit(), decode_arm_bfloat_half(), decode_ieee_double(), decode_ieee_extended(), decode_ieee_half(), decode_ieee_quad(), decode_ieee_single(), decode_vax_d(), decode_vax_f(), decode_vax_g(), do_multiply(), encode_arm_bfloat_half(), encode_ieee_double(), encode_ieee_extended(), encode_ieee_half(), encode_ieee_quad(), encode_ieee_single(), encode_vax_d(), encode_vax_f(), encode_vax_g(), ggc_free(), ggc_internal_alloc(), ggc_marked_p(), ggc_pch_read(), ggc_set_mark(), gt_ggc_m_S(), is_even(), is_halfway_below(), lshift_significand(), lshift_significand_1(), normalize(), real_from_integer(), real_from_string(), real_hash(), real_to_hexadecimal(), real_to_integer(), real_to_integer(), round_for_format(), rshift_significand(), set_significand_bit(), split_double(), sticky_rshift_significand(), and test_significand_bit().
#define HOST_BITS_PER_PTR (CHAR_BIT * SIZEOF_VOID_P) |
Referenced by init_ggc().
#define HOST_BITS_PER_SHORT (CHAR_BIT * SIZEOF_SHORT) |
#define HOST_BITS_PER_WIDE_INT 64 |
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 always 64 bits. The underlying type is matched to that of int64_t and assumed to be either long or long long.
Referenced by acceptable_pow_call(), add_const_value_attribute(), add_hwi(), wi::add_large(), tree_switch_conversion::switch_conversion::array_value_type(), wi::arshift_large(), attr_checksum(), attr_checksum_ordered(), wi::bitreverse_large(), bp_unpack_var_len_int(), wi::bswap_large(), build_new_int_cst(), build_replicated_int_cst(), cache_integer_cst(), canonicalize_condition(), canonize(), canonize_uhwi(), carry_backpropagate(), choose_mult_variant(), choose_multiplier(), wi::clrsb(), wi::clz(), clz_hwi(), clz_loc_descriptor(), cmdline_handle_error(), wi::cmps_large(), wi::cmpu_large(), combine_instructions(), compare_debug_dump_opt_spec_function(), wide_int_storage::create(), cse_insn(), wi::ctz(), ctz_hwi(), decode_cmdline_option(), wi::int_traits< rtx_mode_t >::decompose(), wi::int_traits< wi::hwi_with_prec >::decompose(), wi::primitive_int_traits< T, signed_p >::decompose(), divmod_candidate_p(), wi::divmod_internal(), do_fixed_divide(), do_fixed_multiply(), do_fixed_shift(), do_jump(), do_tablejump(), generic_wide_int< storage >::dump(), dw2_asm_output_data(), emit_move_insn_1(), wi::eq_p_large(), wi::exact_log2(), expand_compound_operation(), expand_divmod(), expand_doubleword_mod(), expand_field_assignment(), expand_mult(), expand_vector_divmod(), ext_dce_process_sets(), ext_dce_process_uses(), wi::extract_uhwi(), floor_log2(), fold_rtx(), fold_unary_loc(), force_int_to_mode(), wi::force_to_size(), double_int::from_buffer(), wi::from_buffer(), gcov_type_to_wide_int(), gen_lowpart_common(), get_fixed_sign_bit(), get_full_len(), get_int_cst_ext_nunits(), get_mode_bounds(), get_stored_val(), gimple_divmod_fixed_value_transform(), gimple_fold_builtin_memset(), gimple_stringops_transform(), highest_pow2_factor(), HWI_COMPUTABLE_MODE_P(), HWI_COMPUTABLE_MODE_P(), wi::hwi_with_prec::hwi_with_prec(), immed_double_const(), immed_wide_int_const_1(), implies_p(), insert_wide_int(), int_cst_value(), int_loc_descriptor(), inverse(), invert_mod2n(), iv_number_of_iterations(), lowpart_bitmask(), wi::lrshift_large(), double_int::lshift(), lshift_double(), wi::lshift_large(), wi::lts_p_large(), wi::ltu_p_large(), make_compound_operation_int(), make_extraction(), make_field_assignment(), make_tree(), double_int::mask(), wi::mask(), wi::mask(), maybe_swap_commutative_operands(), mem_loc_descriptor(), mode_signbit_p(), wi::mul_internal(), native_decode_rtx(), native_encode_rtx(), noce_try_bitop(), nonzero_bits1(), num_sign_bit_copies1(), wide_int_storage::operator=(), wide_int_storage::operator=(), output_addr_const(), output_constant(), output_constructor(), output_constructor_bitfield(), output_die(), output_loc_operands(), output_loc_operands_raw(), wi::popcount(), print_dec_buf_size(), print_decs(), print_decu(), print_hex(), print_hex_buf_size(), print_host_wide_int(), rtx_reader::read_rtx_code(), real_from_integer(), real_powi(), real_to_integer(), real_to_integer(), record_store(), rotate_loc_descriptor(), double_int::rshift(), rshift_double(), rshift_large_common(), rt_bb_visited::rt_bb_visited(), scompare_loc_descriptor_narrow(), double_int::set_bit(), wi::set_bit_large(), fixed_wide_int_storage< N >::set_len(), trailing_wide_int_storage::set_len(), wide_int_storage::set_len(), widest_int_storage< N >::set_len(), double_int::sext(), generic_wide_int< storage >::sext_elt(), sext_hwi(), wi::sext_large(), wi::shifted_mask(), wi::shifted_mask(), generic_wide_int< storage >::sign_mask(), simplify_context::simplify_binary_operation_1(), simplify_compare_const(), simplify_comparison(), simplify_const_relational_operation(), simplify_shift_const_1(), simplify_context::simplify_subreg(), simplify_context::simplify_ternary_operation(), simplify_context::simplify_unary_operation_1(), size_of_die(), size_of_int_loc_descriptor(), size_of_loc_descr(), split_double(), store_fixed_bit_field_1(), streamer_read_hwi(), wi::sub_large(), target_char_cast(), ten_to_ptwo(), wi::to_mpz(), generic_wide_int< storage >::to_shwi(), generic_wide_int< storage >::to_uhwi(), top_bit_of(), double_int::trailing_zeros(), trunc_int_for_mode(), uint_loc_descriptor(), val_signbit_known_clear_p(), val_signbit_known_set_p(), val_signbit_p(), value_format(), vect_recog_divmod_pattern(), WI_UNARY_RESULT(), wi_unpack(), wide_int_storage::wide_int_storage(), wide_int_storage::wide_int_storage(), WIDEST_INT(), zext_hwi(), and wi::zext_large().
#define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONG |
Referenced by sbitmap_popcount().
#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_SIZE_T_PRINT_DEC "%" GCC_PRISZ "d" |
#define HOST_SIZE_T_PRINT_HEX "%#" GCC_PRISZ "x" |
#define HOST_SIZE_T_PRINT_HEX_PURE "%" GCC_PRISZ "x" |
#define HOST_SIZE_T_PRINT_UNSIGNED "%" GCC_PRISZ "u" |
#define HOST_WIDE_INT_0 HOST_WIDE_INT_C (0) |
Referenced by div_and_round_double(), and mk_attr_alt().
#define HOST_WIDE_INT_0U HOST_WIDE_INT_UC (0) |
Referenced by any_positions_needed_p(), dump_varinfo(), and set_all_positions_unneeded().
#define HOST_WIDE_INT_1 HOST_WIDE_INT_C (1) |
Referenced by asan_emit_stack_protection(), attr_alt_complement(), can_strub_internally_p(), canonicalize_address_mult(), convert_atomic_bit_not(), cse_insn(), div_and_round_double(), expand_doubleword_divmod(), expand_fix(), expand_smod_pow2(), expand_used_vars(), find_equiv_reg(), fold_rtx(), get_index_scale(), get_stored_val(), init_expmed(), make_compound_operation_int(), wi::mul_internal(), noce_try_bitop(), optimize_atomic_bit_test_and(), double_int::set_bit(), sext_hwi(), simplify_comparison(), and store_split_bit_field().
#define HOST_WIDE_INT_1U HOST_WIDE_INT_UC (1) |
Referenced by add_mask_else_and_len_args(), auto_flag< T >::auto_flag(), wi::bitreverse_large(), bp_unpack_var_len_int(), build_replicated_int_cst(), calculate_crc(), canonicalize_condition(), carry_backpropagate(), check_ctz_array(), check_ctz_string(), choose_mult_variant(), choose_multiplier(), clz_loc_descriptor(), cmdline_handle_error(), combine_simplify_rtx(), compile_file(), convert_mode_scalar(), decode_cmdline_option(), default_memtag_untagged_pointer(), divmod_internal_2(), do_compare_rtx_and_jump(), do_jump(), do_store_flag(), do_tablejump(), doloop_optimize(), emit_block_cmp_via_loop(), emit_block_move_via_oriented_loop(), emit_block_move_via_sized_loop(), expand_builtin_issignaling(), expand_compound_operation(), expand_divmod(), expand_doubleword_mod(), expand_field_assignment(), expand_fn_using_insn(), expand_mult_const(), expand_omp_for(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_vector_divmod(), extract_left_shift(), find_split_point(), floor_log2(), force_int_to_mode(), frame_offset_overflow(), get_mode_bounds(), get_section_anchor(), gf2n_poly_long_div_quotient(), strlen_pass::handle_builtin_memset(), handle_overloaded_gen(), handle_overloaded_gen(), highest_pow2_factor(), hwasan_truncate_to_tag_size(), implies_p(), invert_mod2n(), loc_list_from_tree_1(), make_extraction(), make_field_assignment(), wi::mask(), maybe_swap_commutative_operands(), mode_signbit_p(), noce_try_bitop(), nonzero_bits1(), num_sign_bit_copies1(), optimize_atomic_bit_test_and(), optimize_bitfield_assignment_op(), real_powi(), real_to_integer(), scan_store_can_perm_p(), double_int::set_bit(), wi::set_bit_large(), set_position_unneeded(), sext_hwi(), wi::shifted_mask(), simplify_context::simplify_binary_operation_1(), simplify_compare_const(), simplify_comparison(), simplify_const_relational_operation(), simplify_shift_const_1(), simplify_context::simplify_subreg(), simplify_context::simplify_ternary_operation(), store_constructor(), store_fixed_bit_field_1(), streamer_read_hwi(), synth_mult(), target_char_cast(), wi::to_mpz(), try_store_by_multiple_pieces(), TYPE_VECTOR_SUBPARTS(), val_signbit_known_clear_p(), val_signbit_known_set_p(), val_signbit_p(), vect_recog_divmod_pattern(), vectorizable_scan_store(), and zext_hwi().
#define HOST_WIDE_INT_M1 HOST_WIDE_INT_C (-1) |
Referenced by canonize(), cse_insn(), div_and_round_double(), fold_convert_const_fixed_from_int(), safe_uhwi(), and wide_int_to_tree_1().
#define HOST_WIDE_INT_M1U HOST_WIDE_INT_UC (-1) |
Referenced by attr_access::array_as_string(), atoll(), build_string_literal(), tree_switch_conversion::jump_table_cluster::can_be_handled(), check_va_list_escapes(), cse_insn(), dw2_asm_output_data(), expand_builtin_issignaling(), expand_call(), expand_divmod(), expand_vector_divmod(), fold_unary_loc(), force_int_to_mode(), strlen_pass::get_len_or_size(), get_size_range(), gimple_call_return_array(), gimple_fold_builtin_string_compare(), strlen_pass::handle_builtin_string_cmp(), handle_printf_call(), strlen_pass::handle_store(), init_attr_rdwr_indices(), int_cst_value(), integral_argument(), invert_mod2n(), lowpart_bitmask(), lshift_double(), make_compound_operation_int(), make_extraction(), make_field_assignment(), mem_might_overlap_already_clobbered_arg_p(), nonzero_bits1(), rshift_double(), selector_fits_mode_p(), access_data::set_bound(), simplify_compare_const(), simplify_set(), stack_region_maybe_used_p(), store_fixed_bit_field_1(), strlen_pass::strxcmp_eqz_result(), update_rsp_from_reg_equal(), va_list_counter_bump(), va_list_ptr_read(), and vect_recog_divmod_pattern().
#define HOST_WIDE_INT_MAX (~(HOST_WIDE_INT_MIN)) |
Referenced by add_sat_hwi(), adjusted_warn_limit(), ao_ref_init_from_ptr_and_size(), build_printable_array_type(), check_fnspec(), field_at_offset(), strlen_pass::get_len_or_size(), gimple_fold_builtin_string_compare(), strlen_pass::handle_builtin_string_cmp(), handle_printf_call(), layout_decl(), maybe_invalidate(), maybe_warn_pointless_strcmp(), mul_sat_hwi(), noce_get_alt_condition(), output_stack_usage_1(), pos_mul_hwi(), strlen_pass::strxcmp_eqz_result(), warn_limit_specified_p(), and WI_UNARY_RESULT().
#define HOST_WIDE_INT_MIN |
Referenced by abs_hwi(), add_sat_hwi(), choose_mult_variant(), wi::divmod_internal(), expand_divmod(), find_args_size_adjust(), fixup_args_size_notes(), initialize_matrix_A(), lambda_matrix_right_hermite(), lambda_matrix_row_add(), mul_hwi(), mul_hwi(), mul_sat_hwi(), noce_get_alt_condition(), noce_try_inverse_constants(), and old_insns_match_p().
#define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT |
Various printf format strings for HOST_WIDE_INT.
Referenced by asm_fprintf(), diag_vfprintf(), dump_pointer(), format_phase_2(), and rtx_reader::read_rtx_code().
#define HOST_WIDE_INT_PRINT_C "LL" |
#define HOST_WIDE_INT_PRINT_DEC "%" PRId64 |
Referenced by attempt_builtin_powi(), create_new_ivs(), create_variable_info_for_1(), decide_about_value(), diag_vfprintf(), ipa_polymorphic_call_context::dump(), irange_storage::dump(), tree_switch_conversion::group_cluster::dump(), dump_access(), dump_alias_stats(), dump_attrs_list(), dump_condition(), dump_constraint(), dump_dataflow_set(), dump_hash_table(), dump_integer_part(), dump_mem_details(), dump_pta_stats(), dump_var(), dump_varinfo(), dw2_asm_output_data_sleb128(), estimate_local_effects(), execute_early_expand_coro_ifns(), go_format_type(), go_output_typedef(), ipa_dump_jump_function(), ipa_odr_read_section(), ipa_print_node_jump_functions(), loop_prefetch_arrays(), make_fancy_name_1(), match_rtx(), output_addr_const(), output_asm_insn(), output_cfi_directive(), output_constant_pool_contents(), output_die(), output_stack_usage_1(), print_all_lattices(), print_decs(), print_discr_value(), print_dw_val(), print_lambda_vector(), print_node(), print_poly_int(), rtx_writer::print_rtx(), rtx_writer::print_rtx_operand(), prune_group_by_reuse(), should_issue_prefetch_p(), statistics_fini_1(), statistics_fini_pass_1(), statistics_fini_pass_2(), write_attr_value(), and write_test_expr().
#define HOST_WIDE_INT_PRINT_DEC_C "%" PRId64 HOST_WIDE_INT_PRINT_C |
Referenced by gen_exp(), and print_host_wide_int().
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%" PRIx64 "%016" PRIx64 |
Referenced by output_addr_const(), and pp_double_int().
#define HOST_WIDE_INT_PRINT_HEX "%#" PRIx64 |
Referenced by compare_debug_dump_opt_spec_function(), cwi_output_hex(), diag_vfprintf(), generic_wide_int< storage >::dump(), dw2_asm_output_data_uleb128(), format_phase_2(), generate_crc_table(), get_file_function_name(), output_addr_const(), output_cfi(), output_die(), output_range_list_offset(), print_dw_val(), rtx_writer::print_rtx_operand(), print_value(), and simplify_compare_const().
#define HOST_WIDE_INT_PRINT_HEX_PURE "%" PRIx64 |
Referenced by lto_get_section_name(), and print_hex().
#define HOST_WIDE_INT_PRINT_PADDED_HEX "%016" PRIx64 |
Referenced by cwi_output_hex(), print_dw_val(), and print_hex().
#define HOST_WIDE_INT_PRINT_UNSIGNED "%" PRIu64 |
Referenced by diag_vfprintf(), crc_optimization::dump_crc_information(), format_phase_2(), go_output_typedef(), maybe_invalidate(), print_decs(), print_decu(), print_discr_value(), print_dw_val(), print_lto_report(), print_node(), crc_optimization::satisfies_crc_loop_iteration_count(), self_referential_size(), vect_estimate_min_profitable_iters(), and vect_print_slp_tree().
#define HOST_WIDE_INT_UC | ( | X | ) |
Referenced by carry_backpropagate(), ext_dce_process_sets(), ext_dce_process_uses(), fold_builtin_isascii(), integral_argument(), double_int::mask(), nonzero_bits1(), output_file_names(), print_decu(), widest_int_storage< N >::set_len(), and widest_int_storage< N >::write_val().
#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 PRId64 GCC_PRI64 "d" |
Referenced by adjust_cfg_counts(), asan_emit_stack_protection(), tree_switch_conversion::switch_conversion::build_one_array(), calculate_allocation_cost(), cancel_negative_cycle(), compute_branch_probabilities(), create_fixup_graph(), source_info::debug(), determine_group_iv_costs(), determine_max_iter(), do_reload(), doloop_modify(), cgraph_node::dump(), profile_count::dump(), dump_bb_for_graph(), dump_fixup_edge(), dump_function_to_file(), dump_histogram(), dump_histogram_value(), dump_ic_profile(), dump_inline_stats(), dump_prediction(), dump_profile(), edge_badness(), find_max_flow(), find_optimal_iv_set(), asan_redzone_buffer::flush_redzone_payload(), format_count(), profile_count::from_gcov_type(), get_hot_bb_threshold(), get_rank(), get_scaled_computation_cost_at(), ipa_profile(), is_edge_inconsistent(), is_inconsistent(), iv_ca_dump(), print_hard_regs_subforest(), read_profile_edge_counts(), tag_counters(), and tag_summary().
#define PRIi64 GCC_PRI64 "i" |
Referenced by sreal::dump().
#define PRIo64 GCC_PRI64 "o" |
#define PRIu64 GCC_PRI64 "u" |
Referenced by btf_asm_datasec_type(), btf_asm_func_type(), btf_asm_type(), btf_asm_varent(), do_rpo_vn_1(), pool_usage::dump(), vec_usage::dump(), dump_function_to_file(), dump_gimple_bb_header(), dump_gimple_statistics(), dump_tree_statistics(), ggc_print_statistics(), print_decu(), and timer::validate_phases().
#define PRIX64 GCC_PRI64 "X" |
#define PRIx64 GCC_PRI64 "x" |
Referenced by write_test_expr().
typedef HOST_WIDE_INT __gcc_host_wide_int__ |
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.
|
externinline |
Compute the absolute value of X.
References gcc_checking_assert, and HOST_WIDE_INT_MIN.
Referenced by dependence_distance_ge_vf(), gcd(), get_nth_most_common_value(), gimple_expand_builtin_pow(), least_common_multiple(), should_issue_prefetch_p(), strip_offset_1(), and vect_analyze_possibly_independent_ddr().
|
externinline |
Compute the absolute value of X as an unsigned type.
Referenced by double_int::alshift(), double_int::arshift(), extract_muldiv_1(), fold_plusminus_mult_expr(), gimple_expand_builtin_pow(), double_int::llshift(), double_int::lrshift(), double_int::lshift(), sreal::normalize(), sreal::normalize_down(), sreal::normalize_up(), sreal::operator*(), powi_as_mults(), powi_cost(), prune_ref_by_group_reuse(), double_int::rshift(), spaceship_replacement(), vect_analyze_data_ref_accesses(), and vect_analyze_group_access_1().
|
inline |
Compute the sum of signed A and B and indicate in *OVERFLOW whether that operation overflowed.
References a, b, and HOST_BITS_PER_WIDE_INT.
Referenced by add_sat_hwi(), and lambda_matrix_row_add().
|
inline |
Compute the saturated sum of signed A and B, i.e. upon overflow clamp the result to the corresponding extremum.
References a, add_hwi(), b, HOST_WIDE_INT_MAX, and HOST_WIDE_INT_MIN.
|
extern |
Return the smallest n such that 2**n >= X.
Given X, an unsigned number, return the least Y such that 2**Y >= X.
References floor_log2().
Referenced by alloc_use_cost_map(), bp_pack_machine_mode(), choose_multiplier(), ctf_add_encoded(), ctf_add_slice(), define_builtin_macros_for_type_sizes(), tree_switch_conversion::switch_decision_tree::emit(), get_group_load_store_type(), ideal_phi_node_len(), lower_omp_target(), lto_write_mode_table(), vect_element_precision(), vect_lower_load_permutations(), vect_truncate_gather_scatter_offset(), vectorizable_load(), and vectorizable_store().
|
extern |
Similarly for most significant bits.
References floor_log2(), and HOST_BITS_PER_WIDE_INT.
Referenced by carry_backpropagate(), wi::clrsb(), wi::clz(), divmod_internal_2(), int_loc_descriptor(), and size_of_int_loc_descriptor().
|
extern |
Given X, an unsigned number, return the number of least significant bits that are zero. When X == 0, the result is the word size.
References floor_log2(), HOST_BITS_PER_WIDE_INT, and least_bit_hwi().
Referenced by carry_backpropagate(), wi::ctz(), expand_doubleword_divmod(), force_reg(), get_pos_from_mask(), int_loc_descriptor(), ira_object_conflict_iter_cond(), minmax_set_iter_cond(), size_of_int_loc_descriptor(), synth_mult(), double_int::trailing_zeros(), tree_ctz(), and vect_lower_load_permutations().
|
inline |
Like ctz_hwi, except 0 when x == 0.
References ffs_hwi().
Referenced by expand_divmod(), expand_vector_divmod(), nonzero_bits1(), synth_mult(), and vect_recog_divmod_pattern().
|
extern |
Return log2, or -1 if not exact.
Return the logarithm of X, base 2, considering X unsigned, if X is a power of 2. Otherwise, returns -1.
References floor_log2(), and pow2p_hwi().
Referenced by tree_vector_builder::build(), calculate_table_based_CRC(), canonicalize_reload_addr(), carry_backpropagate(), check_func(), combine_simplify_rtx(), debug_set_to_format(), dump_generic_node(), encode_lfs(), wi::exact_log2(), expand_ifn_atomic_compare_exchange_into_call(), expand_omp_atomic(), expand_vec_perm_var(), ext_dce_process_sets(), final_addr_vec_align(), final_scan_insn_1(), find_split_point(), force_int_to_mode(), get_misalign_in_elems(), get_pos_from_mask(), get_required_cycles(), get_shiftadd_cost(), get_ubsan_type_info_for_type(), group_limit(), hwasan_check_func(), init_ggc(), int_loc_descriptor(), interpret_rhs_expr(), loc_list_from_tree_1(), low_bitmask_len(), make_compound_operation_int(), make_extraction(), noce_try_store_flag_constants(), report_error_func(), scan_store_can_perm_p(), SET_TYPE_VECTOR_SUBPARTS(), simd_clone_adjust(), simplify_and_const_int_1(), simplify_context::simplify_binary_operation_1(), simplify_comparison(), simplify_if_then_else(), simplify_shift_const_1(), synth_mult(), try_combine(), vect_create_epilog_for_reduction(), vect_gen_vector_loop_niters(), vect_gen_vector_loop_niters_mult_vf(), vect_grouped_load_supported(), vect_grouped_store_supported(), vect_lower_load_permutations(), vect_model_reduction_cost(), vect_need_peeling_or_partial_vectors_p(), vect_permute_load_chain(), vect_permute_store_chain(), vect_shift_permute_load_chain(), and vectorizable_simd_clone_call().
|
extern |
Similar to ctz_hwi, except that the least significant bit is numbered starting from 1, and X == 0 yields 0.
References floor_log2(), and least_bit_hwi().
Referenced by auto_flag< T >::auto_flag(), build_printable_array_type(), ctz_or_zero(), and layout_type().
|
extern |
Return floor of log2, with -1 for zero.
Operations on HOST_WIDE_INT. 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/>.
The functions clz_hwi, ctz_hwi, ffs_hwi, floor_log2, ceil_log2, and exact_log2 are defined as inline functions in hwint.h if GCC_VERSION >= 3004. The definitions here are used for older versions of GCC and non-GCC bootstrap compilers.
Given X, an unsigned number, return the largest int Y such that 2**Y <= X. If X is 0, return -1.
References HOST_BITS_PER_WIDE_INT, and HOST_WIDE_INT_1U.
Referenced by asan_emit_stack_protection(), assemble_align(), assemble_start_function(), assemble_trampoline_template(), assemble_variable(), bp_pack_int_in_range(), bp_unpack_int_in_range(), carry_backpropagate(), ceil_log2(), clz_hwi(), constant_size(), ctz_hwi(), estimate_num_insns(), exact_log2(), expand_divmod(), expand_mult(), expand_sdiv_pow2(), expand_smod_pow2(), expand_vector_divmod(), expand_widening_mult(), extended_count(), ffs_hwi(), force_int_to_mode(), get_required_cycles(), get_vectype_for_scalar_type(), nonzero_bits1(), sreal::normalize_down(), sreal::normalize_up(), num_sign_bit_copies1(), optimize_constant_pool(), output_call_frame_info(), output_constant_def_contents(), output_fde(), profile_function(), read_log_maxskip(), real_to_decimal_for_mode(), setup_allocno_priorities(), simplify_rotate(), switch_to_eh_frame_section(), synth_mult(), try_store_by_multiple_pieces(), vect_build_slp_instance(), vectorizable_bb_reduc_epilogue(), and vectorizable_simd_clone_call().
|
extern |
Compute the greatest common divisor of two numbers A and B using Euclid's algorithm.
References a, abs_hwi(), b, and y.
Referenced by add_multivariate_self_dist(), compute_overlap_steps_for_affine_univar(), determine_unroll_factor(), gcd_of_steps_may_divide_p(), lambda_vector_gcd(), least_common_multiple(), process_command(), vectorizable_load(), and vectorizable_store().
|
inline |
Inline functions operating on HOST_WIDE_INT.
Return X with all but the lowest bit masked off.
Referenced by assign_parm_find_stack_rtl(), ccp_finalize(), compute_argument_addresses(), ctz_hwi(), const_rtx_data_hasher::equal(), expand_omp_scantemp_alloc(), ffs_hwi(), fold_builtin_atomic_always_lock_free(), ccp_folder::fold_stmt(), get_object_alignment(), get_object_alignment_2(), get_pointer_alignment(), instrument_expr(), min_align(), ipa_param_adjustments::modify_call(), oacc_loop_auto_partitions(), oacc_loop_fixed_partitions(), place_field(), pow2_or_zerop(), replace_ref(), vectorizable_load(), and vectorizable_store().
|
extern |
Compute the least common multiple of two numbers A and B .
References a, abs_hwi(), b, gcd(), and mul_hwi().
Referenced by vector_builder< T, Shape, Derived >::binary_encoded_nelts(), determine_unroll_factor(), fold_view_convert_vector_encoding(), vector_builder< T, Shape, Derived >::new_binary_operation(), vec_perm_indices::series_p(), simplify_const_vector_byte_offset(), simplify_const_vector_subreg(), vect_create_epilog_for_reduction(), and vectorizable_induction().
|
inline |
Compute the product of signed A and B and indicate in *OVERFLOW whether that operation overflowed.
References a, b, and HOST_WIDE_INT_MIN.
|
extern |
Return X multiplied by Y and check that the result does not overflow.
References gcc_checking_assert, HOST_WIDE_INT_MIN, pos_mul_hwi(), and y.
Referenced by lambda_matrix_row_add(), least_common_multiple(), and mul_sat_hwi().
|
inline |
Compute the saturated product of signed A and B, i.e. upon overflow clamp the result to the corresponding extremum.
References a, b, HOST_WIDE_INT_MAX, HOST_WIDE_INT_MIN, and mul_hwi().
|
extern |
Return the number of set bits in X.
Referenced by get_nearest_type_subqualifiers(), condition_info::popcount(), double_int::popcount(), and wi::popcount().
|
extern |
For X and Y positive integers, return X multiplied by Y and check that the result does not overflow.
References gcc_checking_assert, HOST_WIDE_INT_MAX, and y.
Referenced by mul_hwi().
|
inline |
True if X is zero or a power of two.
References least_bit_hwi().
Referenced by memrefs_conflict_p(), negative_power_of_two_p(), pow2p_hwi(), round_down_loc(), and round_up_loc().
|
inline |
True if X is a power of two.
References pow2_or_zerop().
Referenced by bitmap_get_aligned_chunk(), bitmap_set_aligned_chunk(), tree_vector_builder::build(), carry_backpropagate(), combine_simplify_rtx(), contains_muldiv(), dump_generic_node(), exact_log2(), expand_DIVMOD(), expand_doubleword_divmod(), extract_muldiv_1(), vector_builder< T, Shape, Derived >::finalize(), find_split_point(), fold_binary_loc(), fold_plusminus_mult_expr(), fold_rtx(), force_int_to_mode(), get_load_store_type(), gimple_fold_builtin_memory_op(), strlen_pass::handle_builtin_memcmp(), if_then_else_cond(), init_expmed_one_conv(), is_aligning_offset(), noce_try_store_flag_constants(), sign_mask_for(), simplify_and_const_int_1(), simplify_bitfield_ref(), simplify_compare_const(), simplify_if_then_else(), simplify_rotate(), simplify_set(), sra_handled_bf_read_p(), valid_mask_for_fold_vec_perm_cst_p(), valid_vector_subparts_p(), vect_create_epilog_for_reduction(), vect_grouped_load_supported(), vect_grouped_store_supported(), vect_lower_load_permutations(), vect_permute_load_chain(), vect_permute_store_chain(), vect_shift_permute_load_chain(), and vect_transform_grouped_load().
|
extern |
Reflect (reverse) the bits of a given VALUE within a specified BITWIDTH.
References i.
|
inline |
Sign extend SRC starting from PREC.
References gcc_checking_assert, HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_1, and HOST_WIDE_INT_1U.
Referenced by wi::arshift_large(), assemble_real(), canonize(), wi::int_traits< rtx_mode_t >::decompose(), wi::force_to_size(), wi::hwi_with_prec::hwi_with_prec(), wi::mul_internal(), selt(), trailing_wide_int_storage::set_len(), wide_int_storage::set_len(), generic_wide_int< storage >::sext_elt(), wi::sext_large(), generic_wide_int< storage >::to_shwi(), vn_reference_insert(), vn_reference_lookup(), and wi_unpack().
|
inline |
Zero extend SRC starting from PREC.
References gcc_checking_assert, HOST_BITS_PER_WIDE_INT, and HOST_WIDE_INT_1U.
Referenced by build_new_int_cst(), wi::eq_p_large(), wi::exact_log2(), wi::extract_uhwi(), wi::force_to_size(), wi::lrshift_large(), selt(), generic_wide_int< storage >::to_uhwi(), wi_unpack(), and wi::zext_large().