cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
boolbv_floatbv_fma.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module:
4
5
Author: Michael Tautschnig
6
7
\*******************************************************************/
8
9
#include <
util/bitvector_types.h
>
10
#include <
util/floatbv_expr.h
>
11
12
#include <
solvers/floatbv/float_utils.h
>
13
14
#include "
boolbv.h
"
15
16
bvt
boolbvt::convert_floatbv_fma
(
const
floatbv_fma_exprt
&expr)
17
{
18
float_utilst
float_utils(
prop
);
19
20
float_utils.
set_rounding_mode
(
convert_bv
(expr.
rounding_mode
()));
21
float_utils.
spec
=
ieee_float_spect
(
to_floatbv_type
(expr.
type
()));
22
23
bvt
multiply_lhs =
convert_bv
(expr.
op_multiply_lhs
());
24
bvt
multiply_rhs =
convert_bv
(expr.
op_multiply_rhs
());
25
bvt
addend =
convert_bv
(expr.
op_add
());
26
27
return
float_utils.
fma
(multiply_lhs, multiply_rhs, addend);
28
}
bitvector_types.h
Pre-defined bitvector types.
to_floatbv_type
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
Definition
bitvector_types.h:386
boolbv.h
boolbvt::convert_bv
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
Definition
boolbv.cpp:40
boolbvt::convert_floatbv_fma
virtual bvt convert_floatbv_fma(const floatbv_fma_exprt &)
Definition
boolbv_floatbv_fma.cpp:16
exprt::type
typet & type()
Return the type of the expression.
Definition
expr.h:85
float_utilst
Definition
float_utils.h:18
float_utilst::set_rounding_mode
void set_rounding_mode(const bvt &)
Definition
float_utils.cpp:15
float_utilst::fma
bvt fma(const bvt &multiply_lhs, const bvt &multiply_rhs, const bvt &addend)
Fused multiply-add: round(multiply_lhs * multiply_rhs + addend) with a single rounding step.
Definition
float_utils.cpp:497
float_utilst::spec
ieee_float_spect spec
Definition
float_utils.h:94
floatbv_fma_exprt
Fused multiply-add expression: round(op0 * op1 + op2) with a single rounding.
Definition
floatbv_expr.h:574
floatbv_fma_exprt::op_multiply_lhs
exprt & op_multiply_lhs()
Definition
floatbv_expr.h:584
floatbv_fma_exprt::op_add
exprt & op_add()
Definition
floatbv_expr.h:602
floatbv_fma_exprt::op_multiply_rhs
exprt & op_multiply_rhs()
Definition
floatbv_expr.h:593
floatbv_fma_exprt::rounding_mode
exprt & rounding_mode()
Definition
floatbv_expr.h:611
ieee_float_spect
Definition
ieee_float.h:22
prop_conv_solvert::prop
propt & prop
Definition
prop_conv_solver.h:130
float_utils.h
floatbv_expr.h
API to expression classes for floating-point arithmetic.
bvt
std::vector< literalt > bvt
Definition
literal.h:201
solvers
flattening
boolbv_floatbv_fma.cpp
Generated by
1.17.0