This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Patch for gcc.c-torture/execute/ieee/20010226-1.c


Hi,

> +   /* Some targets may not support double precision floating point
> arithmetic,
> +    * this test case should pass for such targets. */
> +   if (sizeof(long double) <= 4)
> +     exit (0);

   >> You are assuming 8-bit bytes here.

   >> Consider a system in which char, short, int, long, and long double are
   >> all 64 bits.  Then sizeof(long double) = 1.  But ideally we wouldn't
   >> want to disable this test on such a system, would we?

So, could we do something like this?

+ #if defined (__H8300__) || (__H8300H__) || (__H8300S__)
+   if (sizeof(long double) <= 4)
+     exit (0);
+ #endif


Thanks for the observation. Support for other targets could be added as and
when required.

According to IEEE 754 Specifications,
	An IEEE double extended format must have a significand precision of 
	at least 64 bits and occupy at least 79 bits overall.

For a perfect solution,
1) We would have to calculate the number of significand precision bits in
the data type.
2) The overall size in bits of the data type.
3) Then compare the two figures with the Specs.

Such a solution could bloat the code size considerably, 
if at all calculating these could be possible.

Thanks and best regards,

Venky


____________________________________________________________

Today is the tomorrow we worried about yesterday!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]