15
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
*/
17
17
18
+ #include "milieu.h"
18
19
#include "softfloat.h"
19
20
20
21
/*
21
22
* 'Equal' wrapper. This returns 0 if the numbers are equal, or (1 | -1)
22
23
* otherwise. So we need to invert the output.
23
24
*/
24
- int __eqsf2 (float32 a , float32 b )
25
+ flag __eqsf2 (float32 a , float32 b );
26
+ flag __eqsf2 (float32 a , float32 b )
25
27
{
26
28
return !float32_eq (a , b );
27
29
}
@@ -32,7 +34,8 @@ int __eqsf2(float32 a, float32 b)
32
34
* to use an 'equal' call and invert the result. The result is already
33
35
* inverted though! Confusing?!
34
36
*/
35
- int __nesf2 (float32 a , float32 b )
37
+ flag __nesf2 (float32 a , float32 b );
38
+ flag __nesf2 (float32 a , float32 b )
36
39
{
37
40
return !float32_eq (a , b );
38
41
}
@@ -44,7 +47,8 @@ int __nesf2(float32 a, float32 b)
44
47
* make up our mind. This means that we can call 'less than or equal' and
45
48
* invert the result.
46
49
*/
47
- int __gtsf2 (float32 a , float32 b )
50
+ flag __gtsf2 (float32 a , float32 b );
51
+ flag __gtsf2 (float32 a , float32 b )
48
52
{
49
53
return !float32_le (a , b );
50
54
}
@@ -53,23 +57,26 @@ int __gtsf2(float32 a, float32 b)
53
57
* 'Greater Than or Equal' wrapper. We emulate this by inverting the result
54
58
* of a 'less than' call.
55
59
*/
56
- int __gesf2 (float32 a , float32 b )
60
+ flag __gesf2 (float32 a , float32 b );
61
+ flag __gesf2 (float32 a , float32 b )
57
62
{
58
63
return !float32_lt (a , b );
59
64
}
60
65
61
66
/*
62
67
* 'Less Than' wrapper.
63
68
*/
64
- int __ltsf2 (float32 a , float32 b )
69
+ flag __ltsf2 (float32 a , float32 b );
70
+ flag __ltsf2 (float32 a , float32 b )
65
71
{
66
72
return float32_lt (a , b );
67
73
}
68
74
69
75
/*
70
76
* 'Less Than or Equal' wrapper. A 0 must turn into a 1, and a 1 into a 0.
71
77
*/
72
- int __lesf2 (float32 a , float32 b )
78
+ flag __lesf2 (float32 a , float32 b );
79
+ flag __lesf2 (float32 a , float32 b )
73
80
{
74
81
return !float32_le (a , b );
75
82
}
@@ -80,6 +87,7 @@ int __lesf2(float32 a, float32 b)
80
87
* position in the registers of arguments, the double precision version can
81
88
* go here too ;-)
82
89
*/
90
+ float32 __negsf2 (float32 x );
83
91
float32 __negsf2 (float32 x )
84
92
{
85
93
return x ^ 0x80000000 ;
@@ -88,42 +96,50 @@ float32 __negsf2(float32 x)
88
96
/*
89
97
* 32-bit operations.
90
98
*/
99
+ float32 __addsf3 (float32 a , float32 b );
91
100
float32 __addsf3 (float32 a , float32 b )
92
101
{
93
102
return float32_add (a , b );
94
103
}
95
104
105
+ float32 __subsf3 (float32 a , float32 b );
96
106
float32 __subsf3 (float32 a , float32 b )
97
107
{
98
108
return float32_sub (a , b );
99
109
}
100
110
111
+ float32 __mulsf3 (float32 a , float32 b );
101
112
float32 __mulsf3 (float32 a , float32 b )
102
113
{
103
114
return float32_mul (a , b );
104
115
}
105
116
117
+ float32 __divsf3 (float32 a , float32 b );
106
118
float32 __divsf3 (float32 a , float32 b )
107
119
{
108
120
return float32_div (a , b );
109
121
}
110
122
123
+ float32 __floatsisf (int x );
111
124
float32 __floatsisf (int x )
112
125
{
113
126
return int32_to_float32 (x );
114
127
}
115
128
129
+ int __fixsfsi (float32 x );
116
130
int __fixsfsi (float32 x )
117
131
{
118
132
return float32_to_int32_round_to_zero (x );
119
133
}
120
134
135
+ unsigned int __fixunssfsi (float32 x );
121
136
unsigned int __fixunssfsi (float32 x )
122
137
{
123
138
return float32_to_int32_round_to_zero (x ); // XXX
124
139
}
125
140
126
- int __unordsf2 (float32 a , float32 b )
141
+ flag __unordsf2 (float32 a , float32 b );
142
+ flag __unordsf2 (float32 a , float32 b )
127
143
{
128
144
/*
129
145
* The comparison is unordered if either input is a NaN.
0 commit comments