2
$Id: neg-01.c,v 1.1 2007/02/05 21:35:58 dmix Exp $
13
volatile union lofl_u v = { .lo = 1 };
15
PROGMEM const struct { /* Table of test cases: x, -x */
20
{ { 0x00000000 }, { 0x80000000 } },
21
{ { 0x80000000 }, { 0x00000000 } },
24
{ { 0x00000001 }, { 0x80000001 } },
25
{ { 0x007fffff }, { 0x807fffff } },
26
{ { 0x00800000 }, { 0x80800000 } },
27
{ { 0x7f7fffff }, { 0xff7fffff } },
28
{ { 0x80000001 }, { 0x00000001 } },
29
{ { 0x807fffff }, { 0x007fffff } },
30
{ { 0x80800000 }, { 0x00800000 } },
31
{ { 0xff7fffff }, { 0x7f7fffff } },
34
{ { 0x7f800000 }, { 0xff800000 } },
35
{ { 0xff800000 }, { 0x7f800000 } },
38
void x_exit (int index)
41
fprintf (stderr, "t[%d]: %#lx\n", index - 1, v.lo);
43
exit (index ? index : -1);
51
for (i = 0; i < (int) (sizeof(t) / sizeof(t[0])); i++) {
52
x.lo = pgm_read_dword (& t[i].x);
53
z.lo = pgm_read_dword (& t[i].z);
59
/* Forse to use fplib's function. */
60
extern float __negsf2 (float);
61
v.fl = __negsf2 (x.fl);