GCC Middle and Back End API Reference
hwint.c File 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 ()

Function Documentation

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().

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 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 least_common_multiple ( )
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.