Skip to content
  • Tamar Christina's avatar
    Reset FPU precision back to MSVCRT defaults · 6f7d8279
    Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
    Mingw-w64 does a stupid thing. They set the FPU precision to extended
    mode by default.  The reasoning is that it's for compatibility with GNU
    Linux ported libraries. However the problem is this is incompatible with
    the standard Windows double precision mode.  In fact, if we create a new
    OS thread then Windows will reset the FPU to double precision mode.  So
    we end up with a weird state where the main thread by default has a
    different precision than any child threads.
    
    Test Plan: ./validate new test T7289
    
    Reviewers: simonmar, austin, bgamari, erikd
    
    Reviewed By: simonmar
    
    Subscribers: thomie, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D2819
    
    GHC Trac Issues: #7289
    6f7d8279