@@ -22,33 +22,69 @@ inline long double __builtin_fabsl(long double d) { return __CPROVER_fabsl(d); }
22
22
23
23
inline float __builtin_fabsf (float f ) { return __CPROVER_fabsf (f ); }
24
24
25
- /* FUNCTION: __builtin_isgreater */
25
+ /* FUNCTION: __CPROVER_isgreaterf */
26
26
27
- int __builtin_isgreater ( double f , double g ) { return f > g ; }
27
+ int __CPROVER_isgreaterf ( float f , float g ) { return f > g ; }
28
28
29
- /* FUNCTION: __builtin_isgreaterequal */
29
+ /* FUNCTION: __CPROVER_isgreaterd */
30
30
31
- int __builtin_isgreaterequal ( float f , float g ) { return f >= g ; }
31
+ int __CPROVER_isgreaterd ( double f , double g ) { return f > g ; }
32
32
33
- /* FUNCTION: __builtin_isless */
33
+ /* FUNCTION: __CPROVER_isgreaterequalf */
34
34
35
- int __builtin_isless (float f , float g ) { return f < g ;}
35
+ int __CPROVER_isgreaterequalf (float f , float g ) { return f >= g ; }
36
36
37
- /* FUNCTION: __builtin_islessequal */
37
+ /* FUNCTION: __CPROVER_isgreaterequald */
38
38
39
- int __builtin_islessequal ( float f , float g ) { return f < = g ; }
39
+ int __CPROVER_isgreaterequald ( double f , double g ) { return f > = g ; }
40
40
41
- /* FUNCTION: __builtin_islessgreater */
41
+ /* FUNCTION: __CPROVER_islessf */
42
42
43
- int __builtin_islessgreater (float f , float g ) { return ( f < g ) || ( f > g ); }
43
+ int __CPROVER_islessf (float f , float g ) { return f < g ; }
44
44
45
- /* FUNCTION: __builtin_isunordered */
45
+ /* FUNCTION: __CPROVER_islessd */
46
46
47
- int __builtin_isunordered (float f , float g ) { return isnan (f ) || isnan (g ); }
47
+ int __CPROVER_islessd (double f , double g ) { return f < g ;}
48
+
49
+ /* FUNCTION: __CPROVER_islessequalf */
50
+
51
+ int __CPROVER_islessequalf (float f , float g ) { return f <= g ; }
52
+
53
+ /* FUNCTION: __CPROVER_islessequald */
54
+
55
+ int __CPROVER_islessequald (double f , double g ) { return f <= g ; }
56
+
57
+ /* FUNCTION: __CPROVER_islessgreaterf */
58
+
59
+ int __CPROVER_islessgreaterf (float f , float g ) { return (f < g ) || (f > g ); }
60
+
61
+ /* FUNCTION: __CPROVER_islessgreaterd */
62
+
63
+ int __CPROVER_islessgreaterd (double f , double g ) { return (f < g ) || (f > g ); }
64
+
65
+ /* FUNCTION: __CPROVER_isunorderedf */
66
+
67
+ #ifndef __CPROVER_MATH_H_INCLUDED
68
+ #include <math.h>
69
+ #define __CPROVER_MATH_H_INCLUDED
70
+ #endif
71
+
72
+ int __CPROVER_isunorderedf (float f , float g ) { return isnanf (f ) || isnanf (g ); }
73
+
74
+ /* FUNCTION: __CPROVER_isunorderedd */
75
+
76
+ #ifndef __CPROVER_MATH_H_INCLUDED
77
+ #include <math.h>
78
+ #define __CPROVER_MATH_H_INCLUDED
79
+ #endif
80
+
81
+ int __CPROVER_isunorderedd (double f , double g ) { return isnan (f ) || isnan (g ); }
48
82
49
83
50
84
/* FUNCTION: isfinite */
51
85
86
+ #undef isfinite
87
+
52
88
int isfinite (double d ) { return __CPROVER_isfinited (d ); }
53
89
54
90
/* FUNCTION: __finite */
@@ -65,6 +101,8 @@ int __finitel(long double ld) { return __CPROVER_isfiniteld(ld); }
65
101
66
102
/* FUNCTION: isinf */
67
103
104
+ #undef isinf
105
+
68
106
inline int isinf (double d ) { return __CPROVER_isinfd (d ); }
69
107
70
108
/* FUNCTION: __isinf */
@@ -89,6 +127,8 @@ inline int __isinfl(long double ld) { return __CPROVER_isinfld(ld); }
89
127
90
128
/* FUNCTION: isnan */
91
129
130
+ #undef isnan
131
+
92
132
inline int isnan (double d ) { return __CPROVER_isnand (d ); }
93
133
94
134
/* FUNCTION: __isnan */
@@ -113,6 +153,8 @@ inline int __isnanl(long double ld) { return __CPROVER_isnanld(ld); }
113
153
114
154
/* FUNCTION: isnormal */
115
155
156
+ #undef isnormal
157
+
116
158
inline int isnormal (double d ) { return __CPROVER_isnormald (d ); }
117
159
118
160
/* FUNCTION: __isnormalf */
@@ -177,6 +219,8 @@ inline int _fdsign(float f) { return __CPROVER_signf(f); }
177
219
178
220
/* FUNCTION: signbit */
179
221
222
+ #undef signbit
223
+
180
224
inline int signbit (double d ) { return __CPROVER_signd (d ); }
181
225
182
226
/* FUNCTION: __signbitd */
@@ -1032,7 +1076,7 @@ float fdimf(float f, float g) { return ((f > g) ? f - g : +0.0f); }
1032
1076
#define __CPROVER_MATH_H_INCLUDED
1033
1077
#endif
1034
1078
1035
- long double fdim (long double f , long double g ) { return ((f > g ) ? f - g : +0.0 ); }
1079
+ long double fdiml (long double f , long double g ) { return ((f > g ) ? f - g : +0.0 ); }
1036
1080
1037
1081
1038
1082
@@ -1130,7 +1174,7 @@ float __sort_of_CPROVER_round_to_integralf (int rounding_mode, float d)
1130
1174
1131
1175
long double __sort_of_CPROVER_round_to_integrall (int rounding_mode , long double d )
1132
1176
{
1133
- long double magicConst = 0x1.0p+64d ;
1177
+ long double magicConst = 0x1.0p+64 ;
1134
1178
long double return_value ;
1135
1179
int saved_rounding_mode = fegetround ();
1136
1180
fesetround (rounding_mode );
@@ -1421,7 +1465,7 @@ float roundf(float x)
1421
1465
xp = x ;
1422
1466
}
1423
1467
1424
- fegetround ( FE_TOWARDZERO );
1468
+ fesetround ( saved_rounding_mode );
1425
1469
1426
1470
return __sort_of_CPROVER_round_to_integralf (FE_TOWARDZERO , xp );
1427
1471
}
@@ -1643,7 +1687,7 @@ long int lrint(double x)
1643
1687
1644
1688
float __sort_of_CPROVER_round_to_integralf (int rounding_mode , float d );
1645
1689
1646
- float lrintf (float x )
1690
+ long int lrintf (float x )
1647
1691
{
1648
1692
// TODO : should be an all-in-one __CPROVER function to allow
1649
1693
// conversion to SMT
@@ -1666,7 +1710,7 @@ float lrintf(float x)
1666
1710
1667
1711
long double __sort_of_CPROVER_round_to_integrall (int rounding_mode , long double d );
1668
1712
1669
- long double lrintl (long double x )
1713
+ long int lrintl (long double x )
1670
1714
{
1671
1715
// TODO : should be an all-in-one __CPROVER function to allow
1672
1716
// conversion to SMT
@@ -1711,7 +1755,7 @@ long long int llrint(double x)
1711
1755
1712
1756
float __sort_of_CPROVER_round_to_integralf (int rounding_mode , float d );
1713
1757
1714
- float llrintf (float x )
1758
+ long long int llrintf (float x )
1715
1759
{
1716
1760
// TODO : should be an all-in-one __CPROVER function to allow
1717
1761
// conversion to SMT
@@ -1734,7 +1778,7 @@ float llrintf(float x)
1734
1778
1735
1779
long double __sort_of_CPROVER_round_to_integrall (int rounding_mode , long double d );
1736
1780
1737
- long double llrintl (long double x )
1781
+ long long int llrintl (long double x )
1738
1782
{
1739
1783
// TODO : should be an all-in-one __CPROVER function to allow
1740
1784
// conversion to SMT
@@ -1803,7 +1847,7 @@ long int lround(double x)
1803
1847
1804
1848
float __sort_of_CPROVER_round_to_integralf (int rounding_mode , float d );
1805
1849
1806
- float lroundf (float x )
1850
+ long int lroundf (float x )
1807
1851
{
1808
1852
// TODO : should be an all-in-one __CPROVER function to allow
1809
1853
// conversion to SMT, plus should use RNA
@@ -1840,7 +1884,7 @@ float lroundf(float x)
1840
1884
1841
1885
long double __sort_of_CPROVER_round_to_integrall (int rounding_mode , long double d );
1842
1886
1843
- long double lroundl (long double x )
1887
+ long int lroundl (long double x )
1844
1888
{
1845
1889
int saved_rounding_mode = fegetround ();
1846
1890
fesetround (FE_TOWARDZERO );
@@ -1913,7 +1957,7 @@ long long int llround(double x)
1913
1957
1914
1958
float __sort_of_CPROVER_round_to_integralf (int rounding_mode , float d );
1915
1959
1916
- float llroundf (float x )
1960
+ long long int llroundf (float x )
1917
1961
{
1918
1962
// TODO : should be an all-in-one __CPROVER function to allow
1919
1963
// conversion to SMT, plus should use RNA
@@ -1950,7 +1994,7 @@ float llroundf(float x)
1950
1994
1951
1995
long double __sort_of_CPROVER_round_to_integrall (int rounding_mode , long double d );
1952
1996
1953
- long double llroundl (long double x )
1997
+ long long int llroundl (long double x )
1954
1998
{
1955
1999
// TODO : should be an all-in-one __CPROVER function to allow
1956
2000
// conversion to SMT, plus should use RNA
@@ -1969,7 +2013,7 @@ long double llroundl(long double x)
1969
2013
fesetround (saved_rounding_mode );
1970
2014
1971
2015
long double rti = __sort_of_CPROVER_round_to_integrall (FE_TOWARDZERO , xp );
1972
- return (long int )rti ;
2016
+ return (long long int )rti ;
1973
2017
}
1974
2018
1975
2019
0 commit comments