1
/* Test of __unordsf2() function (used by GCC 4.3.0), NaNs.
2
$Id: unord-03.c,v 1.1.2.2 2008/03/22 04:13:14 dmix Exp $
9
extern int __unordsf2 (float, float);
10
# define UNORDSF2 __unordsf2
14
# define UNORDSF2 isunordered
15
# define EXIT(x) exit ((x) < 255 ? (x) : 255)
23
PROGMEM const struct { /* Table of test cases. */
25
unsigned char z; /* result */
29
{ { 0x7f800001 }, { 0x3f800000 }, 1 },
30
{ { 0x7f800100 }, { 0x3f800000 }, 1 },
31
{ { 0x7f810000 }, { 0x3f800000 }, 1 },
32
{ { 0x7fffffff }, { 0x3f800000 }, 1 },
33
{ { 0xff800001 }, { 0x3f800000 }, 1 },
34
{ { 0xff800100 }, { 0x3f800000 }, 1 },
35
{ { 0xff810000 }, { 0x3f800000 }, 1 },
36
{ { 0xffffffff }, { 0x3f800000 }, 1 },
39
{ { 0x3f800000 }, { 0x7f800001 }, 1 },
40
{ { 0x3f800000 }, { 0x7f800100 }, 1 },
41
{ { 0x3f800000 }, { 0x7f810000 }, 1 },
42
{ { 0x3f800000 }, { 0x7fffffff }, 1 },
43
{ { 0x3f800000 }, { 0xff800001 }, 1 },
44
{ { 0x3f800000 }, { 0xff800100 }, 1 },
45
{ { 0x3f800000 }, { 0xff810000 }, 1 },
46
{ { 0x3f800000 }, { 0xffffffff }, 1 },
48
/* NaN and normal/Inf */
49
{ { 0x7fc00000 }, { 0xff800000 }, 1 },
50
{ { 0x7fc00000 }, { 0xff7fffff }, 1 },
51
{ { 0x7fc00000 }, { 0x80800000 }, 1 },
52
{ { 0x7fc00000 }, { 0x807fffff }, 1 },
53
{ { 0x7fc00000 }, { 0x80000001 }, 1 },
54
{ { 0x7fc00000 }, { 0x80000000 }, 1 },
55
{ { 0x7fc00000 }, { 0x00000000 }, 1 },
56
{ { 0x7fc00000 }, { 0x00000001 }, 1 },
57
{ { 0x7fc00000 }, { 0x007fffff }, 1 },
58
{ { 0x7fc00000 }, { 0x00800000 }, 1 },
59
{ { 0x7fc00000 }, { 0x7f7fffff }, 1 },
60
{ { 0x7fc00000 }, { 0x7f800000 }, 1 },
62
/* normal/Inf and NaN */
63
{ { 0xff800000 }, { 0x7fc00000 }, 1 },
64
{ { 0xff7fffff }, { 0x7fc00000 }, 1 },
65
{ { 0x80800000 }, { 0x7fc00000 }, 1 },
66
{ { 0x807fffff }, { 0x7fc00000 }, 1 },
67
{ { 0x80000001 }, { 0x7fc00000 }, 1 },
68
{ { 0x80000000 }, { 0x7fc00000 }, 1 },
69
{ { 0x00000000 }, { 0x7fc00000 }, 1 },
70
{ { 0x00000001 }, { 0x7fc00000 }, 1 },
71
{ { 0x007fffff }, { 0x7fc00000 }, 1 },
72
{ { 0x00800000 }, { 0x7fc00000 }, 1 },
73
{ { 0x7f7fffff }, { 0x7fc00000 }, 1 },
74
{ { 0x7f800000 }, { 0x7fc00000 }, 1 },
77
{ { 0x7f800001 }, { 0x7f800001 }, 1 },
78
{ { 0xffffffff }, { 0xffffffff }, 1 },
79
{ { 0x7fc00000 }, { 0xffc00000 }, 1 },
80
{ { 0xffc00000 }, { 0x7fc00000 }, 1 },
83
volatile union lofl_u x, y;
90
for (i = 0; i < (int) (sizeof(t) / sizeof(t[0])); i++) {
91
x.lo = pgm_read_dword (& t[i].x);
92
y.lo = pgm_read_dword (& t[i].y);
93
z = UNORDSF2 (x.fl, y.fl) ? 1 : 0;
94
if (z != pgm_read_byte (& t[i].z))