GCC Middle and Back End API Reference
|
Functions | |
int | floor_log2 () |
int | ceil_log2 () |
int | exact_log2 () |
int | ctz_hwi () |
int | clz_hwi () |
int | ffs_hwi () |
int | popcount_hwi () |
HOST_WIDE_INT | abs_hwi () |
unsigned HOST_WIDE_INT | absu_hwi () |
HOST_WIDE_INT | gcd () |
HOST_WIDE_INT | pos_mul_hwi () |
HOST_WIDE_INT | mul_hwi () |
HOST_WIDE_INT | least_common_multiple () |
HOST_WIDE_INT | sext_hwi () |
unsigned HOST_WIDE_INT | zext_hwi () |
HOST_WIDE_INT abs_hwi | ( | ) |
Compute the absolute value of X.
References HOST_WIDE_INT_MIN.
Referenced by gcd(), gimple_expand_builtin_pow(), and least_common_multiple().
unsigned HOST_WIDE_INT absu_hwi | ( | ) |
Compute the absolute value of X as an unsigned type.
References HOST_WIDE_INT.
Referenced by adjust_bool_pattern(), double_int::alshift(), double_int::arshift(), fold_plusminus_mult_expr(), gimple_expand_builtin_pow(), double_int::llshift(), double_int::lrshift(), double_int::lshift(), prune_ref_by_group_reuse(), double_int::rshift(), and vect_analyze_group_access().
int ceil_log2 | ( | ) |
Given X, an unsigned number, return the largest Y such that 2**Y >= X.
References floor_log2().
int clz_hwi | ( | ) |
Similarly for most significant bits.
References floor_log2(), and HOST_BITS_PER_WIDE_INT.
Referenced by int_loc_descriptor(), predict_iv_comparison(), and size_of_int_loc_descriptor().
int ctz_hwi | ( | ) |
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(), and HOST_BITS_PER_WIDE_INT.
Referenced by fold_builtin_bitop(), force_reg(), get_pos_from_mask(), int_loc_descriptor(), simplify_const_unary_operation(), size_of_int_loc_descriptor(), and double_int::trailing_zeros().
int exact_log2 | ( | ) |
Return the logarithm of X, base 2, considering X unsigned, if X is a power of 2. Otherwise, returns -1.
References floor_log2().
Referenced by combine_simplify_rtx(), contains_muldiv(), copy_reference_ops_from_ref(), dump_generic_node(), expand_omp_atomic(), expand_vec_perm(), final_addr_vec_align(), final_scan_insn(), find_split_point(), fold_binary_loc(), fold_plusminus_mult_expr(), fold_rtx(), force_to_mode(), get_inner_reference(), get_pos_from_mask(), get_ref_base_and_extent(), get_required_cycles(), get_shiftadd_cost(), if_then_else_cond(), indirect_ref_may_alias_decl_p(), indirect_refs_may_alias_p(), init_ggc(), is_aligning_offset(), low_bitmask_len(), make_compound_operation(), noce_try_store_flag_constants(), report_error_func(), simplify_and_const_int_1(), simplify_binary_operation_1(), simplify_compare_const(), simplify_comparison(), simplify_if_then_else(), simplify_set(), simplify_shift_const_1(), stmt_kills_ref_p_1(), synth_mult(), tree_log2(), try_combine(), vect_analyze_group_access(), vect_gen_niters_for_prolog_loop(), vect_generate_tmps_on_preheader(), vect_grouped_load_supported(), vect_grouped_store_supported(), vect_model_load_cost(), vect_model_reduction_cost(), vect_model_store_cost(), vect_permute_load_chain(), and vect_permute_store_chain().
int ffs_hwi | ( | ) |
Similar to ctz_hwi, except that the least significant bit is numbered starting from 1, and X == 0 yields 0.
References floor_log2().
Referenced by fold_builtin_bitop(), and simplify_const_unary_operation().
int floor_log2 | ( | ) |
@verbatim Operations on HOST_WIDE_INT.
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/.
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.
Referenced by asm_output_aligned_bss(), assemble_align(), assemble_start_function(), assemble_trampoline_template(), assemble_variable(), bp_pack_int_in_range(), bp_unpack_int_in_range(), 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(), fold_builtin_bitop(), force_to_mode(), gcov_histo_index(), get_required_cycles(), init_alignments(), nonzero_bits1(), num_sign_bit_copies1(), omp_max_vf(), output_call_frame_info(), output_constant_def_contents(), output_fde(), profile_function(), real_to_decimal_for_mode(), setup_allocno_priorities(), simplify_const_unary_operation(), simplify_rotate(), switch_to_eh_frame_section(), synth_mult(), tree_floor_log2(), vect_analyze_loop(), vect_recog_divmod_pattern(), vect_slp_analyze_bb(), and zero_nonzero_bits_from_vr().
HOST_WIDE_INT gcd | ( | ) |
Compute the greatest common divisor of two numbers A and B using Euclid's algorithm.
References abs_hwi(), and HOST_WIDE_INT.
Referenced by add_multivariate_self_dist(), compute_overlap_steps_for_affine_univar(), determine_unroll_factor(), divide_eqn_by_gcd(), gcd_of_steps_may_divide_p(), lambda_vector_gcd(), least_common_multiple(), normalize_omega_problem(), omega_solve_eq(), and process_command().
HOST_WIDE_INT least_common_multiple | ( | ) |
Compute the least common multiple of two numbers A and B .
References abs_hwi(), gcd(), and mul_hwi().
Referenced by determine_unroll_factor(), vect_analyze_loop_operations(), vect_analyze_slp_cost(), vect_analyze_slp_instance(), vect_build_slp_tree_1(), and vect_get_constant_vectors().
HOST_WIDE_INT mul_hwi | ( | ) |
Return X multiplied by Y and check that the result does not overflow.
References HOST_WIDE_INT_MIN, and pos_mul_hwi().
Referenced by least_common_multiple(), and omega_solve_geq().
int popcount_hwi | ( | ) |
Return the number of set bits in X.
Referenced by gcov_read_summary(), and double_int::popcount().
HOST_WIDE_INT pos_mul_hwi | ( | ) |
For X and Y positive integers, return X multiplied by Y and check that the result does not overflow.
References HOST_WIDE_INT_MAX.
Referenced by mul_hwi(), and omega_solve_geq().
HOST_WIDE_INT sext_hwi | ( | ) |
Sign extend SRC starting from PREC.
References HOST_BITS_PER_WIDE_INT, and shift.
unsigned HOST_WIDE_INT zext_hwi | ( | ) |
Zero extend SRC starting from PREC.
References HOST_BITS_PER_WIDE_INT, and HOST_WIDE_INT.