cloud9_root/src/third_party/stp/src/simplifier/constantBitP/FixedBits.cpp
// Gets the minimum and maximum unsigned values that are represented by the set "shift".
Gets the minimum and maximum unsigned values that are represented by the set "shift".
Gets the minimum and maximum unsigned values that are represented by the set " shift " .
void
    FixedBits::getUnsignedMinMax(unsigned &minShift, unsigned &maxShift) const
    {
      const FixedBits& shift = *this;
      BEEV::CBV minCBV = CONSTANTBV::BitVector_Create(shift.getWidth(), true);
      BEEV::CBV maxCBV = CONSTANTBV::BitVector_Create(shift.getWidth(), true);
      setUnsignedMinMax(shift, minCBV, maxCBV);
      BEEV::CBV maxValue = CONSTANTBV::BitVector_Create(shift.getWidth(), true);
      for (unsigned i = 0; i < sizeof(unsigned) * 8; i++)
        CONSTANTBV::BitVector_Bit_On(maxValue, i);
      if (unsignedCompare(minCBV, maxValue) > 0)
        {
          minShift = UINT_MAX;
        }
      else
        {
          minShift = cbvTOInt(minCBV);
        }
      if (unsignedCompare(maxCBV, maxValue) > 0)
        {
          maxShift = UINT_MAX;
        }
      else
        {
          maxShift = cbvTOInt(maxCBV);
        }
      CONSTANTBV::BitVector_Destroy(maxValue);
      CONSTANTBV::BitVector_Destroy(minCBV);
      CONSTANTBV::BitVector_Destroy(maxCBV);
    }
void FixedBits :: getUnsignedMinMax ( unsigned & minShift , unsigned & maxShift ) const { const FixedBits & shift = * this ; BEEV :: CBV minCBV = CONSTANTBV :: BitVector_Create ( shift . getWidth ( ) , true ) ; BEEV :: CBV maxCBV = CONSTANTBV :: BitVector_Create ( shift . getWidth ( ) , true ) ; setUnsignedMinMax ( shift , minCBV , maxCBV ) ; BEEV :: CBV maxValue = CONSTANTBV :: BitVector_Create ( shift . getWidth ( ) , true ) ; for ( unsigned i = 0 ; i < sizeof ( unsigned ) * 8 ; i ++ ) CONSTANTBV :: BitVector_Bit_On ( maxValue , i ) ; if ( unsignedCompare ( minCBV , maxValue ) > 0 ) { minShift = UINT_MAX ; } else { minShift = cbvTOInt ( minCBV ) ; } if ( unsignedCompare ( maxCBV , maxValue ) > 0 ) { maxShift = UINT_MAX ; } else { maxShift = cbvTOInt ( maxCBV ) ; } CONSTANTBV :: BitVector_Destroy ( maxValue ) ; CONSTANTBV :: BitVector_Destroy ( minCBV ) ; CONSTANTBV :: BitVector_Destroy ( maxCBV ) ; }
Gets the minimum and maximum unsigned values that are represented by the set "shift".
Gets the minimum and maximum unsigned values that are represented by the set " shift " .
// Get the unsigned minimum and maximum of the shift.