Lines Matching +full:msb +full:- +full:-
2 * /src/NTP/ntp4-dev/libntp/ieee754io.c,v 4.12 2005/04/16 17:32:10 kardel RELEASE_20050508_A
8 * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
62 val <<= 32 - cnt;
66 while (i--)
93 snprintf(buf, LIB_BUFLENGTH, "%c %s %s %s", sign ? '-' : '+',
269 printf("fetchieee754: FP: %s -> %s -> %e(=%s)\n", fmt_hex(*buffpp, length),
295 * +Inf or -Inf
311 exponent = characteristic - bias;
313 if (exponent > 31) /* sorry - hardcoded */
316 * overflow only in respect to NTP-FP representation
324 frac_offset = mbits - exponent;
329 * de-normalized or tiny number - fits only as 0
339 mantissa_high |= 1 << (mbits - 32);
344 * take mantissa apart - if only all machine would support
345 * 64 bit operations 8-(
349 lfpp->l_ui = 0; /* only fractional number */
350 frac_offset -= mbits + 1; /* will now contain right shift count - 1*/
353 lfpp->l_uf = mantissa_high << (63 - mbits);
354 lfpp->l_uf |= mantissa_low >> (mbits - 33);
355 lfpp->l_uf >>= frac_offset;
359 lfpp->l_uf = mantissa_low >> frac_offset;
369 lfpp->l_ui = mantissa_high >> (frac_offset - 32);
370 lfpp->l_uf = (mantissa_high & ((1 << (frac_offset - 32)) - 1)) << (64 - frac_offset);
371 lfpp->l_uf |= mantissa_low >> (frac_offset - 32);
378 lfpp->l_ui = mantissa_high << (32 - frac_offset);
379 lfpp->l_ui |= (mantissa_low >> frac_offset) & ((1 << (32 - frac_offset)) - 1);
380 lfpp->l_uf = (mantissa_low & ((1 << frac_offset) - 1)) << (32 - frac_offset);
403 * be composed into an ieee754-format float and stored at *bufpp or
407 * [-Wunused-but-set-variable]
428 int msb;
495 msb = 63;
499 msb--;
504 msb = 31;
508 msb--;
516 if (msb >= 32)
518 mantissa_low = (outlfp.l_ui & ((1 << (msb - 32)) - 1)) << (mbits - (msb - 32));
519 mantissa_low |= outlfp.l_uf >> (mbits - (msb - 32));
523 mantissa_low = (outlfp.l_uf << (mbits - msb)) & ((1 << mbits) - 1);
528 if (msb >= 32)
530 mantissa_high = (outlfp.l_ui << (mbits - msb)) & ((1 << (mbits - 32)) - 1);
531 mantissa_high |= outlfp.l_uf >> (32 - (mbits - msb));
532 mantissa_low = (outlfp.l_ui & ((1 << (msb - mbits)) - 1)) << (32 - (msb - mbits));
533 mantissa_low |= outlfp.l_uf >> (msb - mbits);
537 mantissa_high = outlfp.l_uf << (mbits - 32 - msb);
538 mantissa_low = outlfp.l_uf << (mbits - 32);
543 exponent = msb - 32;