-static const struct floatformat *
-floatformat_from_length (int len)
-{
- const struct floatformat *format;
- if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
- format = TARGET_FLOAT_FORMAT;
- else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
- format = TARGET_DOUBLE_FORMAT;
- else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
- format = TARGET_LONG_DOUBLE_FORMAT;
- /* On i386 the 'long double' type takes 96 bits,
- while the real number of used bits is only 80,
- both in processor and in memory.
- The code below accepts the real bit size. */
- else if ((TARGET_LONG_DOUBLE_FORMAT != NULL)
- && (len * TARGET_CHAR_BIT ==
- TARGET_LONG_DOUBLE_FORMAT->totalsize))
- format = TARGET_LONG_DOUBLE_FORMAT;
- else
- format = NULL;
- if (format == NULL)
- error (_("Unrecognized %d-bit floating-point type."),
- len * TARGET_CHAR_BIT);
- return format;
-}