Lines Matching +full:non +full:- +full:sticky
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
5 * Floating-point emulation code
6 * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org>
10 PA header file -- do not include this header file for non-PA builds.
40 Deposit_dexponent(dest,src_exponent+(DBL_BIAS-SGL_BIAS))
47 ((exponent < (SGL_P - 1)) ? \
50 #define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0)
53 if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \
54 if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \
58 (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB))
61 if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \
62 if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \
66 (Dintp2(dint_value) << 33 - DBL_EXP_LENGTH)
69 if (Dintp2(dint_opndB) & 1<<(DBL_EXP_LENGTH - 2)) \
70 if ((Dintp2(dint_opndB) << 34 - DBL_EXP_LENGTH) || Dlowp2(dbl_opndB)) \
77 (exponent < (SGL_P - 2) ? \
86 dest = src_exponent + (SGL_BIAS - DBL_BIAS)
88 #define Dbl_to_sgl_mantissa(srcA,srcB,dest,inexact,guard,sticky,odd) \ argument
91 sticky = Dallp2(srcB)<<4; \
92 inexact = guard | sticky; \
95 #define Dbl_to_sgl_denormalized(srcA,srcB,exp,dest,inexact,guard,sticky,odd,tiny) \ argument
98 if (exp >= -2) { \
102 sticky = inexact << 1; \
112 dest--; \
120 dest--; \
124 if (guard && (sticky || odd)) { \
128 dest--; \
135 sticky = inexact; \
145 sticky = inexact << 1; \
147 if (exp == -2) dest = Dallp1(srcA); \
148 else Variable_shift_double(Dallp1(srcA),Dallp2(srcB),30-exp,dest); \
154 if (exp > (1 - SGL_P)) { \
155 dest = Dallp1(srcA) >> (- 2 - exp); \
158 sticky = (inexact << 1) | Dallp2(srcB); \
165 if (exp == (1 - SGL_P)) { \
167 sticky = Dmantissap1(srcA) | Dallp2(srcB); \
171 sticky = inexact; \
179 (exponent < (DBL_P-33) ? \
181 (exponent < (DBL_P-1) ? Dallp2(dbl_valueB) << (exponent + (33-DBL_P)) : \
189 ((exponent < (DBL_P - 33) ? \
190 Dallp1(dbl_valueA) >> ((30 - DBL_EXP_LENGTH) - exponent) : \
191 Dallp2(dbl_valueB) >> ((DBL_P - 2) - exponent)) & 1)
194 (exponent < (DBL_P-34) ? \
196 (exponent<(DBL_P-2) ? (Dallp2(dbl_valueB) << (exponent + (34-DBL_P))) : \
204 (unsigned)(Sall(sgl_value) << SGL_EXP_LENGTH)>>(31 - exponent)
208 if (exponent < 31) Dallp1(dbl_valueA) >>= 30 - exponent; \
211 #define Int_negate(int_value) int_value = -int_value
217 {Sall(sgl_value) <<= SGL_EXP_LENGTH; /* left-justify */ \
220 Dintp2(dresultB) = (unsigned)Sall(sgl_value) >> (31 - exponent); \
223 Dintp1(dresultA) = Sall(sgl_value) >> (63 - exponent); \
224 Dintp2(dresultB) = Sall(sgl_value) << (exponent - 31); \
232 Dintp2(destB) = Dallp1(dbl_valueA) >> 20-exponent; \
234 52-exponent,Dintp2(destB)); \
238 Dintp1(destA) = Dallp1(dbl_valueA) >> 52-exponent; \
241 52-exponent,Dintp2(destB)); \
245 84-exponent,Dintp1(destA)); \
246 Dintp2(destB) = Dallp2(dbl_valueB) << exponent-52; \
256 if ((Dintp2(dresultB) = -Dintp2(dresultB)) == 0) Dintp1(dresultA)++
268 if ((Dintp2(dresultB)--)==0) Dintp1(dresultA)--
272 if ((Dintp2(dresultB) = -Dintp2(dresultB))==0) Dintp1(dresultA)++
275 Dintp1(destA) = src->wd0; \
276 Dintp2(destB) = src->wd1
278 dest->wd0 = Dintp1(srcA); \
279 dest->wd1 = Dintp2(srcB)
288 if (value >> 32 - position) \
289 position -= var; \
292 if ((value >> 32 - position) == 0) \
293 position--; \
294 else position -= 2; \
307 (int_value << 32 - SGL_EXP_LENGTH)
310 if (suint_value & 1<<(SGL_EXP_LENGTH - 1)) /* round bit */ \
311 if ((suint_value << 33 - SGL_EXP_LENGTH) || Slow(sgl_value)) \
315 ((Duintp1(duint_valueA) << 32 - SGL_EXP_LENGTH) || Duintp2(duint_valueB))
318 if (Duintp1(duint_valueA) & 1<<(SGL_EXP_LENGTH - 1)) \
319 if ((Duintp1(duint_valueA) << 33 - SGL_EXP_LENGTH) || \
323 (Duintp2(duint_value) << 32 - DBL_EXP_LENGTH)
326 if (Duintp2(duint_opndB) & 1<<(DBL_EXP_LENGTH - 1)) \
327 if ((Duintp2(duint_opndB) << 33 - DBL_EXP_LENGTH) || Dlowp2(dbl_opndB)) \
331 Sall(result) = (unsigned)(Sall(src) << SGL_EXP_LENGTH)>>(31 - exponent)
340 Dintp2(dresultB) = val >> (31 - exponent); \
343 Dintp1(dresultA) = val >> (63 - exponent); \
344 Dintp2(dresultB) = exponent <= 62 ? val << (exponent - 31) : 0; \
357 dest = (unsigned)dest >> 31 - exponent