Re: Setting FPU control bits in Linux
- From: Phil Hobbs <pcdhSpamMeSenseless@xxxxxxxxxxxx>
- Date: Tue, 20 May 2008 18:01:18 -0400
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
.
- Follow-Ups:
- Re: Setting FPU control bits in Linux
- From: Noob
- Re: Setting FPU control bits in Linux
- References:
- Setting FPU control bits in Linux
- From: Phil Hobbs
- Re: Setting FPU control bits in Linux
- From: Noob
- Setting FPU control bits in Linux
- Prev by Date: Re: Process generating its own stack trace
- Next by Date: Re: Process generating its own stack trace
- Previous by thread: Re: Setting FPU control bits in Linux
- Next by thread: Re: Setting FPU control bits in Linux
- Index(es):
Relevant Pages
|