Skip to content
Back to formatted view

Raw Message

Message-ID: <4A6D8466.6000603@mx.uni-saarland.de>
Date: 2009-07-27T10:41:42Z
From: Martin Becker
Subject: how to change FPU control word?

Dear developers,

is there (already) a platform-independent way for (temporarily!) 
changing the fpu control word?
More precisely: I am looking for functions (accessible from C code in R 
packages) which read and write the fpu control word on x86 cpus (and 
cause no harm otherwise), because I need to (temporarily) turn off 
internal 80-bit precision for some algorithms relying on 64-bit IEEE 
arithmetics. Currently, I am using inline assembler (which works for x86 
cpus on Linux and Windows (MinGW)), but I am not sure what happens for 
other cpus/OSs (and I am not able to check this). I hope, there is 
already a better solution.
Any hints appreciated!

Thanks,
  Martin

-- 
Dr. Martin Becker
Statistics and Econometrics
Saarland University
Campus C3 1, Room 206
66123 Saarbruecken
Germany