[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] We need a solution for cross-platform bit-identical floating point. (#315)

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Dec 5 10:54:41 UTC 2018


Hi Steffen,
one feature of crlibm is that it does not use current FPU rounding mode
status, but has explicit functions for each rounding mode.
That might be more convenient than switching FPU rounding mode for interval
arithmetic for example.

As for the rounding mode, I think that the VM itself does interfere
For example in:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/win32/vm/sqWin32Main.c
there is the following definition:
#define FPU_DEFAULT (_RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE +
_EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + _EM_DENORMAL)
and a
_controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC);
in squeakExceptionHandler

This is for windows VM but I'm sure we can find similar things in linux/mac


Le mer. 5 déc. 2018 à 09:25, Steffen Märcker <merkste at web.de> a écrit :

>
> Hi,
>
> crlibm looks indeed quite promising. If crlibm would be integrated, is it
> be possible to make setting rounding modes directly accessible without an
> FFI-call from the image? Also, I noticed that changing the rounding mode
> did not work reliable - possibly due to some plug/part of the vm that
> changes the mode on it's own behalf (freetype, maybe?).
>
> Best, Steffen
>
> Am .12.2018, 22:34 Uhr, schrieb Nicolas Cellier <notifications at github.com
> >:
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181205/2f025305/attachment.html>


More information about the Vm-dev mailing list