VirtualBox

source: vbox/trunk/src/libs/softfloat-3e/testfloat/source/slowfloat.h@ 106842

Last change on this file since 106842 was 94551, checked in by vboxsync, 3 years ago

libs/softfloat: Copied TestFloat-3e from vendor branch and to testfloat subdir. bugref:9898

  • Property svn:eol-style set to native
File size: 11.5 KB
Line 
1
2/*============================================================================
3
4This C header file is part of TestFloat, Release 3e, a package of programs for
5testing the correctness of floating-point arithmetic complying with the IEEE
6Standard for Floating-Point, by John R. Hauser.
7
8Copyright 2011, 2012, 2013, 2014, 2015, 2017 The Regents of the University of
9California. All rights reserved.
10
11Redistribution and use in source and binary forms, with or without
12modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions of source code must retain the above copyright notice,
15 this list of conditions, and the following disclaimer.
16
17 2. Redistributions in binary form must reproduce the above copyright notice,
18 this list of conditions, and the following disclaimer in the documentation
19 and/or other materials provided with the distribution.
20
21 3. Neither the name of the University nor the names of its contributors may
22 be used to endorse or promote products derived from this software without
23 specific prior written permission.
24
25THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
26EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
28DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
29DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
36=============================================================================*/
37
38#include <stdbool.h>
39#include <stdint.h>
40#include "softfloat.h"
41
42extern uint_fast8_t slowfloat_roundingMode;
43extern uint_fast8_t slowfloat_detectTininess;
44extern uint_fast8_t slowfloat_exceptionFlags;
45#ifdef EXTFLOAT80
46extern uint_fast8_t slow_extF80_roundingPrecision;
47#endif
48
49#ifdef FLOAT16
50float16_t slow_ui32_to_f16( uint32_t );
51#endif
52float32_t slow_ui32_to_f32( uint32_t );
53#ifdef FLOAT64
54float64_t slow_ui32_to_f64( uint32_t );
55#endif
56#ifdef EXTFLOAT80
57void slow_ui32_to_extF80M( uint32_t, extFloat80_t * );
58#endif
59#ifdef FLOAT128
60void slow_ui32_to_f128M( uint32_t, float128_t * );
61#endif
62#ifdef FLOAT16
63float16_t slow_ui64_to_f16( uint64_t );
64#endif
65float32_t slow_ui64_to_f32( uint64_t );
66#ifdef FLOAT64
67float64_t slow_ui64_to_f64( uint64_t );
68#endif
69#ifdef EXTFLOAT80
70void slow_ui64_to_extF80M( uint64_t, extFloat80_t * );
71#endif
72#ifdef FLOAT128
73void slow_ui64_to_f128M( uint64_t, float128_t * );
74#endif
75#ifdef FLOAT16
76float16_t slow_i32_to_f16( int32_t );
77#endif
78float32_t slow_i32_to_f32( int32_t );
79#ifdef FLOAT64
80float64_t slow_i32_to_f64( int32_t );
81#endif
82#ifdef EXTFLOAT80
83void slow_i32_to_extF80M( int32_t, extFloat80_t * );
84#endif
85#ifdef FLOAT128
86void slow_i32_to_f128M( int32_t, float128_t * );
87#endif
88#ifdef FLOAT16
89float16_t slow_i64_to_f16( int64_t );
90#endif
91float32_t slow_i64_to_f32( int64_t );
92#ifdef FLOAT64
93float64_t slow_i64_to_f64( int64_t );
94#endif
95#ifdef EXTFLOAT80
96void slow_i64_to_extF80M( int64_t, extFloat80_t * );
97#endif
98#ifdef FLOAT128
99void slow_i64_to_f128M( int64_t, float128_t * );
100#endif
101
102#ifdef FLOAT16
103uint_fast32_t slow_f16_to_ui32( float16_t, uint_fast8_t, bool );
104uint_fast64_t slow_f16_to_ui64( float16_t, uint_fast8_t, bool );
105int_fast32_t slow_f16_to_i32( float16_t, uint_fast8_t, bool );
106int_fast64_t slow_f16_to_i64( float16_t, uint_fast8_t, bool );
107uint_fast32_t slow_f16_to_ui32_r_minMag( float16_t, bool );
108uint_fast64_t slow_f16_to_ui64_r_minMag( float16_t, bool );
109int_fast32_t slow_f16_to_i32_r_minMag( float16_t, bool );
110int_fast64_t slow_f16_to_i64_r_minMag( float16_t, bool );
111float32_t slow_f16_to_f32( float16_t );
112#ifdef FLOAT64
113float64_t slow_f16_to_f64( float16_t );
114#endif
115#ifdef EXTFLOAT80
116void slow_f16_to_extF80M( float16_t, extFloat80_t * );
117#endif
118#ifdef FLOAT128
119void slow_f16_to_f128M( float16_t, float128_t * );
120#endif
121float16_t slow_f16_roundToInt( float16_t, uint_fast8_t, bool );
122float16_t slow_f16_add( float16_t, float16_t );
123float16_t slow_f16_sub( float16_t, float16_t );
124float16_t slow_f16_mul( float16_t, float16_t );
125float16_t slow_f16_mulAdd( float16_t, float16_t, float16_t );
126float16_t slow_f16_div( float16_t, float16_t );
127float16_t slow_f16_rem( float16_t, float16_t );
128float16_t slow_f16_sqrt( float16_t );
129bool slow_f16_eq( float16_t, float16_t );
130bool slow_f16_le( float16_t, float16_t );
131bool slow_f16_lt( float16_t, float16_t );
132bool slow_f16_eq_signaling( float16_t, float16_t );
133bool slow_f16_le_quiet( float16_t, float16_t );
134bool slow_f16_lt_quiet( float16_t, float16_t );
135#endif
136
137uint_fast32_t slow_f32_to_ui32( float32_t, uint_fast8_t, bool );
138uint_fast64_t slow_f32_to_ui64( float32_t, uint_fast8_t, bool );
139int_fast32_t slow_f32_to_i32( float32_t, uint_fast8_t, bool );
140int_fast64_t slow_f32_to_i64( float32_t, uint_fast8_t, bool );
141uint_fast32_t slow_f32_to_ui32_r_minMag( float32_t, bool );
142uint_fast64_t slow_f32_to_ui64_r_minMag( float32_t, bool );
143int_fast32_t slow_f32_to_i32_r_minMag( float32_t, bool );
144int_fast64_t slow_f32_to_i64_r_minMag( float32_t, bool );
145#ifdef FLOAT16
146float16_t slow_f32_to_f16( float32_t );
147#endif
148#ifdef FLOAT64
149float64_t slow_f32_to_f64( float32_t );
150#endif
151#ifdef EXTFLOAT80
152void slow_f32_to_extF80M( float32_t, extFloat80_t * );
153#endif
154#ifdef FLOAT128
155void slow_f32_to_f128M( float32_t, float128_t * );
156#endif
157float32_t slow_f32_roundToInt( float32_t, uint_fast8_t, bool );
158float32_t slow_f32_add( float32_t, float32_t );
159float32_t slow_f32_sub( float32_t, float32_t );
160float32_t slow_f32_mul( float32_t, float32_t );
161float32_t slow_f32_mulAdd( float32_t, float32_t, float32_t );
162float32_t slow_f32_div( float32_t, float32_t );
163float32_t slow_f32_rem( float32_t, float32_t );
164float32_t slow_f32_sqrt( float32_t );
165bool slow_f32_eq( float32_t, float32_t );
166bool slow_f32_le( float32_t, float32_t );
167bool slow_f32_lt( float32_t, float32_t );
168bool slow_f32_eq_signaling( float32_t, float32_t );
169bool slow_f32_le_quiet( float32_t, float32_t );
170bool slow_f32_lt_quiet( float32_t, float32_t );
171
172#ifdef FLOAT64
173uint_fast32_t slow_f64_to_ui32( float64_t, uint_fast8_t, bool );
174uint_fast64_t slow_f64_to_ui64( float64_t, uint_fast8_t, bool );
175int_fast32_t slow_f64_to_i32( float64_t, uint_fast8_t, bool );
176int_fast64_t slow_f64_to_i64( float64_t, uint_fast8_t, bool );
177uint_fast32_t slow_f64_to_ui32_r_minMag( float64_t, bool );
178uint_fast64_t slow_f64_to_ui64_r_minMag( float64_t, bool );
179int_fast32_t slow_f64_to_i32_r_minMag( float64_t, bool );
180int_fast64_t slow_f64_to_i64_r_minMag( float64_t, bool );
181#ifdef FLOAT16
182float16_t slow_f64_to_f16( float64_t );
183#endif
184float32_t slow_f64_to_f32( float64_t );
185#ifdef EXTFLOAT80
186void slow_f64_to_extF80M( float64_t, extFloat80_t * );
187#endif
188#ifdef FLOAT128
189void slow_f64_to_f128M( float64_t, float128_t * );
190#endif
191float64_t slow_f64_roundToInt( float64_t, uint_fast8_t, bool );
192float64_t slow_f64_add( float64_t, float64_t );
193float64_t slow_f64_sub( float64_t, float64_t );
194float64_t slow_f64_mul( float64_t, float64_t );
195float64_t slow_f64_mulAdd( float64_t, float64_t, float64_t );
196float64_t slow_f64_div( float64_t, float64_t );
197float64_t slow_f64_rem( float64_t, float64_t );
198float64_t slow_f64_sqrt( float64_t );
199bool slow_f64_eq( float64_t, float64_t );
200bool slow_f64_le( float64_t, float64_t );
201bool slow_f64_lt( float64_t, float64_t );
202bool slow_f64_eq_signaling( float64_t, float64_t );
203bool slow_f64_le_quiet( float64_t, float64_t );
204bool slow_f64_lt_quiet( float64_t, float64_t );
205#endif
206
207#ifdef EXTFLOAT80
208uint_fast32_t slow_extF80M_to_ui32( const extFloat80_t *, uint_fast8_t, bool );
209uint_fast64_t slow_extF80M_to_ui64( const extFloat80_t *, uint_fast8_t, bool );
210int_fast32_t slow_extF80M_to_i32( const extFloat80_t *, uint_fast8_t, bool );
211int_fast64_t slow_extF80M_to_i64( const extFloat80_t *, uint_fast8_t, bool );
212uint_fast32_t slow_extF80M_to_ui32_r_minMag( const extFloat80_t *, bool );
213uint_fast64_t slow_extF80M_to_ui64_r_minMag( const extFloat80_t *, bool );
214int_fast32_t slow_extF80M_to_i32_r_minMag( const extFloat80_t *, bool );
215int_fast64_t slow_extF80M_to_i64_r_minMag( const extFloat80_t *, bool );
216#ifdef FLOAT16
217float16_t slow_extF80M_to_f16( const extFloat80_t * );
218#endif
219float32_t slow_extF80M_to_f32( const extFloat80_t * );
220#ifdef FLOAT64
221float64_t slow_extF80M_to_f64( const extFloat80_t * );
222#endif
223#ifdef FLOAT128
224void slow_extF80M_to_f128M( const extFloat80_t *, float128_t * );
225#endif
226void
227 slow_extF80M_roundToInt(
228 const extFloat80_t *, uint_fast8_t, bool, extFloat80_t * );
229void
230 slow_extF80M_add(
231 const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
232void
233 slow_extF80M_sub(
234 const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
235void
236 slow_extF80M_mul(
237 const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
238void
239 slow_extF80M_mulAdd(
240 const extFloat80_t *,
241 const extFloat80_t *,
242 const extFloat80_t *,
243 extFloat80_t *
244 );
245void
246 slow_extF80M_div(
247 const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
248void
249 slow_extF80M_rem(
250 const extFloat80_t *, const extFloat80_t *, extFloat80_t * );
251void slow_extF80M_sqrt( const extFloat80_t *, extFloat80_t * );
252bool slow_extF80M_eq( const extFloat80_t *, const extFloat80_t * );
253bool slow_extF80M_le( const extFloat80_t *, const extFloat80_t * );
254bool slow_extF80M_lt( const extFloat80_t *, const extFloat80_t * );
255bool slow_extF80M_eq_signaling( const extFloat80_t *, const extFloat80_t * );
256bool slow_extF80M_le_quiet( const extFloat80_t *, const extFloat80_t * );
257bool slow_extF80M_lt_quiet( const extFloat80_t *, const extFloat80_t * );
258#endif
259
260#ifdef FLOAT128
261uint_fast32_t slow_f128M_to_ui32( const float128_t *, uint_fast8_t, bool );
262uint_fast64_t slow_f128M_to_ui64( const float128_t *, uint_fast8_t, bool );
263int_fast32_t slow_f128M_to_i32( const float128_t *, uint_fast8_t, bool );
264int_fast64_t slow_f128M_to_i64( const float128_t *, uint_fast8_t, bool );
265uint_fast32_t slow_f128M_to_ui32_r_minMag( const float128_t *, bool );
266uint_fast64_t slow_f128M_to_ui64_r_minMag( const float128_t *, bool );
267int_fast32_t slow_f128M_to_i32_r_minMag( const float128_t *, bool );
268int_fast64_t slow_f128M_to_i64_r_minMag( const float128_t *, bool );
269#ifdef FLOAT16
270float16_t slow_f128M_to_f16( const float128_t * );
271#endif
272float32_t slow_f128M_to_f32( const float128_t * );
273#ifdef FLOAT64
274float64_t slow_f128M_to_f64( const float128_t * );
275#endif
276#ifdef EXTFLOAT80
277void slow_f128M_to_extF80M( const float128_t *, extFloat80_t * );
278#endif
279void
280 slow_f128M_roundToInt( const float128_t *, uint_fast8_t, bool, float128_t * );
281void slow_f128M_add( const float128_t *, const float128_t *, float128_t * );
282void slow_f128M_sub( const float128_t *, const float128_t *, float128_t * );
283void slow_f128M_mul( const float128_t *, const float128_t *, float128_t * );
284void
285 slow_f128M_mulAdd(
286 const float128_t *, const float128_t *, const float128_t *, float128_t *
287 );
288void slow_f128M_div( const float128_t *, const float128_t *, float128_t * );
289void slow_f128M_rem( const float128_t *, const float128_t *, float128_t * );
290void slow_f128M_sqrt( const float128_t *, float128_t * );
291bool slow_f128M_eq( const float128_t *, const float128_t * );
292bool slow_f128M_le( const float128_t *, const float128_t * );
293bool slow_f128M_lt( const float128_t *, const float128_t * );
294bool slow_f128M_eq_signaling( const float128_t *, const float128_t * );
295bool slow_f128M_le_quiet( const float128_t *, const float128_t * );
296bool slow_f128M_lt_quiet( const float128_t *, const float128_t * );
297#endif
298
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette