Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Newsgroups: comp.lang.java.programmer Subject: Re: higher precision doubles Date: Tue, 09 Aug 2011 00:42:36 -0400 Organization: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Lines: 17 Message-ID: References: NNTP-Posting-Host: rVthVZnhcRUtAmAbhCNCIw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: WinVN 0.99.12z (x86 32bit) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6897 On 06/08/2011 6:35 AM, Patricia Shanahan wrote: > In general, a Java implementation must make its floating point > arithmetic give the same results as the 32 and 64 bit basic formats. If > "strictfp" is off, the implementation can carry extra extra exponent > bits, avoiding some cases of overflow and underflow, but is not required > to do so. Even without strictfp, the mantissa sizes and therefore the > precision are fixed. How does that interact with JIT, though? On x86, the simplest way for JIT to make non-strictfp code use the FPU would be to just load the initial values into the (80-bit-wide!) registers and perform FADDs, FMULs, etc. on them. As long as the computation stayed in registers the higher precision then ought to remain in effect -- for JITted code. Adding extra code to mask off 16 of the register bits (or the mantissa subset of the extra bits) after every FP op would slow things down. Is the JLS interpreted to require the JIT do this (for non-strictfp code)? And, if not, what does the HotSpot JIT do in actuality?