CBMC
float_bvt Class Reference

#include <float_bv.h>

Classes

struct  biased_floatt
 
struct  rounding_mode_bitst
 
struct  unbiased_floatt
 
struct  unpacked_floatt
 

Public Types

enum class  relt {
  LT , LE , EQ , GT ,
  GE
}
 

Public Member Functions

exprt operator() (const exprt &src) const
 
exprt convert (const exprt &) const
 
exprt add_sub (bool subtract, const exprt &, const exprt &, const exprt &rm, const ieee_float_spect &) const
 
exprt mul (const exprt &, const exprt &, const exprt &rm, const ieee_float_spect &) const
 
exprt div (const exprt &, const exprt &, const exprt &rm, const ieee_float_spect &) const
 
exprt from_unsigned_integer (const exprt &, const exprt &rm, const ieee_float_spect &) const
 
exprt from_signed_integer (const exprt &, const exprt &rm, const ieee_float_spect &) const
 
exprt conversion (const exprt &src, const exprt &rm, const ieee_float_spect &src_spec, const ieee_float_spect &dest_spec) const
 

Static Public Member Functions

static exprt negation (const exprt &, const ieee_float_spect &)
 
static exprt abs (const exprt &, const ieee_float_spect &)
 
static exprt is_equal (const exprt &, const exprt &, const ieee_float_spect &)
 
static exprt is_zero (const exprt &)
 
static exprt isnan (const exprt &, const ieee_float_spect &)
 
static exprt isinf (const exprt &, const ieee_float_spect &)
 
static exprt isnormal (const exprt &, const ieee_float_spect &)
 
static exprt isfinite (const exprt &, const ieee_float_spect &)
 
static exprt to_signed_integer (const exprt &src, std::size_t dest_width, const exprt &rm, const ieee_float_spect &)
 
static exprt to_unsigned_integer (const exprt &src, std::size_t dest_width, const exprt &rm, const ieee_float_spect &)
 
static exprt to_integer (const exprt &src, std::size_t dest_width, bool is_signed, const exprt &rm, const ieee_float_spect &)
 
static exprt relation (const exprt &, relt rel, const exprt &, const ieee_float_spect &)
 

Private Member Functions

exprt rounder (const unbiased_floatt &, const exprt &rm, const ieee_float_spect &) const
 

Static Private Member Functions

static ieee_float_spect get_spec (const exprt &)
 
static exprt get_exponent (const exprt &, const ieee_float_spect &)
 Gets the unbiased exponent in a floating-point bit-vector. More...
 
static exprt get_fraction (const exprt &, const ieee_float_spect &)
 Gets the fraction without hidden bit in a floating-point bit-vector src. More...
 
static exprt sign_bit (const exprt &)
 
static exprt exponent_all_ones (const exprt &, const ieee_float_spect &)
 
static exprt exponent_all_zeros (const exprt &, const ieee_float_spect &)
 
static exprt fraction_all_zeros (const exprt &, const ieee_float_spect &)
 
static void normalization_shift (exprt &fraction, exprt &exponent)
 normalize fraction/exponent pair returns 'zero' if fraction is zero More...
 
static void denormalization_shift (exprt &fraction, exprt &exponent, const ieee_float_spect &)
 make sure exponent is not too small; the exponent is unbiased More...
 
static exprt add_bias (const exprt &exponent, const ieee_float_spect &)
 
static exprt sub_bias (const exprt &exponent, const ieee_float_spect &)
 
static exprt limit_distance (const exprt &dist, mp_integer limit)
 Limits the shift distance. More...
 
static biased_floatt bias (const unbiased_floatt &, const ieee_float_spect &)
 takes an unbiased float, and applies the bias More...
 
static exprt pack (const biased_floatt &, const ieee_float_spect &)
 
static unbiased_floatt unpack (const exprt &, const ieee_float_spect &)
 
static void round_fraction (unbiased_floatt &result, const rounding_mode_bitst &, const ieee_float_spect &)
 
static void round_exponent (unbiased_floatt &result, const rounding_mode_bitst &, const ieee_float_spect &)
 
static exprt fraction_rounding_decision (const std::size_t dest_bits, const exprt sign, const exprt &fraction, const rounding_mode_bitst &)
 rounding decision for fraction using sticky bit More...
 
static exprt subtract_exponents (const unbiased_floatt &src1, const unbiased_floatt &src2)
 Subtracts the exponents. More...
 
static exprt sticky_right_shift (const exprt &op, const exprt &dist, exprt &sticky)
 

Detailed Description

Definition at line 16 of file float_bv.h.

Member Enumeration Documentation

◆ relt

enum float_bvt::relt
strong
Enumerator
LT 
LE 
EQ 
GT 
GE 

Definition at line 83 of file float_bv.h.

Member Function Documentation

◆ abs()

exprt float_bvt::abs ( const exprt op,
const ieee_float_spect spec 
)
static

Definition at line 191 of file float_bv.cpp.

◆ add_bias()

exprt float_bvt::add_bias ( const exprt exponent,
const ieee_float_spect spec 
)
staticprivate

Definition at line 1381 of file float_bv.cpp.

◆ add_sub()

exprt float_bvt::add_sub ( bool  subtract,
const exprt op0,
const exprt op1,
const exprt rm,
const ieee_float_spect spec 
) const

Definition at line 514 of file float_bv.cpp.

◆ bias()

float_bvt::biased_floatt float_bvt::bias ( const unbiased_floatt src,
const ieee_float_spect spec 
)
staticprivate

takes an unbiased float, and applies the bias

Definition at line 1349 of file float_bv.cpp.

◆ conversion()

exprt float_bvt::conversion ( const exprt src,
const exprt rm,
const ieee_float_spect src_spec,
const ieee_float_spect dest_spec 
) const

Definition at line 411 of file float_bv.cpp.

◆ convert()

exprt float_bvt::convert ( const exprt expr) const

Definition at line 19 of file float_bv.cpp.

◆ denormalization_shift()

void float_bvt::denormalization_shift ( exprt fraction,
exprt exponent,
const ieee_float_spect spec 
)
staticprivate

make sure exponent is not too small; the exponent is unbiased

Definition at line 998 of file float_bv.cpp.

◆ div()

exprt float_bvt::div ( const exprt src1,
const exprt src2,
const exprt rm,
const ieee_float_spect spec 
) const

Definition at line 734 of file float_bv.cpp.

◆ exponent_all_ones()

exprt float_bvt::exponent_all_ones ( const exprt src,
const ieee_float_spect spec 
)
staticprivate

Definition at line 249 of file float_bv.cpp.

◆ exponent_all_zeros()

exprt float_bvt::exponent_all_zeros ( const exprt src,
const ieee_float_spect spec 
)
staticprivate

Definition at line 258 of file float_bv.cpp.

◆ fraction_all_zeros()

exprt float_bvt::fraction_all_zeros ( const exprt src,
const ieee_float_spect spec 
)
staticprivate

Definition at line 267 of file float_bv.cpp.

◆ fraction_rounding_decision()

exprt float_bvt::fraction_rounding_decision ( const std::size_t  dest_bits,
const exprt  sign,
const exprt fraction,
const rounding_mode_bitst rounding_mode_bits 
)
staticprivate

rounding decision for fraction using sticky bit

Definition at line 1119 of file float_bv.cpp.

◆ from_signed_integer()

exprt float_bvt::from_signed_integer ( const exprt src,
const exprt rm,
const ieee_float_spect spec 
) const

Definition at line 299 of file float_bv.cpp.

◆ from_unsigned_integer()

exprt float_bvt::from_unsigned_integer ( const exprt src,
const exprt rm,
const ieee_float_spect spec 
) const

Definition at line 323 of file float_bv.cpp.

◆ get_exponent()

exprt float_bvt::get_exponent ( const exprt src,
const ieee_float_spect spec 
)
staticprivate

Gets the unbiased exponent in a floating-point bit-vector.

Definition at line 923 of file float_bv.cpp.

◆ get_fraction()

exprt float_bvt::get_fraction ( const exprt src,
const ieee_float_spect spec 
)
staticprivate

Gets the fraction without hidden bit in a floating-point bit-vector src.

Definition at line 931 of file float_bv.cpp.

◆ get_spec()

ieee_float_spect float_bvt::get_spec ( const exprt expr)
staticprivate

Definition at line 185 of file float_bv.cpp.

◆ is_equal()

exprt float_bvt::is_equal ( const exprt src0,
const exprt src1,
const ieee_float_spect spec 
)
static

Definition at line 211 of file float_bv.cpp.

◆ is_zero()

exprt float_bvt::is_zero ( const exprt src)
static

Definition at line 233 of file float_bv.cpp.

◆ isfinite()

exprt float_bvt::isfinite ( const exprt src,
const ieee_float_spect spec 
)
static

Definition at line 915 of file float_bv.cpp.

◆ isinf()

exprt float_bvt::isinf ( const exprt src,
const ieee_float_spect spec 
)
static

Definition at line 906 of file float_bv.cpp.

◆ isnan()

exprt float_bvt::isnan ( const exprt src,
const ieee_float_spect spec 
)
static

Definition at line 938 of file float_bv.cpp.

◆ isnormal()

exprt float_bvt::isnormal ( const exprt src,
const ieee_float_spect spec 
)
static

Definition at line 485 of file float_bv.cpp.

◆ limit_distance()

exprt float_bvt::limit_distance ( const exprt dist,
mp_integer  limit 
)
staticprivate

Limits the shift distance.

Definition at line 660 of file float_bv.cpp.

◆ mul()

exprt float_bvt::mul ( const exprt src1,
const exprt src2,
const exprt rm,
const ieee_float_spect spec 
) const

Definition at line 683 of file float_bv.cpp.

◆ negation()

exprt float_bvt::negation ( const exprt op,
const ieee_float_spect spec 
)
static

Definition at line 201 of file float_bv.cpp.

◆ normalization_shift()

void float_bvt::normalization_shift ( exprt fraction,
exprt exponent 
)
staticprivate

normalize fraction/exponent pair returns 'zero' if fraction is zero

Definition at line 947 of file float_bv.cpp.

◆ operator()()

exprt float_bvt::operator() ( const exprt src) const
inline

Definition at line 19 of file float_bv.h.

◆ pack()

exprt float_bvt::pack ( const biased_floatt src,
const ieee_float_spect spec 
)
staticprivate

Definition at line 1434 of file float_bv.cpp.

◆ relation()

exprt float_bvt::relation ( const exprt src1,
relt  rel,
const exprt src2,
const ieee_float_spect spec 
)
static

Definition at line 823 of file float_bv.cpp.

◆ round_exponent()

void float_bvt::round_exponent ( unbiased_floatt result,
const rounding_mode_bitst rounding_mode_bits,
const ieee_float_spect spec 
)
staticprivate

Definition at line 1283 of file float_bv.cpp.

◆ round_fraction()

void float_bvt::round_fraction ( unbiased_floatt result,
const rounding_mode_bitst rounding_mode_bits,
const ieee_float_spect spec 
)
staticprivate

Definition at line 1177 of file float_bv.cpp.

◆ rounder()

exprt float_bvt::rounder ( const unbiased_floatt src,
const exprt rm,
const ieee_float_spect spec 
) const
private

Definition at line 1076 of file float_bv.cpp.

◆ sign_bit()

exprt float_bvt::sign_bit ( const exprt op)
staticprivate

Definition at line 292 of file float_bv.cpp.

◆ sticky_right_shift()

exprt float_bvt::sticky_right_shift ( const exprt op,
const exprt dist,
exprt sticky 
)
staticprivate

Definition at line 1465 of file float_bv.cpp.

◆ sub_bias()

exprt float_bvt::sub_bias ( const exprt exponent,
const ieee_float_spect spec 
)
staticprivate

Definition at line 1391 of file float_bv.cpp.

◆ subtract_exponents()

exprt float_bvt::subtract_exponents ( const unbiased_floatt src1,
const unbiased_floatt src2 
)
staticprivate

Subtracts the exponents.

Definition at line 495 of file float_bv.cpp.

◆ to_integer()

exprt float_bvt::to_integer ( const exprt src,
std::size_t  dest_width,
bool  is_signed,
const exprt rm,
const ieee_float_spect spec 
)
static

Definition at line 363 of file float_bv.cpp.

◆ to_signed_integer()

exprt float_bvt::to_signed_integer ( const exprt src,
std::size_t  dest_width,
const exprt rm,
const ieee_float_spect spec 
)
static

Definition at line 345 of file float_bv.cpp.

◆ to_unsigned_integer()

exprt float_bvt::to_unsigned_integer ( const exprt src,
std::size_t  dest_width,
const exprt rm,
const ieee_float_spect spec 
)
static

Definition at line 354 of file float_bv.cpp.

◆ unpack()

float_bvt::unbiased_floatt float_bvt::unpack ( const exprt src,
const ieee_float_spect spec 
)
staticprivate

Definition at line 1401 of file float_bv.cpp.


The documentation for this class was generated from the following files: