[fpc-devel] Broken frac functionin FPC3.1.1 / Windows x86_64

J. Gareth Moreton gareth at moreton-family.com
Thu May 3 04:21:11 CEST 2018

 I'll keep working on it though, because it seems that some routines may
return placeholder values if exceptions are masked.

 Gareth aka. Kit

 On Thu 03/05/18 02:35 , "J. Gareth Moreton" gareth at moreton-family.com
  Hi guys,

 I've been having difficulties disabling floating-point and SSE exceptions.
Either the exceptions are still raised, or an exception is raised
elsewhere... sometimes within the function, and in one instance, in the
WriteLn routine!  Does anyone have any advice as to how to get around this
and properly disable the exceptions? I haven't had much luck with
SetExceptionMask or Set8087CW so far.

 Outside of that, manual data flow analysis shows that XMM0 is invariant up
until the point that SUBSD is called, which is the operation that raises an
exception if XMM0 contains plus or minus infinity.  Logically, being the
last operation in the function, if SUBSD doesn't do anything if exceptions
are suppressed, then XMM0 will still contain plus or minus infinity and
this will be the return value; unusual for a function that returns x where
-1 < x < 1, but considering infinity is an abnormal value to pass, this is
sort of permissible, I think.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180503/813afe05/attachment.html>

More information about the fpc-devel mailing list