Lines Matching refs:exp
40 int exp, pwr; in eexp2() local
44 exp = ((s >> 23) & 0xff) - 127; in eexp2()
45 if (exp > 7) { in eexp2()
47 if (exp == 128 && (s & 0x7fffff) != 0) in eexp2()
52 if (exp < -23) in eexp2()
57 if (exp > 0) in eexp2()
58 pwr <<= exp; in eexp2()
60 pwr >>= -exp; in eexp2()
65 exp = (pwr >> 23) + 126; in eexp2()
66 if (exp >= 254) in eexp2()
68 if (exp < -23) in eexp2()
80 if (exp >= 0) in eexp2()
81 return mant + (exp << 23); in eexp2()
84 exp = -exp; in eexp2()
85 mant += 1 << (exp - 1); in eexp2()
86 return mant >> exp; in eexp2()
95 int exp, mant, lz, frac; in elog2() local
97 exp = s & 0x7f800000; in elog2()
99 if (exp == 0x7f800000) { /* Inf or NaN */ in elog2()
104 if ((exp | mant) == 0) /* +0 or -0 */ in elog2()
107 if (exp == 0) { in elog2()
111 exp = (-118 - lz) << 23; in elog2()
114 exp -= 127 << 23; in elog2()
118 exp |= 0x400000; /* 0.5 * 2^23 */ in elog2()
123 exp |= 0x200000; /* 0.25 * 2^23 */ in elog2()
128 exp |= 0x100000; /* 0.125 * 2^23 */ in elog2()
137 exp += frac; in elog2()
139 s = exp & 0x80000000; in elog2()
140 if (exp != 0) { in elog2()
142 exp = -exp; in elog2()
143 asm("cntlzw %0,%1" : "=r" (lz) : "r" (exp)); in elog2()
146 exp >>= lz; in elog2()
148 exp <<= -lz; in elog2()
149 s += ((lz + 126) << 23) + exp; in elog2()
158 int exp, mant; in ctsxs() local
160 exp = (x >> 23) & 0xff; in ctsxs()
162 if (exp == 255 && mant != 0) in ctsxs()
164 exp = exp - 127 + scale; in ctsxs()
165 if (exp < 0) in ctsxs()
167 if (exp >= 31) { in ctsxs()
174 mant = (mant << 7) >> (30 - exp); in ctsxs()
180 int exp; in ctuxs() local
183 exp = (x >> 23) & 0xff; in ctuxs()
185 if (exp == 255 && mant != 0) in ctuxs()
187 exp = exp - 127 + scale; in ctuxs()
188 if (exp < 0) in ctuxs()
195 if (exp >= 32) { in ctuxs()
201 mant = (mant << 8) >> (31 - exp); in ctuxs()
208 int exp; in rfiz() local
210 exp = ((x >> 23) & 0xff) - 127; in rfiz()
211 if (exp == 128 && (x & 0x7fffff) != 0) in rfiz()
213 if (exp >= 23) in rfiz()
215 if (exp < 0) in rfiz()
217 return x & ~(0x7fffff >> exp); in rfiz()
223 int exp, mask; in rfii() local
225 exp = ((x >> 23) & 0xff) - 127; in rfii()
226 if (exp == 128 && (x & 0x7fffff) != 0) in rfii()
228 if (exp >= 23) in rfii()
232 if (exp < 0) in rfii()
235 mask = 0x7fffff >> exp; in rfii()
244 int exp, half; in rfin() local
246 exp = ((x >> 23) & 0xff) - 127; in rfin()
247 if (exp == 128 && (x & 0x7fffff) != 0) in rfin()
249 if (exp >= 23) in rfin()
251 if (exp < -1) in rfin()
253 if (exp == -1) in rfin()
256 half = 0x400000 >> exp; in rfin()
258 return (x + half) & ~(0x7fffff >> exp); in rfin()