GCC Middle and Back End API Reference
simplify-rtx.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "predict.h"
#include "memmodel.h"
#include "optabs.h"
#include "emit-rtl.h"
#include "recog.h"
#include "diagnostic-core.h"
#include "varasm.h"
#include "flags.h"
#include "selftest.h"
#include "selftest-rtl.h"
#include "rtx-vector-builder.h"
#include "rtlanal.h"
Include dependency graph for simplify-rtx.cc:

Macros

#define HWI_SIGN_EXTEND(low)    ((((HOST_WIDE_INT) low) < 0) ? HOST_WIDE_INT_M1 : HOST_WIDE_INT_0)
 

Enumerations

enum  {
  CMP_EQ = 1 , CMP_LT = 2 , CMP_GT = 4 , CMP_LTU = 8 ,
  CMP_GTU = 16
}
 

Functions

static bool plus_minus_operand_p (const_rtx)
 
static rtx neg_poly_int_rtx (machine_mode mode, const_rtx i)
 
bool mode_signbit_p (machine_mode mode, const_rtx x)
 
bool val_signbit_p (machine_mode mode, unsigned HOST_WIDE_INT val)
 
bool val_signbit_known_set_p (machine_mode mode, unsigned HOST_WIDE_INT val)
 
bool val_signbit_known_clear_p (machine_mode mode, unsigned HOST_WIDE_INT val)
 
rtx avoid_constant_pool_reference (rtx x)
 
rtx delegitimize_mem_from_attrs (rtx x)
 
rtx simplify_replace_fn_rtx (rtx x, const_rtx old_rtx, rtx(*fn)(rtx, const_rtx, void *), void *data)
 
rtx simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
 
static bool exact_int_to_float_conversion_p (const_rtx op)
 
rtx simplify_const_unary_operation (enum rtx_code code, machine_mode mode, rtx op, machine_mode op_mode)
 
static int comparison_to_mask (enum rtx_code comparison)
 
static enum rtx_code mask_to_comparison (int mask)
 
static bool comparison_code_valid_for_mode (enum rtx_code code, enum machine_mode mode)
 
static rtx relational_result (machine_mode mode, machine_mode cmp_mode, rtx res)
 
bool reverse_rotate_by_imm_p (machine_mode mode, unsigned int left, rtx op1)
 
static bool distributes_over_addition_p (rtx_code op, int opno)
 
rtx simplify_const_binary_operation (enum rtx_code code, machine_mode mode, rtx op0, rtx op1)
 
static int simplify_plus_minus_op_data_cmp (rtx x, rtx y)
 
static rtx comparison_result (enum rtx_code code, int known_results)
 
rtx simplify_const_relational_operation (enum rtx_code code, machine_mode mode, rtx op0, rtx op1)
 
bool native_encode_rtx (machine_mode mode, rtx x, vec< target_unit > &bytes, unsigned int first_byte, unsigned int num_bytes)
 
rtx native_decode_vector_rtx (machine_mode mode, const vec< target_unit > &bytes, unsigned int first_byte, unsigned int npatterns, unsigned int nelts_per_pattern)
 
rtx native_decode_rtx (machine_mode mode, const vec< target_unit > &bytes, unsigned int first_byte)
 
static poly_uint64 simplify_const_vector_byte_offset (rtx x, poly_uint64 byte)
 
static rtx simplify_const_vector_subreg (machine_mode outermode, rtx x, machine_mode innermode, unsigned int first_byte)
 
static rtx simplify_immed_subreg (fixed_size_mode outermode, rtx x, machine_mode innermode, unsigned int first_byte)
 
rtx simplify_rtx (const_rtx x)
 

Macro Definition Documentation

◆ HWI_SIGN_EXTEND

#define HWI_SIGN_EXTEND ( low)     ((((HOST_WIDE_INT) low) < 0) ? HOST_WIDE_INT_M1 : HOST_WIDE_INT_0)
RTL simplification functions for GNU compiler.
   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/>.   
Simplification and canonicalization of RTL.   
Much code operates on (low, high) pairs; the low value is an
unsigned wide int, the high value a signed wide int.  We
occasionally need to sign extend from low to high as if low were a
signed wide int.   

Enumeration Type Documentation

◆ anonymous enum

Enumerator
CMP_EQ 
CMP_LT 
CMP_GT 
CMP_LTU 
CMP_GTU 

Function Documentation

◆ avoid_constant_pool_reference()

◆ comparison_code_valid_for_mode()

static bool comparison_code_valid_for_mode ( enum rtx_code code,
enum machine_mode mode )
static
Return true if CODE is valid for comparisons of mode MODE, false
otherwise.

It is always safe to return false, even if the code was valid for the
given mode as that will merely suppress optimizations.   

References FLOAT_MODE_P, gcc_unreachable, ggc_alloc(), INTEGRAL_MODE_P, and VECTOR_MODE_P.

Referenced by simplify_context::simplify_logical_relational_operation().

◆ comparison_result()

static rtx comparison_result ( enum rtx_code code,
int known_results )
static
Convert the known results for EQ, LT, GT, LTU, GTU contained in
KNOWN_RESULT to a CONST_INT, based on the requested comparison CODE
For KNOWN_RESULT to make sense it should be either CMP_EQ, or the
logical OR of one of (CMP_LT, CMP_GT) and one of (CMP_LTU, CMP_GTU).
For floating-point comparisons, assume that the operands were ordered.   

References CMP_EQ, CMP_GT, CMP_GTU, CMP_LT, CMP_LTU, const0_rtx, const_true_rtx, gcc_unreachable, and ggc_alloc().

Referenced by simplify_const_relational_operation().

◆ comparison_to_mask()

static int comparison_to_mask ( enum rtx_code comparison)
static
Return a mask describing the COMPARISON.   

References gcc_unreachable, and ggc_alloc().

Referenced by simplify_context::simplify_logical_relational_operation().

◆ delegitimize_mem_from_attrs()

rtx delegitimize_mem_from_attrs ( rtx x)
Simplify a MEM based on its attributes.  This is the default
delegitimize_address target hook, and it's recommended that every
overrider call it.   

References adjust_address_nv, DECL_RTL, DECL_RTL_SET_P, DECL_THREAD_LOCAL_P, get_inner_reference(), GET_MODE, GET_MODE_BITSIZE(), ggc_alloc(), known_eq, MEM_EXPR, MEM_OFFSET, MEM_OFFSET_KNOWN_P, MEM_P, NULL, offset, poly_int_tree_p(), rtx_equal_p(), strip_offset(), TREE_CODE, TREE_STATIC, VAR_P, and XEXP.

◆ distributes_over_addition_p()

static bool distributes_over_addition_p ( rtx_code op,
int opno )
static
Return true if binary operation OP distributes over addition in operand
OPNO, with the other operand being held constant.  OPNO counts from 1.   

References ggc_alloc().

Referenced by simplify_const_binary_operation().

◆ exact_int_to_float_conversion_p()

static bool exact_int_to_float_conversion_p ( const_rtx op)
static

◆ mask_to_comparison()

static enum rtx_code mask_to_comparison ( int mask)
static
Return a comparison corresponding to the MASK.   

References gcc_unreachable, and ggc_alloc().

Referenced by simplify_context::simplify_logical_relational_operation().

◆ mode_signbit_p()

◆ native_decode_rtx()

rtx native_decode_rtx ( machine_mode mode,
const vec< target_unit > & bytes,
unsigned int first_byte )
Read an rtx of mode MODE from the target memory image given by BYTES,
starting at byte FIRST_BYTE.  Each element of BYTES contains BITS_PER_UNIT
bits and the bytes are in target memory order.  The image has enough
values to specify all bytes of MODE.

Return the rtx on success, otherwise return NULL_RTX.   

References ALL_SCALAR_FIXED_POINT_MODE_P, CEIL, const_double_from_real_value(), CONST_FIXED_FROM_FIXED_VALUE, FIXED_VALUE_TYPE, gcc_assert, GET_MODE_BITSIZE(), GET_MODE_NUNITS(), GET_MODE_PRECISION(), GET_MODE_SIZE(), ggc_alloc(), HOST_BITS_PER_WIDE_INT, i, immed_wide_int_const(), MIN, native_decode_vector_rtx(), NULL_RTX, r, real_from_target(), REAL_VALUE_TYPE, subreg_size_lsb(), subreg_size_offset_from_lsb(), poly_int< N, C >::to_constant(), VECTOR_MODE_P, and wi::zero().

Referenced by c_readstr(), native_decode_vector_rtx(), and simplify_immed_subreg().

◆ native_decode_vector_rtx()

rtx native_decode_vector_rtx ( machine_mode mode,
const vec< target_unit > & bytes,
unsigned int first_byte,
unsigned int npatterns,
unsigned int nelts_per_pattern )
Read a vector of mode MODE from the target memory image given by BYTES,
starting at byte FIRST_BYTE.  The vector is known to be encodable using
NPATTERNS interleaved patterns with NELTS_PER_PATTERN elements each,
and BYTES is known to have enough bytes to supply NPATTERNS *
NELTS_PER_PATTERN vector elements.  Each element of BYTES contains
BITS_PER_UNIT bits and the bytes are in target memory order.

Return the vector on success, otherwise return NULL_RTX.   

References gcc_assert, gen_int_mode(), GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_NUNITS(), GET_MODE_PRECISION(), ggc_alloc(), i, native_decode_rtx(), NULL_RTX, and vector_element_size.

Referenced by native_decode_rtx(), and simplify_const_vector_subreg().

◆ native_encode_rtx()

bool native_encode_rtx ( machine_mode mode,
rtx x,
vec< target_unit > & bytes,
unsigned int first_byte,
unsigned int num_bytes )
Try to calculate NUM_BYTES bytes of the target memory image of X,
starting at byte FIRST_BYTE.  Return true on success and add the
bytes to BYTES, such that each byte has BITS_PER_UNIT bits and such
that the bytes follow target memory order.  Leave BYTES unmodified
on failure.

MODE is the mode of X.  The caller must reserve NUM_BYTES bytes in
BYTES before calling this function.   

References CONST_DOUBLE_P, CONST_DOUBLE_REAL_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW, CONST_SCALAR_INT_P, CONST_VECTOR_ELT, gcc_assert, GET_CODE, GET_MODE, GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_MASK, GET_MODE_NUNITS(), GET_MODE_PRECISION(), GET_MODE_SIZE(), GET_MODE_UNIT_SIZE, ggc_alloc(), HOST_BITS_PER_WIDE_INT, i, INTVAL, MIN, native_encode_rtx(), real_to_target(), shift, subreg_size_lsb(), poly_int< N, C >::to_constant(), and vector_element_size.

Referenced by native_encode_rtx(), optimize_constant_pool(), simplify_const_vector_subreg(), and simplify_immed_subreg().

◆ neg_poly_int_rtx()

static rtx neg_poly_int_rtx ( machine_mode mode,
const_rtx i )
static
Negate I, which satisfies poly_int_rtx_p.  MODE is the mode of I.   

References i, immed_wide_int_const(), and wi::to_poly_wide().

Referenced by simplify_context::simplify_binary_operation_1(), and simplify_context::simplify_plus_minus().

◆ plus_minus_operand_p()

static bool plus_minus_operand_p ( const_rtx x)
static
Check whether an operand is suitable for calling simplify_plus_minus.   

References CONSTANT_P, GET_CODE, ggc_alloc(), and XEXP.

Referenced by simplify_context::simplify_binary_operation_1().

◆ relational_result()

static rtx relational_result ( machine_mode mode,
machine_mode cmp_mode,
rtx res )
static
Canonicalize RES, a scalar const0_rtx/const_true_rtx to the right
false/true value of comparison with MODE where comparison operands
have CMP_MODE.   

References const0_rtx, CONST0_RTX, const1_rtx, CONST1_RTX, const_double_from_real_value(), const_true_rtx, gen_const_vec_duplicate(), ggc_alloc(), NULL_RTX, REAL_VALUE_TYPE, SCALAR_FLOAT_MODE_P, SCALAR_INT_MODE_P, and VECTOR_MODE_P.

Referenced by simplify_context::simplify_logical_relational_operation(), and simplify_context::simplify_relational_operation().

◆ reverse_rotate_by_imm_p()

bool reverse_rotate_by_imm_p ( machine_mode mode,
unsigned int left,
rtx op1 )
Return TRUE if a rotate in mode MODE with a constant count in OP1
should be reversed.

If the rotate should not be reversed, return FALSE.

LEFT indicates if this is a rotate left or a rotate right.   

References CONST_INT_P, GET_MODE_UNIT_PRECISION, ggc_alloc(), IN_RANGE, insn_operand_matches(), INTVAL, and optab_handler().

Referenced by expand_shift_1(), and simplify_context::simplify_binary_operation_1().

◆ simplify_const_binary_operation()

rtx simplify_const_binary_operation ( enum rtx_code code,
machine_mode mode,
rtx op0,
rtx op1 )

References wi::add(), wi::arshift(), wi::bit_and(), wi::bit_or(), wi::bit_xor(), BITS_PER_WORD, wi::clrsb(), wi::clz(), CONST_DOUBLE_AS_FLOAT_P, const_double_from_real_value(), CONST_DOUBLE_REAL_VALUE, CONST_FIXED_P, CONST_SCALAR_INT_P, CONST_VECTOR_DUPLICATE_P, CONST_VECTOR_ELT, CONST_VECTOR_NPATTERNS, CONST_VECTOR_NUNITS, CONST_VECTOR_STEPPED_P, count, dconst0, distributes_over_addition_p(), wi::div_trunc(), wi::eq_p(), f1, gcc_assert, gcc_unreachable, gen_rtx_CONST_VECTOR(), GET_CODE, GET_MODE, GET_MODE_INNER, GET_MODE_NUNITS(), GET_MODE_PRECISION(), wi::geu_p(), ggc_alloc(), HONOR_NANS(), HONOR_SNANS(), HOST_BITS_PER_DOUBLE_INT, i, immed_wide_int_const(), wi::leu_p(), wi::lrotate(), wi::lrshift(), wi::lshift(), wi::max_value(), wi::min_value(), wi::mod_trunc(), MODE_COMPOSITE_P, MODE_HAS_INFINITIES, wi::mul(), wi::mul_high(), wi::neg_p(), NULL_RTX, NUM_POLY_INT_COEFFS, wi::OVF_NONE, wi::OVF_OVERFLOW, wi::OVF_UNDERFLOW, poly_int_rtx_p(), r, real_arithmetic(), real_convert(), real_copysign(), real_equal(), real_from_target(), real_identical(), real_to_target(), REAL_VALUE_ISINF, REAL_VALUE_ISSIGNALING_NAN, REAL_VALUE_NEGATIVE, REAL_VALUE_TYPE, wi::rrotate(), rtvec_alloc(), RTVEC_ELT, rtx_to_tree_code(), SCALAR_FLOAT_MODE_P, shift, SHIFT_COUNT_TRUNCATED, SIGNED, simplify_binary_operation(), wi::smax(), wi::smin(), wi::sub(), poly_int< N, C >::to_constant(), wi::to_poly_wide(), wi::umax(), wi::umin(), wi::umod_trunc(), UNSIGNED, valid_for_const_vector_p(), VECTOR_MODE_P, and word_mode.

Referenced by find_shift_sequence(), simplify_context::simplify_binary_operation(), simplify_context::simplify_plus_minus(), and simplify_shift_const_1().

◆ simplify_const_relational_operation()

◆ simplify_const_unary_operation()

rtx simplify_const_unary_operation ( enum rtx_code code,
machine_mode mode,
rtx op,
machine_mode op_mode )
Try to compute the value of a unary operation CODE whose output mode is to
be MODE with input operand OP whose mode was originally OP_MODE.
Return zero if the value cannot be computed.   

References wi::abs(), wi::bit_not(), wi::bitreverse(), wi::bswap(), wi::clrsb(), wi::clz(), CLZ_DEFINED_VALUE_AT_ZERO, const0_rtx, CONST_DOUBLE_AS_FLOAT_P, const_double_from_real_value(), CONST_DOUBLE_REAL_VALUE, CONST_POLY_INT_P, const_poly_int_value(), CONST_SCALAR_INT_P, CONST_VECTOR_DUPLICATE_P, CONST_VECTOR_ELT, CONST_VECTOR_NPATTERNS, CONST_VECTOR_NUNITS, count, wi::ctz(), CTZ_DEFINED_VALUE_AT_ZERO, exact_real_truncate(), wi::ffs(), wide_int_storage::from(), gcc_assert, gcc_unreachable, gen_const_vec_duplicate(), GET_CODE, GET_MODE, GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_NUNITS(), GET_MODE_PRECISION(), ggc_alloc(), HONOR_SIGN_DEPENDENT_ROUNDING(), HONOR_SNANS(), HOST_BITS_PER_DOUBLE_INT, i, immed_wide_int_const(), is_int_mode(), known_eq, wi::max(), wi::max_value(), wi::min(), wi::min_value(), wi::ne_p(), wi::neg(), NULL, NULL_RTX, wi::only_sign_bit_p(), wi::parity(), wi::popcount(), real_arithmetic(), real_convert(), real_from_integer(), real_from_target(), real_less(), real_to_integer(), real_to_target(), real_value_abs(), REAL_VALUE_ISNAN, REAL_VALUE_ISSIGNALING_NAN, real_value_negate(), REAL_VALUE_NEGATIVE, real_value_truncate(), REAL_VALUE_TYPE, SCALAR_FLOAT_MODE_P, wi::shwi(), SIGNED, simplify_unary_operation(), UNSIGNED, valid_for_const_vector_p(), and VECTOR_MODE_P.

Referenced by simplify_context::simplify_unary_operation().

◆ simplify_const_vector_byte_offset()

static poly_uint64 simplify_const_vector_byte_offset ( rtx x,
poly_uint64 byte )
static
Simplify a byte offset BYTE into CONST_VECTOR X.  The main purpose
is to convert a runtime BYTE value into a constant one.   

References CONST_VECTOR_NELTS_PER_PATTERN, CONST_VECTOR_NPATTERNS, GET_MODE, GET_MODE_NUNITS(), GET_MODE_PRECISION(), ggc_alloc(), known_gt, least_common_multiple(), and vector_element_size.

Referenced by simplify_context::simplify_subreg().

◆ simplify_const_vector_subreg()

static rtx simplify_const_vector_subreg ( machine_mode outermode,
rtx x,
machine_mode innermode,
unsigned int first_byte )
static
Subroutine of simplify_subreg in which:

- X is known to be a CONST_VECTOR
- OUTERMODE is known to be a vector mode

Try to handle the subreg by operating on the CONST_VECTOR encoding
rather than on each individual element of the CONST_VECTOR.

Return the simplified subreg on success, otherwise return NULL_RTX.   

References CEIL, CONST_VECTOR_NELTS_PER_PATTERN, CONST_VECTOR_NPATTERNS, CONST_VECTOR_STEPPED_P, GET_MODE_INNER, GET_MODE_NUNITS(), GET_MODE_PRECISION(), ggc_alloc(), least_common_multiple(), native_decode_vector_rtx(), native_encode_rtx(), NULL_RTX, paradoxical_subreg_p(), and vector_element_size.

Referenced by simplify_context::simplify_subreg().

◆ simplify_immed_subreg()

static rtx simplify_immed_subreg ( fixed_size_mode outermode,
rtx x,
machine_mode innermode,
unsigned int first_byte )
static
Try to simplify a subreg of a constant by encoding the subreg region
as a sequence of target bytes and reading them back in the new mode.
Return the new value on success, otherwise return null.

The subreg has outer mode OUTERMODE, inner mode INNERMODE, inner value X
and byte offset FIRST_BYTE.   

References byte_lowpart_offset(), CONST_INT_P, CONST_SCALAR_INT_P, FLOAT_MODE_P, GET_MODE_CLASS, GET_MODE_SIZE(), ggc_alloc(), i, native_decode_rtx(), native_encode_rtx(), wi::neg_p(), NULL_RTX, paradoxical_subreg_p(), and poly_int< N, C >::to_constant().

Referenced by simplify_context::simplify_subreg().

◆ simplify_plus_minus_op_data_cmp()

static int simplify_plus_minus_op_data_cmp ( rtx x,
rtx y )
static
Return a positive integer if X should sort after Y.  The value
returned is 1 if and only if X and Y are both regs.   

References commutative_operand_precedence(), REG_P, REGNO, and y.

Referenced by simplify_context::simplify_plus_minus().

◆ simplify_replace_fn_rtx()

◆ simplify_replace_rtx()

rtx simplify_replace_rtx ( rtx x,
const_rtx old_rtx,
rtx new_rtx )

◆ simplify_rtx()

rtx simplify_rtx ( const_rtx x)
Simplify X, an rtx expression.

Return the simplified expression or NULL if no simplifications
were possible.

This is the preferred entry point into the simplification routines;
however, we still allow passes to call the more specific routines.

Right now GCC has three (yes, three) major bodies of RTL simplification
code that need to be unified.

     1. fold_rtx in cse.cc.  This code uses various CSE specific
        information to aid in RTL simplification.

     2. simplify_rtx in combine.cc.  Similar to fold_rtx, except that
        it uses combine specific information to aid in RTL
        simplification.

     3. The routines in this file.


Long term we want to only have one body of simplification code; to
get to that state I recommend the following steps:

     1. Pour over fold_rtx & simplify_rtx and move any simplifications
        which are not pass dependent state into these routines.

     2. As code is moved by #1, change fold_rtx & simplify_rtx to
        use this routine whenever possible.

     3. Allow for pass dependent state to be provided to these
        routines and add simplifications based on the pass dependent
        state.  Remove code from cse.cc & combine.cc that becomes
        redundant/dead.

 It will take time, but ultimately the compiler will be easier to
 maintain and improve.  It's totally silly that when we add a
 simplification that it needs to be added to 4 places (3 for RTL
 simplification and 1 for tree simplification.   

References GET_CODE, GET_MODE, GET_RTX_CLASS, ggc_alloc(), NULL, RTX_BIN_ARITH, RTX_BITFIELD_OPS, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, rtx_equal_p(), RTX_EXTRA, RTX_OBJ, RTX_TERNARY, RTX_UNARY, simplify_binary_operation(), simplify_gen_binary(), simplify_relational_operation(), simplify_subreg(), simplify_ternary_operation(), simplify_unary_operation(), SUBREG_BYTE, SUBREG_REG, swap_commutative_operands_p(), and XEXP.

Referenced by combine_set_extension(), cselib_expand_value_rtx_1(), simplify_context::simplify_relational_operation_1(), simplify_set(), simplify_subtraction(), try_replace_reg(), and validate_simplify_insn().

◆ val_signbit_known_clear_p()

bool val_signbit_known_clear_p ( machine_mode mode,
unsigned HOST_WIDE_INT val )
Test whether the most significant bit of mode MODE is clear in VAL.
Returns false if the precision of MODE is too large to handle.   

References GET_MODE_PRECISION(), ggc_alloc(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_1U, and is_int_mode().

Referenced by simplify_shift_const_1(), and simplify_context::simplify_unary_operation_1().

◆ val_signbit_known_set_p()

bool val_signbit_known_set_p ( machine_mode mode,
unsigned HOST_WIDE_INT val )
Test whether the most significant bit of mode MODE is set in VAL.
Returns false if the precision of MODE is too large to handle.   

References GET_MODE_PRECISION(), ggc_alloc(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_1U, and is_int_mode().

Referenced by canonicalize_condition(), emit_cstore(), emit_store_flag_1(), find_comparison_args(), nonzero_bits1(), sign_extend_short_imm(), and simplify_comparison().

◆ val_signbit_p()

bool val_signbit_p ( machine_mode mode,
unsigned HOST_WIDE_INT val )
Test whether VAL is equal to the most significant bit of mode MODE
(after masking with the mode mask of MODE).  Returns false if the
precision of MODE is too large to handle.   

References GET_MODE_MASK, GET_MODE_PRECISION(), ggc_alloc(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_1U, and is_int_mode().

Referenced by combine_simplify_rtx(), emit_store_flag(), emit_store_flag_1(), force_int_to_mode(), and simplify_context::simplify_binary_operation_1().