This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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]

Problem with interpreted double operations on IA64


Could someone point me at a description of exactly how type __java_double
should differ from double?  As far as I can tell, __java_double is used
primarily by the interpreter?  On X86 this seems to work correctly.  On IA64
(and perhaps other 64-bit platforms?), it seems to get confused about the
low order bits.  This means that "double precision" results in the
interpreter are computed at most to single precision accuracy.  Here's a C++
example to demonstrate the issue.  Gij runs into the same problems, causing
scimark to fail, etc.  (This is with a very recent 3.1 tree.)

[hboehm@plasma ~/tests]$ cat double.cc
#include <stdio.h>

__java_double jdiv (__java_double x, __java_double y) {
  return x/y;
}


double div (double x, double y) {
  return x/y;
}


int main()
{
  __java_double jx=2.0, jy=3.0;
  double x=2.0, y=3.0;
  double result, jresult;

  jresult = jdiv(jx, jy);
  result = div(x, y);

  printf("%20.15f %20.15f\n", result, jresult);
}

[hboehm@plasma ~/tests]$ g++ double.cc
[hboehm@plasma ~/tests]$ ./a.out
   0.666666666666667    0.666666686534882



Hans


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