Ticket #7289 (new bug)

Opened 8 months ago

Last modified 6 weeks ago

Mingw FPU init not Windows compatible.

Reported by: Lennart Owned by:
Priority: high Milestone: 7.8.1
Component: Runtime System Version: 7.2.2
Keywords: Cc:
Operating System: Windows Architecture: x86
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Mingw initializes the FPU top 80 bit precision instead of MSVC's 53 bits (which is the standard). I suggest ghc linking on Windows should be changed to that it uses 53 bits instead. This will make programs more Windows compatible (and possibly faster).

Here's a comment from Mingw's Float.h:

/* MSVCRT.dll _fpreset initializes the control register to 0x27f, the status register to zero and the tag word to 0FFFFh. This differs from asm instruction finit/fninit which set control word to 0x37f (64 bit mantissa precison rather than 53 bit). By default, the mingw version of _fpreset sets fp control as per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when building your application. */

Change History

Changed 6 weeks ago by igloo

  • priority changed from normal to high
  • difficulty set to Unknown
  • milestone set to 7.8.1

Thanks for the report. We'll take a look.

Note: See TracTickets for help on using tickets.