RFR (M): 8132207: Update for x86 exp in the math lib
Deshpande, Vivek R
vivek.r.deshpande at intel.com
Fri Jul 24 18:56:51 UTC 2015
Hi Christos
You have a very good point. We have made sure that, interpreter, c1 and c2 give same result by using same stub.
These results also meet the 1 ulp requirement.
Regards,
Vivek
-----Original Message-----
From: Christos Zoulas [mailto:christos at zoulas.com]
Sent: Friday, July 24, 2015 11:37 AM
To: Deshpande, Vivek R; hotspot-compiler-dev at openjdk.java.net
Cc: Vladimir.Kozlov at oracle.com
Subject: Re: RFR (M): 8132207: Update for x86 exp in the math lib
On Jul 23, 6:01pm, vivek.r.deshpande at intel.com ("Deshpande, Vivek R") wrote:
-- Subject: RFR (M): 8132207: Update for x86 exp in the math lib
| Hi all
|
| I would like to contribute a patch which optimizes Math.exp() for 64
| and 32= bit X86 architecture using Intel LIBM implementation.
| Please review and sponsor this patch.
|
| Bug-id: https://bugs.openjdk.java.net/browse/JDK-8132207
|
| webrev:
| http://cr.openjdk.java.net/~mcberg/8132207/webrev.01/
I would be very careful with changes like this. Are you sure that this produces identical results with the current implementation?
In the past we've had problems with the values of transcendental functions because JIT replaced the java implementations with native copies and sometimes this were off by 1ULP. This made the following code fail:
public class LogTest {
public static void main(String[] args)
{
double n = Integer.parseInt("17197");
double d = Math.log(n);
System.out.println("n=" + n + ",log(n)=" + d);
for (int i = 0; i < 100000; i++) {
double e = Math.log(n);
if (e != d) {
System.err.println("ERROR after " + i + " iterations:\n" +
"previous value: " + d + " (" +
Long.toHexString(Double.doubleToLongBits(d)) + ")\n" +
" current value: " + e + " (" +
Long.toHexString(Double.doubleToLongBits(e)) + ")");
System.exit(1);
}
}
System.err.println("SUCCESS!");
System.exit(0);
}
}
christos
More information about the hotspot-compiler-dev
mailing list