Re: Setting FPU control bits in Linux



Noob wrote:
Phil Hobbs wrote:

I have this cross-platform electromagnetic simulator that sometimes needs to run for a few days. To make sure I get reasonably consistent results using different compilers (gcc for Linux, gcc for cygwin, Intel C++ for Windows and Linux, MS C++, and IBM C++ for OS/2 [which I still use because it has a debugger that I love]), I need to be able to set floating-point control bits. This is straighforward in Windows and OS/2, but appears to be very difficult in gcc.

[...]

So how can I control the FPU in Linux?

I /think/ you want man fenv (not sure though).

http://www.kernel.org/doc/man-pages/online/pages/man3/fenv.3.html

Are you working with x86 only or other architectures as well?

x87 or SSE? 64-bit or 80-bit precision?

How is it done in Windows?

Regards.

Thanks, I'll see if my compilers support it yet.

In Windows and OS/2, there's an API called _control87() that lets you set the mask bits directly. Nasty and low-level, but then you _are_ setting bits in a processor register....


Cheers,

Phil Hobbs
.



Relevant Pages

  • Re: Is Linux A Feasible Platofrm For Professional DAW work ?
    ... actually want control. ... Why does Windows change in ways that affect the ... ASIO use of the audio interface? ... things in the Linux "audio stack". ...
    (rec.audio.pro)
  • Re: Lost XP product key - before install.
    ... And you think Linux is difficult? ... At least our config files ... >> control WinAMP from within your text editor, ... > windows, it's obviously the best way (although ReactOS have more of a clue, ...
    (uk.comp.homebuilt)
  • Re: [opensuse] 12.1...., nope!
    ... people who have been brainwashed by Windows (or even *shock* ... sudden you are in control - and you have to be in control and know the ... better hand on Linux in general. ... luck that will produce enough endorphins to make Windows completely ...
    (SuSE)
  • Re: Is Linux A Feasible Platofrm For Professional DAW work ?
    ... actually want control. ... Linux forces the user to do. ... A fascinating assesment of the windows situation. ... ASIO use of the audio interface? ...
    (rec.audio.pro)
  • Re: PcLinux
    ... Mind zap every time I see gcc... ... despicable than the simple limited capabilities of OS/2, ... can really quibble about is open for debate even between linux distros. ... herd of rabid badgers would be preferable to using Windows, ...
    (rec.crafts.metalworking)