[squeak-dev] FloatMathPlugin status?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Feb 18 18:14:38 UTC 2013


FloatMathPlugin uses fdlibm library.
fdlibm library relies on pointer aliasing, which is Undefined Behavior
according to C99 standard
With -O2 optimization, gcc does not produce correct code with such
pointer aliasing...
A well known workaround is to compile fdlibm with -fno-strict-aliasing flag.
It might be the same for RiscOS C compiler...
Don't know if it's enough though, or if there is further UB...

Nicolas

2013/2/18 Bert Freudenberg <bert at freudenbergs.de>:
>
> On 2013-02-18, at 06:31, tim Rowledge <tim at rowledge.org> wrote:
>
>> As part of my "let's see what I haven't got around to yet" attack on the VM, I tried making the FloatMethPlugin on RISC OS.  I got bitten by the __LITTLE_ENDIAN define requirement, and the very odd seeming problem with isnan() but eventually go a plugin built. When trying to use the TestRunner to see it if worked I was a little startled to find it blew my VM out of the water without so much as a by-your-leave.
>>
>> Googling doesn't bring up much that seems useful so I'm forced to throw myself on the collective memory of listers. Am  I wasting my time here - is it actually in use or about to become useful for general Squeak operations? Can anyone remember any implementation issues that might help me fix it? Why was isnan() an issue? Why do lions?
>
>
> This is used in Croquet. It ensures bit-identical float operations across all platforms. That's what the tests, err, test. Otherwise, different clients would get out of sync.
>
> - Bert -
>
>
>


More information about the Squeak-dev mailing list