[Vm-dev] Portability problems: compiler flags

David T. Lewis lewis at mail.msen.com
Tue Jan 25 13:30:26 UTC 2011


On Tue, Jan 25, 2011 at 12:05:32PM +0100, Andreas Raab wrote:
> 
> On 1/25/2011 11:38 AM, Igor Stasenko wrote:
> >>Squeak uses highly unportable flag "-mno-fused-madd".
> >>It isn't present in many systems, even those using GCC,
> >>since many systems use older compilers.
> >>
> >>Also, why do you build fdlibm? It is old stuff that works not so well,
> >>we have better libm. Is there a way to use our libm?
> >>
> >I asked  same question few weeks ago.
> >Check mailing list archive for discussion.
> >In short: differrent libm implementations work differently and some
> >have bad support of IEEE standard.
> 
> Actually, that's not quite the point. The issue is that Croquet requires 
> bit-identical computations including floating point. For FPU 
> computations, the use of -mno-fused-madd avoids the use of the fused 
> multiply-add operation by compilers which support it which would 
> generate different results from compilers not using fused madd.
> 
> The usage of fdlibm is similar. As Nicolas has pointed out elsewhere, 
> fdlibm is in some cases actually inferior of the platform libms (one 
> might say outright broken) but the requirement for the usage in Croquet 
> isn't really whether it's "correct" or "good". The requirement is 
> bit-identical results across all platforms. The results can be wrong as 
> long as they are consistently wrong. But they mustn't be different.
> 
> Having said that, for your regular Squeak VM (i.e., not requiring 
> bit-identical floating point results) there really isn't a requirement 
> to use either -mno-fused-madd or fdlibm.

In terms of requirements, is it true that bit-identical behavior
for FloatMathPlugin is a requirement if and only if CroquetPlugin
is present at runtime?

Dave



More information about the Vm-dev mailing list