jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

ieee.exp=rbug.c rounding of floats/doubles #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The test code is :
  if (sizeof (double) >= 8)
    {
      k = 0x8693ba6d7d220401ULL;
      x = d (k);
      k = (unsigned long long) x;
      if (k != 0x8693ba6d7d220800ULL)
        printf("FAIL %lx\n",k);
    }

  k = 0x8234508000000001ULL;
  x = s (k);
  k = (unsigned long long) x;
  if (k != 0x8234510000000000ULL)
    printf("FAIL %lx\n",k);

It results in :
FAIL 8693ba6d7d220000
FAIL 8234500000000000

The test has a comment :
 This test case assumes extended-precision

And this is not the case for the SX, one loose the data outside the 53 bit
mantisa. 

I think that must be the case, maybe Marco can comment from his 
http://code.google.com/p/sx-gcc/issues/detail?id=75 experience.

Original issue reported on code.google.com by fred.tre...@googlemail.com on 18 Dec 2008 at 2:17

GoogleCodeExporter commented 8 years ago
Yes, the issue here is practically identical to the issues 50 and 75.

And as with issues 50 and 75 this issue is resolved if we replace the 
"floatdisf2"
and "floatdidf2" predicates with soft-fp routines.

Original comment by nou...@gmail.com on 18 Dec 2008 at 5:53

GoogleCodeExporter commented 8 years ago
This issue is fixed in r182.

Original comment by nou...@gmail.com on 19 Dec 2008 at 1:56