59 #define two27 C[3].d
60 #define twom26 C[4].d
61 #define twom32 C[5].d
62 #define twom64 C[6].d
63 #define huge C[7].d
64 #define tiny C[8].d
65 #define tiny2 C[9].d
66
67 static const unsigned int fsr_rm = 0xc0000000u;
68
69 /*
70 * fma for SPARC: 64-bit double precision, big-endian
71 */
72 double
73 __fma(double x, double y, double z) {
74 union {
75 unsigned i[2];
76 double d;
77 } xx, yy, zz;
78 double xhi, yhi, xlo, ylo, t;
79 unsigned int xy0, xy1, xy2, xy3, z0, z1, z2, z3, rm, sticky;
80 unsigned int fsr;
81 int hx, hy, hz, ex, ey, ez, exy, sxy, sz, e, ibit;
82 volatile double dummy;
83
84 /* extract the high order words of the arguments */
85 xx.d = x;
86 yy.d = y;
87 zz.d = z;
88 hx = xx.i[0] & ~0x80000000;
89 hy = yy.i[0] & ~0x80000000;
90 hz = zz.i[0] & ~0x80000000;
91
92 /* dispense with inf, nan, and zero cases */
93 if (hx >= 0x7ff00000 || hy >= 0x7ff00000 || (hx | xx.i[1]) == 0 ||
94 (hy | yy.i[1]) == 0) /* x or y is inf, nan, or zero */
95 return (x * y + z);
96
97 if (hz >= 0x7ff00000) /* z is inf or nan */
98 return (x + z); /* avoid spurious under/overflow in x * y */
99
100 if ((hz | zz.i[1]) == 0) /* z is zero */
|
59 #define two27 C[3].d
60 #define twom26 C[4].d
61 #define twom32 C[5].d
62 #define twom64 C[6].d
63 #define huge C[7].d
64 #define tiny C[8].d
65 #define tiny2 C[9].d
66
67 static const unsigned int fsr_rm = 0xc0000000u;
68
69 /*
70 * fma for SPARC: 64-bit double precision, big-endian
71 */
72 double
73 __fma(double x, double y, double z) {
74 union {
75 unsigned i[2];
76 double d;
77 } xx, yy, zz;
78 double xhi, yhi, xlo, ylo, t;
79 unsigned int xy0, xy1, xy2, xy3, z0, z1, z2, z3, fsr, rm, sticky;
80 int hx, hy, hz, ex, ey, ez, exy, sxy, sz, e, ibit;
81 volatile double dummy;
82
83 /* extract the high order words of the arguments */
84 xx.d = x;
85 yy.d = y;
86 zz.d = z;
87 hx = xx.i[0] & ~0x80000000;
88 hy = yy.i[0] & ~0x80000000;
89 hz = zz.i[0] & ~0x80000000;
90
91 /* dispense with inf, nan, and zero cases */
92 if (hx >= 0x7ff00000 || hy >= 0x7ff00000 || (hx | xx.i[1]) == 0 ||
93 (hy | yy.i[1]) == 0) /* x or y is inf, nan, or zero */
94 return (x * y + z);
95
96 if (hz >= 0x7ff00000) /* z is inf or nan */
97 return (x + z); /* avoid spurious under/overflow in x * y */
98
99 if ((hz | zz.i[1]) == 0) /* z is zero */
|