ieee754dp.h (2209bcb1310ffa9ee1af12573f1413581c712b15) ieee754dp.h (47fa0c0251413db66a9018fbac6f6266201195ae)
1/*
2 * IEEE754 floating point
3 * double precision internal header file
4 */
5/*
6 * MIPS floating point support
7 * Copyright (C) 1994-2000 Algorithmics Ltd.
8 *

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

27#include <linux/compiler.h>
28
29#include "ieee754int.h"
30
31#define assert(expr) ((void)0)
32
33/* 3bit extended double precision sticky right shift */
34#define XDPSRS(v,rs) \
1/*
2 * IEEE754 floating point
3 * double precision internal header file
4 */
5/*
6 * MIPS floating point support
7 * Copyright (C) 1994-2000 Algorithmics Ltd.
8 *

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

27#include <linux/compiler.h>
28
29#include "ieee754int.h"
30
31#define assert(expr) ((void)0)
32
33/* 3bit extended double precision sticky right shift */
34#define XDPSRS(v,rs) \
35 ((rs > (DP_MBITS+3))?1:((v) >> (rs)) | ((v) << (64-(rs)) != 0))
35 ((rs > (DP_MBITS+3))?1:((v) >> (rs)) | ((v) << (64-(rs)) != 0))
36
37#define XDPSRSX1() \
36
37#define XDPSRSX1() \
38 (xe++, (xm = (xm >> 1) | (xm & 1)))
38 (xe++, (xm = (xm >> 1) | (xm & 1)))
39
40#define XDPSRS1(v) \
39
40#define XDPSRS1(v) \
41 (((v) >> 1) | ((v) & 1))
41 (((v) >> 1) | ((v) & 1))
42
43/* convert denormal to normalized with extended exponent */
44#define DPDNORMx(m,e) \
42
43/* convert denormal to normalized with extended exponent */
44#define DPDNORMx(m,e) \
45 while( (m >> DP_MBITS) == 0) { m <<= 1; e--; }
45 while ((m >> DP_MBITS) == 0) { m <<= 1; e--; }
46#define DPDNORMX DPDNORMx(xm, xe)
47#define DPDNORMY DPDNORMx(ym, ye)
48
49static inline union ieee754dp builddp(int s, int bx, u64 m)
50{
51 union ieee754dp r;
52
53 assert((s) == 0 || (s) == 1);

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

66extern int __cold ieee754si_xcpt(int, const char *, ...);
67extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
68extern union ieee754dp __cold ieee754dp_xcpt(union ieee754dp, const char *, ...);
69extern union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp, const char *, ...);
70extern union ieee754dp ieee754dp_bestnan(union ieee754dp, union ieee754dp);
71extern union ieee754dp ieee754dp_format(int, int, u64);
72
73
46#define DPDNORMX DPDNORMx(xm, xe)
47#define DPDNORMY DPDNORMx(ym, ye)
48
49static inline union ieee754dp builddp(int s, int bx, u64 m)
50{
51 union ieee754dp r;
52
53 assert((s) == 0 || (s) == 1);

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

66extern int __cold ieee754si_xcpt(int, const char *, ...);
67extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
68extern union ieee754dp __cold ieee754dp_xcpt(union ieee754dp, const char *, ...);
69extern union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp, const char *, ...);
70extern union ieee754dp ieee754dp_bestnan(union ieee754dp, union ieee754dp);
71extern union ieee754dp ieee754dp_format(int, int, u64);
72
73
74#define DPNORMRET2(s, e, m, name, a0, a1) \
75{ \
76 union ieee754dp V = ieee754dp_format(s, e, m); \
77 if(TSTX()) \
78 return ieee754dp_xcpt(V, name, a0, a1); \
79 else \
80 return V; \
74#define DPNORMRET2(s, e, m, name, a0, a1) \
75{ \
76 union ieee754dp V = ieee754dp_format(s, e, m); \
77 if (TSTX()) \
78 return ieee754dp_xcpt(V, name, a0, a1); \
79 else \
80 return V; \
81}
82
83#define DPNORMRET1(s, e, m, name, a0) DPNORMRET2(s, e, m, name, a0, a0)
81}
82
83#define DPNORMRET1(s, e, m, name, a0) DPNORMRET2(s, e, m, name, a0, a0)