Lines Matching defs:fmt
64 static int floatformat_always_valid (const struct floatformat *fmt,
68 floatformat_always_valid (const struct floatformat *fmt ATTRIBUTE_UNUSED,
144 static int floatformat_i387_ext_is_valid (const struct floatformat *fmt,
148 floatformat_i387_ext_is_valid (const struct floatformat *fmt, const void *from)
157 exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
158 fmt->exp_start, fmt->exp_len);
159 int_bit = get_field (ufrom, fmt->byteorder, fmt->totalsize,
160 fmt->man_start, 1);
303 floatformat_to_double (const struct floatformat *fmt,
314 exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
315 fmt->exp_start, fmt->exp_len);
320 if ((unsigned long) exponent == fmt->exp_nan)
324 mant_off = fmt->man_start;
325 mant_bits_left = fmt->man_len;
331 if (get_field (ufrom, fmt->byteorder, fmt->totalsize,
355 if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
363 mant_bits_left = fmt->man_len;
364 mant_off = fmt->man_start;
367 special_exponent = exponent == 0 || (unsigned long) exponent == fmt->exp_nan;
371 exponent -= fmt->exp_bias;
381 if (fmt->intbit == floatformat_intbit_no)
391 mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
398 (- fmt->exp_bias
400 - (mant_off - fmt->man_start)
411 if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
466 floatformat_from_double (const struct floatformat *fmt,
477 memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
482 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1);
495 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
496 fmt->exp_len, fmt->exp_nan);
498 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
507 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
508 fmt->exp_len, fmt->exp_nan);
513 if (exponent + fmt->exp_bias - 1 > 0)
514 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
515 fmt->exp_len, exponent + fmt->exp_bias - 1);
520 put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
521 fmt->exp_len, 0);
522 mant = ldexp (mant, exponent + fmt->exp_bias - 1);
525 mant_bits_left = fmt->man_len;
526 mant_off = fmt->man_start;
538 if ((unsigned int) mant_bits_left == fmt->man_len
539 && fmt->intbit == floatformat_intbit_no
540 && exponent + fmt->exp_bias - 1 > 0)
552 put_field (uto, fmt->byteorder, fmt->totalsize,
562 floatformat_is_valid (const struct floatformat *fmt, const void *from)
564 return fmt->is_valid (fmt, from);