[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

i386 extended vs. double precision math



I am trying to compile an arbitrary precision math
library on 2.8.  It requires that the FPU operate
internally in double precision, not extended precision.
The code's documentation suggests the x86 runs
extended precision by default.

This is the section of code which I am having trouble
with.  I don't know what platform this was written for,
but apparently fpu_control.h is supposed to be a system
header.

  /* FPU control. We MUST have only double precision
    (not extended precision) */ 
  #include <fpu_control.h>

  static fpu_control_t fpu_round_double =
        (_FPU_DEFAULT & ~ _FPU_EXTENDED)|_FPU_DOUBLE;
  static fpu_control_t fpu_init;
  #define FPU_ROUND_DOUBLE  {_FPU_GETCW(fpu_init); \
          _FPU_SETCW(fpu_round_double);} 
  #define FPU_RESTORE       {_FPU_SETCW(fpu_init);}

Any idea how to get this running?

Thanks,
- Bruce