Lines Matching refs:fmt

65 static int floatformat_always_valid (const struct floatformat *fmt,
69 floatformat_always_valid (const struct floatformat *fmt ATTRIBUTE_UNUSED,
169 static int floatformat_i387_ext_is_valid (const struct floatformat *fmt,
173 floatformat_i387_ext_is_valid (const struct floatformat *fmt, const void *from)
182 exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
183 fmt->exp_start, fmt->exp_len);
184 int_bit = get_field (ufrom, fmt->byteorder, fmt->totalsize,
185 fmt->man_start, 1);
289 floatformat_ibm_long_double_is_valid (const struct floatformat *fmt,
293 const struct floatformat *hfmt = fmt->split_half;
392 mant_bits_set (const struct floatformat *fmt, const unsigned char *ufrom)
397 mant_off = fmt->man_start;
398 mant_bits_left = fmt->man_len;
403 if (get_field (ufrom, fmt->byteorder, fmt->totalsize,
458 floatformat_to_double (const struct floatformat *fmt,
473 exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
474 fmt->exp_start, fmt->exp_len);
479 if ((unsigned long) exponent == fmt->exp_nan)
481 int nan = mant_bits_set (fmt, ufrom);
495 if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
503 mant_bits_left = fmt->man_len;
504 mant_off = fmt->man_start;
507 special_exponent = exponent == 0 || (unsigned long) exponent == fmt->exp_nan;
511 exponent -= fmt->exp_bias;
521 if (fmt->intbit == floatformat_intbit_no)
531 mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
538 (- fmt->exp_bias
540 - (mant_off - fmt->man_start)
551 if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
606 floatformat_from_double (const struct floatformat *fmt,
617 memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
626 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1);
639 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
640 fmt->exp_len, fmt->exp_nan);
642 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
651 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
652 fmt->exp_len, fmt->exp_nan);
657 if (exponent + fmt->exp_bias - 1 > 0)
658 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
659 fmt->exp_len, exponent + fmt->exp_bias - 1);
664 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
665 fmt->exp_len, 0);
666 mant = ldexp (mant, exponent + fmt->exp_bias - 1);
669 mant_bits_left = fmt->man_len;
670 mant_off = fmt->man_start;
682 if ((unsigned int) mant_bits_left == fmt->man_len
683 && fmt->intbit == floatformat_intbit_no
684 && exponent + fmt->exp_bias - 1 > 0)
696 put_field (uto, fmt->byteorder, fmt->totalsize,
706 floatformat_is_valid (const struct floatformat *fmt, const void *from)
708 return fmt->is_valid (fmt, from);