This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>
- Cc: Fergus Henderson <fjh at cs dot mu dot oz dot au>, gcc-patches at gcc dot gnu dot org, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>, Richard dot Earnshaw at arm dot com
- Date: Mon, 23 Sep 2002 14:23:47 +0100
- Subject: Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> 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.
>
Why not add a <test>.x file that just disables the test for these
platforms?
R.