~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to fpu/softfloat-native.h

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include <fenv.h>
9
9
#endif
10
10
 
 
11
#if defined(__OpenBSD__) || defined(__NetBSD__)
 
12
#include <sys/param.h>
 
13
#endif
 
14
 
11
15
/*
12
16
 * Define some C99-7.12.3 classification macros and
13
17
 *        some C99-.12.4 for Solaris systems OS less than 10,
15
19
 *   Solaris 10 with GCC4 does not need these macros as they
16
20
 *   are defined in <iso/math_c99.h> with a compiler directive
17
21
 */
18
 
#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ((HOST_SOLARIS >= 10) && (__GNUC__ <= 4)))
 
22
#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ((HOST_SOLARIS >= 10) \
 
23
                                                        && (__GNUC__ <= 4))) \
 
24
    || (defined(__OpenBSD__) && (OpenBSD < 200811))
19
25
/*
20
26
 * C99 7.12.3 classification macros
21
27
 * and
24
30
 * ... do not work on Solaris 10 using GNU CC 3.4.x.
25
31
 * Try to workaround the missing / broken C99 math macros.
26
32
 */
 
33
#if defined(__OpenBSD__)
 
34
#define unordered(x, y) (isnan(x) || isnan(y))
 
35
#endif
 
36
 
 
37
#ifdef __NetBSD__
 
38
#ifndef isgreater
 
39
#define isgreater(x, y)         __builtin_isgreater(x, y)
 
40
#endif
 
41
#ifndef isgreaterequal
 
42
#define isgreaterequal(x, y)    __builtin_isgreaterequal(x, y)
 
43
#endif
 
44
#ifndef isless
 
45
#define isless(x, y)            __builtin_isless(x, y)
 
46
#endif
 
47
#ifndef islessequal
 
48
#define islessequal(x, y)       __builtin_islessequal(x, y)
 
49
#endif
 
50
#ifndef isunordered
 
51
#define isunordered(x, y)       __builtin_isunordered(x, y)
 
52
#endif
 
53
#endif
 
54
 
27
55
 
28
56
#define isnormal(x)             (fpclass(x) >= FP_NZERO)
29
57
#define isgreater(x, y)         ((!unordered(x, y)) && ((x) > (y)))
84
112
| Software IEC/IEEE floating-point rounding mode.
85
113
*----------------------------------------------------------------------------*/
86
114
#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
 
115
#if defined(__OpenBSD__)
 
116
#define FE_RM FP_RM
 
117
#define FE_RP FP_RP
 
118
#define FE_RZ FP_RZ
 
119
#endif
87
120
enum {
88
121
    float_round_nearest_even = FP_RN,
89
122
    float_round_down         = FP_RM,
107
140
#endif
108
141
 
109
142
typedef struct float_status {
110
 
    signed char float_rounding_mode;
 
143
    int float_rounding_mode;
111
144
#ifdef FLOATX80
112
 
    signed char floatx80_rounding_precision;
 
145
    int floatx80_rounding_precision;
113
146
#endif
114
147
} float_status;
115
148
 
213
246
int float32_compare( float32, float32 STATUS_PARAM );
214
247
int float32_compare_quiet( float32, float32 STATUS_PARAM );
215
248
int float32_is_signaling_nan( float32 );
 
249
int float32_is_nan( float32 );
216
250
 
217
251
INLINE float32 float32_abs(float32 a)
218
252
{
224
258
    return -a;
225
259
}
226
260
 
 
261
INLINE float32 float32_is_infinity(float32 a)
 
262
{
 
263
    return fpclassify(a) == FP_INFINITE;
 
264
}
 
265
 
 
266
INLINE float32 float32_is_neg(float32 a)
 
267
{
 
268
    float32u u;
 
269
    u.f = a;
 
270
    return u.i >> 31;
 
271
}
 
272
 
 
273
INLINE float32 float32_is_zero(float32 a)
 
274
{
 
275
    return fpclassify(a) == FP_ZERO;
 
276
}
 
277
 
227
278
INLINE float32 float32_scalbn(float32 a, int n)
228
279
{
229
280
    return scalbnf(a, n);
316
367
    return -a;
317
368
}
318
369
 
 
370
INLINE float64 float64_is_infinity(float64 a)
 
371
{
 
372
    return fpclassify(a) == FP_INFINITE;
 
373
}
 
374
 
 
375
INLINE float64 float64_is_neg(float64 a)
 
376
{
 
377
    float64u u;
 
378
    u.f = a;
 
379
    return u.i >> 63;
 
380
}
 
381
 
 
382
INLINE float64 float64_is_zero(float64 a)
 
383
{
 
384
    return fpclassify(a) == FP_ZERO;
 
385
}
 
386
 
319
387
INLINE float64 float64_scalbn(float64 a, int n)
320
388
{
321
389
    return scalbn(a, n);
391
459
int floatx80_compare( floatx80, floatx80 STATUS_PARAM );
392
460
int floatx80_compare_quiet( floatx80, floatx80 STATUS_PARAM );
393
461
int floatx80_is_signaling_nan( floatx80 );
 
462
int floatx80_is_nan( floatx80 );
394
463
 
395
464
INLINE floatx80 floatx80_abs(floatx80 a)
396
465
{
402
471
    return -a;
403
472
}
404
473
 
 
474
INLINE floatx80 floatx80_is_infinity(floatx80 a)
 
475
{
 
476
    return fpclassify(a) == FP_INFINITE;
 
477
}
 
478
 
 
479
INLINE floatx80 floatx80_is_neg(floatx80 a)
 
480
{
 
481
    floatx80u u;
 
482
    u.f = a;
 
483
    return u.i.high >> 15;
 
484
}
 
485
 
 
486
INLINE floatx80 floatx80_is_zero(floatx80 a)
 
487
{
 
488
    return fpclassify(a) == FP_ZERO;
 
489
}
 
490
 
405
491
INLINE floatx80 floatx80_scalbn(floatx80 a, int n)
406
492
{
407
493
    return scalbnl(a, n);