ieee754dp.c (bf61c8840efe60fd8f91446860b63338fb424158) ieee754dp.c (cae55066cb1ce3f8572ddddbd3ec3c54b973a89c)
1/* IEEE754 floating point arithmetic
2 * double precision: common utilities
3 */
4/*
5 * MIPS floating point support
6 * Copyright (C) 1994-2000 Algorithmics Ltd.
7 *
8 * ########################################################################

--- 9 unchanged lines hidden (view full) ---

18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * ########################################################################
24 */
25
1/* IEEE754 floating point arithmetic
2 * double precision: common utilities
3 */
4/*
5 * MIPS floating point support
6 * Copyright (C) 1994-2000 Algorithmics Ltd.
7 *
8 * ########################################################################

--- 9 unchanged lines hidden (view full) ---

18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * ########################################################################
24 */
25
26#include <linux/compiler.h>
26
27#include "ieee754dp.h"
28
29int ieee754dp_class(ieee754dp x)
30{
31 COMPXDP;
32 EXPLODEXDP;
33 return xc;

--- 6 unchanged lines hidden (view full) ---

40
41int ieee754dp_issnan(ieee754dp x)
42{
43 assert(ieee754dp_isnan(x));
44 return ((DPMANT(x) & DP_MBIT(DP_MBITS-1)) == DP_MBIT(DP_MBITS-1));
45}
46
47
27
28#include "ieee754dp.h"
29
30int ieee754dp_class(ieee754dp x)
31{
32 COMPXDP;
33 EXPLODEXDP;
34 return xc;

--- 6 unchanged lines hidden (view full) ---

41
42int ieee754dp_issnan(ieee754dp x)
43{
44 assert(ieee754dp_isnan(x));
45 return ((DPMANT(x) & DP_MBIT(DP_MBITS-1)) == DP_MBIT(DP_MBITS-1));
46}
47
48
48ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...)
49ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...)
49{
50 struct ieee754xctx ax;
51 if (!TSTX())
52 return r;
53
54 ax.op = op;
55 ax.rt = IEEE754_RT_DP;
56 ax.rv.dp = r;
57 va_start(ax.ap, op);
58 ieee754_xcpt(&ax);
59 va_end(ax.ap);
60 return ax.rv.dp;
61}
62
50{
51 struct ieee754xctx ax;
52 if (!TSTX())
53 return r;
54
55 ax.op = op;
56 ax.rt = IEEE754_RT_DP;
57 ax.rv.dp = r;
58 va_start(ax.ap, op);
59 ieee754_xcpt(&ax);
60 va_end(ax.ap);
61 return ax.rv.dp;
62}
63
63ieee754dp ieee754dp_nanxcpt(ieee754dp r, const char *op, ...)
64ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...)
64{
65 struct ieee754xctx ax;
66
67 assert(ieee754dp_isnan(r));
68
69 if (!ieee754dp_issnan(r)) /* QNAN does not cause invalid op !! */
70 return r;
71

--- 172 unchanged lines hidden ---
65{
66 struct ieee754xctx ax;
67
68 assert(ieee754dp_isnan(r));
69
70 if (!ieee754dp_issnan(r)) /* QNAN does not cause invalid op !! */
71 return r;
72

--- 172 unchanged lines hidden ---