CBMC
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
j
l
m
r
t
w
Functions
a
c
d
f
g
r
t
w
Typedefs
Enumerations
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
k
l
m
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Related Symbols
b
c
d
e
g
i
j
m
n
o
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
y
Typedefs
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerations
_
a
b
c
d
f
g
i
l
m
p
r
s
t
u
v
w
Enumerator
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
float.c
Go to the documentation of this file.
1
/* FUNCTION: _controlfp */
2
3
#ifdef _WIN32
4
#include <float.h>
5
6
__CPROVER_thread_local
unsigned
__CPROVER_fpu_control_word
;
7
8
unsigned
int
_controlfp
(
9
unsigned
int
new_value,
10
unsigned
int
mask)
11
{
12
__CPROVER_fpu_control_word
=
13
(
__CPROVER_fpu_control_word
&~mask)|new_value;
14
15
if
((mask&
_MCW_RC
)!=0)
16
__CPROVER_rounding_mode
=(new_value&
_MCW_RC
)>>8;
17
18
return
__CPROVER_fpu_control_word
;
19
}
20
21
#endif
22
23
/* FUNCTION: _status87 */
24
25
#ifdef _WIN32
26
27
__CPROVER_thread_local
unsigned
__CPROVER_fpu_control_word
;
28
29
unsigned
int
_status87
(
void
)
30
{
31
return
__CPROVER_fpu_control_word
;
32
}
33
34
#endif
35
36
/* FUNCTION: _statusfp */
37
38
#ifdef _WIN32
39
40
__CPROVER_thread_local
unsigned
__CPROVER_fpu_control_word
;
41
42
unsigned
int
_statusfp
(
void
)
43
{
44
return
__CPROVER_fpu_control_word
;
45
}
46
47
#endif
48
49
/* FUNCTION: _statusfp2 */
50
51
#ifdef _WIN32
52
53
__CPROVER_thread_local
unsigned
__CPROVER_fpu_control_word
;
54
55
void
_statusfp2
(
unsigned
int
*
px86
,
unsigned
int
*
pSSE2
)
56
{
57
unsigned
SSE2_status
;
58
*
px86
=
__CPROVER_fpu_control_word
;
59
*
pSSE2
=
SSE2_status
;
// nondet
60
}
61
62
#endif
63
64
/* FUNCTION: _isnan */
65
66
int
_isnan
(
double
x
)
67
{
68
return
__CPROVER_isnand
(
x
);
69
}
66
int
_isnan
(
double
x
) {
…
}
70
71
/* FUNCTION: __builtin_flt_rounds */
72
73
extern
int
__CPROVER_rounding_mode
;
74
75
int
__builtin_flt_rounds
(
void
)
76
{
77
// This is a clang builtin for FLT_ROUNDS
78
// The magic numbers are C99 and different from the
79
// x86 encoding that CPROVER uses.
80
return
__CPROVER_rounding_mode
==0?1:
// to nearest
81
__CPROVER_rounding_mode
==1?3:
// downward
82
__CPROVER_rounding_mode
==2?2:
// upward
83
__CPROVER_rounding_mode
==3?0:
// to zero
84
-1;
85
}
75
int
__builtin_flt_rounds
(
void
) {
…
}
86
87
/* FUNCTION: __flt_rounds */
88
89
int
__builtin_flt_rounds
(
void
);
90
91
int
__flt_rounds
(
void
)
92
{
93
// Spotted on FreeBSD
94
return
__builtin_flt_rounds
();
95
}
91
int
__flt_rounds
(
void
) {
…
}
ait
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition
ai.h:562
__CPROVER_isnand
__CPROVER_bool __CPROVER_isnand(double f)
_isnan
int _isnan(double x)
Definition
float.c:66
__builtin_flt_rounds
int __builtin_flt_rounds(void)
Definition
float.c:75
__flt_rounds
int __flt_rounds(void)
Definition
float.c:91
__CPROVER_rounding_mode
int __CPROVER_rounding_mode
src
ansi-c
library
float.c
Generated by
1.9.8