[R] Questions about Preserving registers
tlumley at u.washington.edu
Thu Jun 10 18:12:05 CEST 2004
On Thu, 10 Jun 2004, Rui wrote:
> Hi folks,
> I tried to use Mirosoft Fortran Powerstation 4.0 to create a dll file.
> However, when I used the command dyn.load("test.dll"), I got the
> following message:
> Warning message:
> DLL attempted to change FPU control word from 9001f to 90003
> I read the instruction on Duncan Murdochs website about preserving
> registers, but I still dont understand it. For example,
This code is for Delphi. You would need to see how to set the FPU control
work in Powerstation Fortran, which should be described in its manual.
The warning is harmless, so you could just ignore it. The warning means
that R has done the change for you.
> 1. On first entry to the DLL, set the control word to the standard R
> value, then save that as the Delphi default. Put this code in the
> library module:
> ## My question: Is that mean put the following code in my Fortran
> routine without any change based on the message I got?
> procedure Rwin_fpset; cdecl; external 'R.dll';
> function Get8087CW:word;
> fstcw result
> 2. After any operation that may have changed the status word, put this
> call before returning to R:
> ## My question: where do I put the line below?
> 3. The following function may be useful in debugging; it returns false
> when the control word has been unexpectedly changed:
> function Okay8087CW:boolean;
> result := ((Default8087CW xor Get8087CW) and not $E060) = 0;
> Phone: (403)220-4501
> Email: rwang at math.ucalgary.ca
> Department of Mathematics and Statistics
> University of Calgary
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-help