set the precision of Intel's FPU.

John Kern <[email protected]> Tue, 3 Dec 2002 11:10:07 -0800
Newsgroups gmane.linux.redhat.ia64.general
Message-ID <697E18BF23D4264786FBE2B3AAD7BEC601889A4D@exmail3-1>
The Intel processors (i.e., x86 and ia64) have 80-bit (extended) floating
point registers.  By default, floating point computations are done with
extended precision on Intel.  I want to obtain bitwise identical results
across platforms.  Extended precision simply requires at least 15 addition
bits. So, it various between platforms.  For example, Solaris and HP use
128-bit extended precision.  The IEEE spec says there must be a way to
control precision. Setting the precision to double, fixes the problem.

On 32-bit Linux I can achieve this by 
  #include <fpu_control.h>

  fpu_control_t oldcw, newcw;   

  _FPU_GETCW(oldcw);
  newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
  _FPU_SETCW(newcw);

Unfortunately, this doesn't work with Linux/IA-64.  I haven't been
able to find a reference on this topic.  Can someone shed some light
on this?

Thanks for your time and consideration. 

Sincerely,

John