[Openmcl-devel] Infinity and NaN

R. Matthew Emerson rme at clozure.com
Mon Jul 19 12:17:08 PDT 2010


On Jul 19, 2010, at 3:13 PM, Ron Garret wrote:
>> 
>> We used to unconditionally mask (disable) all floating point exceptions when calling a foreign function.  It's not free to save/restore the MXCSR (the register that contains fp status and control bits) around every foreign function call, so we now leave fp exceptions enabled (as configured by ccl:set-fpu-mode).  The runtime will notice when an fp exception takes place in foreign code, mask all fp exceptions, and try the call again.
> 
> Huh?  Does that mean that if I call the following foreign function once:
> 
> void foo() {
>  call_once();
>  sqrt(-1.0);
> }
> 
> that call_once will be called twice?

No.  I was sloppy in my explanation, sorry.

Instead of "try the call instead", I should have said something like "re-execute the faulting instruction".





More information about the Openmcl-devel mailing list