/Linux-v5.4/arch/mips/math-emu/ |
D | ieee754dp.c | 56 static u64 ieee754dp_get_rounding(int sn, u64 xm) in ieee754dp_get_rounding() argument 60 if (xm & (DP_MBIT(3) - 1)) { in ieee754dp_get_rounding() 65 xm += 0x3 + ((xm >> 3) & 1); in ieee754dp_get_rounding() 70 xm += 0x8; in ieee754dp_get_rounding() 74 xm += 0x8; in ieee754dp_get_rounding() 78 return xm; in ieee754dp_get_rounding() 87 union ieee754dp ieee754dp_format(int sn, int xe, u64 xm) in ieee754dp_format() argument 89 assert(xm); /* we don't gen exact zeros (probably should) */ in ieee754dp_format() 91 assert((xm >> (DP_FBITS + 1 + 3)) == 0); /* no excess */ in ieee754dp_format() 92 assert(xm & (DP_HIDDEN_BIT << 3)); in ieee754dp_format() [all …]
|
D | ieee754sp.c | 56 static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm) in ieee754sp_get_rounding() argument 60 if (xm & (SP_MBIT(3) - 1)) { in ieee754sp_get_rounding() 65 xm += 0x3 + ((xm >> 3) & 1); in ieee754sp_get_rounding() 70 xm += 0x8; in ieee754sp_get_rounding() 74 xm += 0x8; in ieee754sp_get_rounding() 78 return xm; in ieee754sp_get_rounding() 87 union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm) in ieee754sp_format() argument 89 assert(xm); /* we don't gen exact zeros (probably should) */ in ieee754sp_format() 91 assert((xm >> (SP_FBITS + 1 + 3)) == 0); /* no excess */ in ieee754sp_format() 92 assert(xm & (SP_HIDDEN_BIT << 3)); in ieee754sp_format() [all …]
|
D | dp_tint.c | 51 xm <<= xe - DP_FBITS; in ieee754dp_tint() 54 residue = xm; in ieee754dp_tint() 57 xm = 0; in ieee754dp_tint() 59 residue = xm << (64 - DP_FBITS + xe); in ieee754dp_tint() 62 xm >>= DP_FBITS - xe; in ieee754dp_tint() 66 odd = (xm & 0x1) != 0x0; in ieee754dp_tint() 70 xm++; in ieee754dp_tint() 76 xm++; in ieee754dp_tint() 80 xm++; in ieee754dp_tint() 84 if ((xm >> 31) != 0 && (xs == 0 || xm != 0x80000000)) { in ieee754dp_tint() [all …]
|
D | dp_tlong.c | 45 if (xe == 63 && xs && xm == DP_HIDDEN_BIT) in ieee754dp_tlong() 54 xm <<= xe - DP_FBITS; in ieee754dp_tlong() 57 residue = xm; in ieee754dp_tlong() 60 xm = 0; in ieee754dp_tlong() 65 residue = xm << (xe + 1); in ieee754dp_tlong() 69 xm >>= DP_FBITS - xe; in ieee754dp_tlong() 71 odd = (xm & 0x1) != 0x0; in ieee754dp_tlong() 75 xm++; in ieee754dp_tlong() 81 xm++; in ieee754dp_tlong() 85 xm++; in ieee754dp_tlong() [all …]
|
D | sp_tint.c | 45 if (xe == 31 && xs && xm == SP_HIDDEN_BIT) in ieee754sp_tint() 54 xm <<= xe - SP_FBITS; in ieee754sp_tint() 57 residue = xm; in ieee754sp_tint() 60 xm = 0; in ieee754sp_tint() 65 residue = xm << (xe + 1); in ieee754sp_tint() 69 xm >>= SP_FBITS - xe; in ieee754sp_tint() 71 odd = (xm & 0x1) != 0x0; in ieee754sp_tint() 75 xm++; in ieee754sp_tint() 81 xm++; in ieee754sp_tint() 85 xm++; in ieee754sp_tint() [all …]
|
D | sp_tlong.c | 45 if (xe == 63 && xs && xm == SP_HIDDEN_BIT) in ieee754sp_tlong() 54 xm <<= xe - SP_FBITS; in ieee754sp_tlong() 57 residue = xm; in ieee754sp_tlong() 60 xm = 0; in ieee754sp_tlong() 62 residue = xm << (32 - SP_FBITS + xe); in ieee754sp_tlong() 65 xm >>= SP_FBITS - xe; in ieee754sp_tlong() 67 odd = (xm & 0x1) != 0x0; in ieee754sp_tlong() 71 xm++; in ieee754sp_tlong() 77 xm++; in ieee754sp_tlong() 81 xm++; in ieee754sp_tlong() [all …]
|
D | dp_add.c | 108 assert(xm & DP_HIDDEN_BIT); in ieee754dp_add() 114 xm <<= 3; in ieee754dp_add() 129 xm = XDPSRS(xm, s); in ieee754dp_add() 140 xm = xm + ym; in ieee754dp_add() 142 if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */ in ieee754dp_add() 143 xm = XDPSRS1(xm); in ieee754dp_add() 147 if (xm >= ym) { in ieee754dp_add() 148 xm = xm - ym; in ieee754dp_add() 150 xm = ym - xm; in ieee754dp_add() 153 if (xm == 0) in ieee754dp_add() [all …]
|
D | dp_sub.c | 115 assert(xm & DP_HIDDEN_BIT); in ieee754dp_sub() 120 xm <<= 3; in ieee754dp_sub() 135 xm = XDPSRS(xm, s); in ieee754dp_sub() 144 xm = xm + ym; in ieee754dp_sub() 146 if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */ in ieee754dp_sub() 147 xm = XDPSRS1(xm); /* shift preserving sticky */ in ieee754dp_sub() 151 if (xm >= ym) { in ieee754dp_sub() 152 xm = xm - ym; in ieee754dp_sub() 154 xm = ym - xm; in ieee754dp_sub() 157 if (xm == 0) { in ieee754dp_sub() [all …]
|
D | sp_add.c | 108 assert(xm & SP_HIDDEN_BIT); in ieee754sp_add() 114 xm <<= 3; in ieee754sp_add() 129 xm = XSPSRS(xm, s); in ieee754sp_add() 140 xm = xm + ym; in ieee754sp_add() 142 if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */ in ieee754sp_add() 146 if (xm >= ym) { in ieee754sp_add() 147 xm = xm - ym; in ieee754sp_add() 149 xm = ym - xm; in ieee754sp_add() 152 if (xm == 0) in ieee754sp_add() 158 while ((xm >> (SP_FBITS + 3)) == 0) { in ieee754sp_add() [all …]
|
D | sp_sub.c | 113 assert(xm & SP_HIDDEN_BIT); in ieee754sp_sub() 118 xm <<= 3; in ieee754sp_sub() 133 xm = XSPSRS(xm, s); in ieee754sp_sub() 142 xm = xm + ym; in ieee754sp_sub() 144 if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */ in ieee754sp_sub() 148 if (xm >= ym) { in ieee754sp_sub() 149 xm = xm - ym; in ieee754sp_sub() 151 xm = ym - xm; in ieee754sp_sub() 154 if (xm == 0) { in ieee754sp_sub() 162 while ((xm >> (SP_FBITS + 3)) == 0) { in ieee754sp_sub() [all …]
|
D | sp_fint.c | 14 unsigned int xm; in ieee754sp_fint() local 30 xm = ((unsigned) 1 << 31); /* max neg can't be safely negated */ in ieee754sp_fint() 32 xm = -x; in ieee754sp_fint() 34 xm = x; in ieee754sp_fint() 38 if (xm >> (SP_FBITS + 1 + 3)) { in ieee754sp_fint() 41 while (xm >> (SP_FBITS + 1 + 3)) { in ieee754sp_fint() 47 while ((xm >> (SP_FBITS + 3)) == 0) { in ieee754sp_fint() 48 xm <<= 1; in ieee754sp_fint() 52 return ieee754sp_format(xs, xe, xm); in ieee754sp_fint()
|
D | dp_flong.c | 14 u64 xm; in ieee754dp_flong() local 30 xm = (1ULL << 63); /* max neg can't be safely negated */ in ieee754dp_flong() 32 xm = -x; in ieee754dp_flong() 34 xm = x; in ieee754dp_flong() 39 if (xm >> (DP_FBITS + 1 + 3)) { in ieee754dp_flong() 41 while (xm >> (DP_FBITS + 1 + 3)) { in ieee754dp_flong() 46 while ((xm >> (DP_FBITS + 3)) == 0) { in ieee754dp_flong() 47 xm <<= 1; in ieee754dp_flong() 52 return ieee754dp_format(xs, xe, xm); in ieee754dp_flong()
|
D | sp_flong.c | 14 u64 xm; /* <--- need 64-bit mantissa temp */ in ieee754sp_flong() local 30 xm = (1ULL << 63); /* max neg can't be safely negated */ in ieee754sp_flong() 32 xm = -x; in ieee754sp_flong() 34 xm = x; in ieee754sp_flong() 38 if (xm >> (SP_FBITS + 1 + 3)) { in ieee754sp_flong() 41 while (xm >> (SP_FBITS + 1 + 3)) { in ieee754sp_flong() 46 while ((xm >> (SP_FBITS + 3)) == 0) { in ieee754sp_flong() 47 xm <<= 1; in ieee754sp_flong() 51 return ieee754sp_format(xs, xe, xm); in ieee754sp_flong()
|
D | dp_rint.c | 41 residue = xm; in ieee754dp_rint() 44 xm = 0; in ieee754dp_rint() 46 residue = xm << (64 - DP_FBITS + xe); in ieee754dp_rint() 49 xm >>= DP_FBITS - xe; in ieee754dp_rint() 52 odd = (xm & 0x1) != 0x0; in ieee754dp_rint() 57 xm++; in ieee754dp_rint() 63 xm++; in ieee754dp_rint() 67 xm++; in ieee754dp_rint() 74 ret = ieee754dp_flong(xm); in ieee754dp_rint()
|
D | sp_rint.c | 41 residue = xm; in ieee754sp_rint() 44 xm = 0; in ieee754sp_rint() 46 residue = xm << (xe + 1); in ieee754sp_rint() 50 xm >>= SP_FBITS - xe; in ieee754sp_rint() 53 odd = (xm & 0x1) != 0x0; in ieee754sp_rint() 58 xm++; in ieee754sp_rint() 64 xm++; in ieee754sp_rint() 68 xm++; in ieee754sp_rint() 75 ret = ieee754sp_flong(xm); in ieee754sp_rint()
|
D | dp_fsp.c | 13 static inline union ieee754dp ieee754dp_nan_fsp(int xs, u64 xm) in ieee754dp_nan_fsp() argument 16 xm << (DP_FBITS - SP_FBITS)); in ieee754dp_nan_fsp() 31 return ieee754dp_nanxcpt(ieee754dp_nan_fsp(xs, xm)); in ieee754dp_fsp() 34 return ieee754dp_nan_fsp(xs, xm); in ieee754dp_fsp() 44 while ((xm >> SP_FBITS) == 0) { in ieee754dp_fsp() 45 xm <<= 1; in ieee754dp_fsp() 59 xm &= ~SP_HIDDEN_BIT; in ieee754dp_fsp() 62 (u64) xm << (DP_FBITS - SP_FBITS)); in ieee754dp_fsp()
|
D | dp_fint.c | 14 u64 xm; in ieee754dp_fint() local 30 xm = ((unsigned) 1 << 31); /* max neg can't be safely negated */ in ieee754dp_fint() 32 xm = -x; in ieee754dp_fint() 34 xm = x; in ieee754dp_fint() 39 while ((xm >> DP_FBITS) == 0) { in ieee754dp_fint() 40 xm <<= 1; in ieee754dp_fint() 43 return builddp(xs, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT); in ieee754dp_fint()
|
D | dp_div.c | 107 assert(xm & DP_HIDDEN_BIT); in ieee754dp_div() 111 xm <<= 3; in ieee754dp_div() 120 if (xm >= ym) { in ieee754dp_div() 121 xm -= ym; in ieee754dp_div() 123 if (xm == 0) in ieee754dp_div() 126 xm <<= 1; in ieee754dp_div() 130 if (xm) in ieee754dp_div()
|
D | sp_div.c | 107 assert(xm & SP_HIDDEN_BIT); in ieee754sp_div() 111 xm <<= 3; in ieee754sp_div() 120 if (xm >= ym) { in ieee754sp_div() 121 xm -= ym; in ieee754sp_div() 123 if (xm == 0) in ieee754sp_div() 126 xm <<= 1; in ieee754sp_div() 130 if (xm) in ieee754sp_div()
|
D | sp_fdp.c | 13 static inline union ieee754sp ieee754sp_nan_fdp(int xs, u64 xm) in ieee754sp_nan_fdp() argument 16 xm >> (DP_FBITS - SP_FBITS)); in ieee754sp_nan_fdp() 40 y = ieee754sp_nan_fdp(xs, xm); in ieee754sp_fdp() 70 rm = (xm >> (DP_FBITS - (SP_FBITS + 3))) | in ieee754sp_fdp() 71 ((xm << (64 - (DP_FBITS - (SP_FBITS + 3)))) != 0); in ieee754sp_fdp()
|
D | ieee754dp.h | 41 (xe++, (xm = (xm >> 1) | (xm & 1))) 52 #define DPDNORMX DPDNORMx(xm, xe)
|
D | ieee754int.h | 45 unsigned int xm; int xe; int xs __maybe_unused; int xc 77 #define EXPLODEXSP EXPLODESP(x, xc, xs, xe, xm) 83 u64 xm; int xe; int xs __maybe_unused; int xc 115 #define EXPLODEXDP EXPLODEDP(x, xc, xs, xe, xm) 141 #define FLUSHXDP FLUSHDP(x, xc, xs, xe, xm) 144 #define FLUSHXSP FLUSHSP(x, xc, xs, xe, xm)
|
D | dp_fmax.c | 108 assert(xm & DP_HIDDEN_BIT); in ieee754dp_fmax() 135 if (xm <= ym) in ieee754dp_fmax() 140 if (xm <= ym) in ieee754dp_fmax() 237 assert(xm & DP_HIDDEN_BIT); in ieee754dp_fmaxa() 247 if (xm < ym) in ieee754dp_fmaxa() 249 else if (xm > ym) in ieee754dp_fmaxa()
|
D | sp_fmax.c | 108 assert(xm & SP_HIDDEN_BIT); in ieee754sp_fmax() 135 if (xm <= ym) in ieee754sp_fmax() 140 if (xm <= ym) in ieee754sp_fmax() 237 assert(xm & SP_HIDDEN_BIT); in ieee754sp_fmaxa() 247 if (xm < ym) in ieee754sp_fmaxa() 249 else if (xm > ym) in ieee754sp_fmaxa()
|
D | dp_fmin.c | 108 assert(xm & DP_HIDDEN_BIT); in ieee754dp_fmin() 135 if (xm <= ym) in ieee754dp_fmin() 140 if (xm <= ym) in ieee754dp_fmin() 237 assert(xm & DP_HIDDEN_BIT); in ieee754dp_fmina() 247 if (xm < ym) in ieee754dp_fmina() 249 else if (xm > ym) in ieee754dp_fmina()
|