#4914: FPU initialization required again
---------------------------------+------------------------------------------
    Reporter:  aruiz             |        Owner:  simonmar                   
        Type:  bug               |       Status:  new                        
    Priority:  high              |    Milestone:  7.2.1                      
   Component:  Compiler (NCG)    |      Version:  7.0.1                      
    Keywords:                    |     Testcase:                             
   Blockedby:                    |   Difficulty:                             
          Os:  Unknown/Multiple  |     Blocking:                             
Architecture:  x86               |      Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------

Comment(by aruiz):

 I have run the hmatrix tests checking the fpu state at the beginning of
 the foreign calls and the presence of NaN's in the results. In a large
 number of cases the stack pointer is not 0 and there is no problem.

 But in a few cases in which the foreign call receives a nonzero stack
 pointer the foreign computation produces a wrong NaN. I have discovered
 that I must only call finit to prevent the error if the fpu is in one of
 the following three states:


 {{{
 14624 : 0011 1001 0010 0000
 14629 :   =    =    =  0101
 14631 :   =    =    =  0111
 }}}

 In this particular experiment any other state is harmless. I know very
 little about this, but from the info in
 [http://webster.cs.ucr.edu/AoA/Windows/HTML/RealArithmetic.html#1000117
 this page] it looks like the only common pattern is a top of stack = 7 and
 precision = 1, which is not problematic in many other cases.

 I will try to find a small testcase producing a NaN.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4914#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to