/Linux-v5.10/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 | 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_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 | dp_add.c | 107 assert(xm & DP_HIDDEN_BIT); in ieee754dp_add() 113 xm <<= 3; in ieee754dp_add() 128 xm = XDPSRS(xm, s); in ieee754dp_add() 139 xm = xm + ym; in ieee754dp_add() 141 if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */ in ieee754dp_add() 142 xm = XDPSRS1(xm); in ieee754dp_add() 146 if (xm >= ym) { in ieee754dp_add() 147 xm = xm - ym; in ieee754dp_add() 149 xm = ym - xm; in ieee754dp_add() 152 if (xm == 0) in ieee754dp_add() [all …]
|
D | dp_sub.c | 114 assert(xm & DP_HIDDEN_BIT); in ieee754dp_sub() 119 xm <<= 3; in ieee754dp_sub() 134 xm = XDPSRS(xm, s); in ieee754dp_sub() 143 xm = xm + ym; in ieee754dp_sub() 145 if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */ in ieee754dp_sub() 146 xm = XDPSRS1(xm); /* shift preserving sticky */ in ieee754dp_sub() 150 if (xm >= ym) { in ieee754dp_sub() 151 xm = xm - ym; in ieee754dp_sub() 153 xm = ym - xm; in ieee754dp_sub() 156 if (xm == 0) { in ieee754dp_sub() [all …]
|
D | sp_add.c | 107 assert(xm & SP_HIDDEN_BIT); in ieee754sp_add() 113 xm <<= 3; in ieee754sp_add() 128 xm = XSPSRS(xm, s); in ieee754sp_add() 139 xm = xm + ym; in ieee754sp_add() 141 if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */ in ieee754sp_add() 145 if (xm >= ym) { in ieee754sp_add() 146 xm = xm - ym; in ieee754sp_add() 148 xm = ym - xm; in ieee754sp_add() 151 if (xm == 0) in ieee754sp_add() 157 while ((xm >> (SP_FBITS + 3)) == 0) { in ieee754sp_add() [all …]
|
D | sp_sub.c | 112 assert(xm & SP_HIDDEN_BIT); in ieee754sp_sub() 117 xm <<= 3; in ieee754sp_sub() 132 xm = XSPSRS(xm, s); in ieee754sp_sub() 141 xm = xm + ym; in ieee754sp_sub() 143 if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */ in ieee754sp_sub() 147 if (xm >= ym) { in ieee754sp_sub() 148 xm = xm - ym; in ieee754sp_sub() 150 xm = ym - xm; in ieee754sp_sub() 153 if (xm == 0) { in ieee754sp_sub() 161 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 | 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_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 | 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 | 106 assert(xm & DP_HIDDEN_BIT); in ieee754dp_div() 110 xm <<= 3; in ieee754dp_div() 119 if (xm >= ym) { in ieee754dp_div() 120 xm -= ym; in ieee754dp_div() 122 if (xm == 0) in ieee754dp_div() 125 xm <<= 1; in ieee754dp_div() 129 if (xm) in ieee754dp_div()
|
D | sp_div.c | 106 assert(xm & SP_HIDDEN_BIT); in ieee754sp_div() 110 xm <<= 3; in ieee754sp_div() 119 if (xm >= ym) { in ieee754sp_div() 120 xm -= ym; in ieee754sp_div() 122 if (xm == 0) in ieee754sp_div() 125 xm <<= 1; in ieee754sp_div() 129 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() 39 y = ieee754sp_nan_fdp(xs, xm); in ieee754sp_fdp() 69 rm = (xm >> (DP_FBITS - (SP_FBITS + 3))) | in ieee754sp_fdp() 70 ((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 | 46 unsigned int xm; int xe; int xs __maybe_unused; int xc 78 #define EXPLODEXSP EXPLODESP(x, xc, xs, xe, xm) 84 u64 xm; int xe; int xs __maybe_unused; int xc 116 #define EXPLODEXDP EXPLODEDP(x, xc, xs, xe, xm) 142 #define FLUSHXDP FLUSHDP(x, xc, xs, xe, xm) 145 #define FLUSHXSP FLUSHSP(x, xc, xs, xe, xm)
|
D | sp_fmax.c | 107 assert(xm & SP_HIDDEN_BIT); in ieee754sp_fmax() 134 if (xm <= ym) in ieee754sp_fmax() 139 if (xm <= ym) in ieee754sp_fmax() 235 assert(xm & SP_HIDDEN_BIT); in ieee754sp_fmaxa() 245 if (xm < ym) in ieee754sp_fmaxa() 247 else if (xm > ym) in ieee754sp_fmaxa()
|
D | sp_fmin.c | 107 assert(xm & SP_HIDDEN_BIT); in ieee754sp_fmin() 134 if (xm <= ym) in ieee754sp_fmin() 139 if (xm <= ym) in ieee754sp_fmin() 235 assert(xm & SP_HIDDEN_BIT); in ieee754sp_fmina() 245 if (xm < ym) in ieee754sp_fmina() 247 else if (xm > ym) in ieee754sp_fmina()
|
D | dp_fmax.c | 107 assert(xm & DP_HIDDEN_BIT); in ieee754dp_fmax() 134 if (xm <= ym) in ieee754dp_fmax() 139 if (xm <= ym) in ieee754dp_fmax() 235 assert(xm & DP_HIDDEN_BIT); in ieee754dp_fmaxa() 245 if (xm < ym) in ieee754dp_fmaxa() 247 else if (xm > ym) in ieee754dp_fmaxa()
|