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]

Re: denormal patch


> Date: Wed, 22 Mar 2000 14:37:06 -0800
> From: Richard Henderson <rth@cygnus.com>
> Cc: gcc-patches@gcc.gnu.org
> 
> On Mon, Mar 20, 2000 at 06:10:59PM -0800, Geoff Keating wrote:
> > + 	* config/fp-bit.c (pack_d): Correct the case when a denormal
> > + 	is rounded up and stops being denormal.
> 
> Ok.

OK, committed.

> Would you choose the type for ul and ull based on limits.h and
> the expected size of the fp types?  Then verify in main that
> the types do in fact match up in size and exit early if you
> guessed wrong.

How about this?  It seems to work on ppc, ppc/-msoft-float, and alpha/-mieee.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.c===
typedef unsigned ull __attribute__((mode(DI)));
typedef unsigned ul __attribute__((mode(SI)));

union fl {
  float	f;
  ul l;
} uf;
union dl {
  double d;
  ull ll;
} ud;

int failed = 0;

void c(ull d, ul f)
{
  ud.ll = d;
  uf.f = (float) ud.d;
  if (uf.l != f)
    {
      failed++;
    }
}

int main()
{
  if (sizeof (float) != sizeof (ul)
      || sizeof (double) != sizeof (ull))
    exit (0);
  
  c(0x3690000000000000ULL, 0x00000000U);
  c(0x3690000000000001ULL, 0x00000001U);
  c(0x369fffffffffffffULL, 0x00000001U);
  c(0x36A0000000000000ULL, 0x00000001U);
  c(0x36A7ffffffffffffULL, 0x00000001U);
  c(0x36A8000000000000ULL, 0x00000002U);
  c(0x36AfffffffffffffULL, 0x00000002U);
  c(0x36b0000000000000ULL, 0x00000002U);
  c(0x36b0000000000001ULL, 0x00000002U);
  
  c(0x380fffffdfffffffULL, 0x007fffffU);
  c(0x380fffffe0000000ULL, 0x00800000U);
  c(0x380fffffe0000001ULL, 0x00800000U);
  c(0x380fffffffffffffULL, 0x00800000U);
  c(0x3810000000000000ULL, 0x00800000U);
  c(0x3810000000000001ULL, 0x00800000U);
  c(0x3810000010000000ULL, 0x00800000U);
  c(0x3810000010000001ULL, 0x00800001U);
  c(0x381000002fffffffULL, 0x00800001U);
  c(0x3810000030000000ULL, 0x00800002U);
  c(0x3810000050000000ULL, 0x00800002U);
  c(0x3810000050000001ULL, 0x00800003U);
    
  if (failed)
    abort ();
  else
    exit (0);
}
============================================================

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