Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial x87 control word is different from native linux #3912

luoqi-git opened this Issue Mar 13, 2019 · 1 comment


None yet
2 participants
Copy link

luoqi-git commented Mar 13, 2019

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.17134.523]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
    The default/initial x87 control word is different from that of a native linux system, specifically the precision control field. This affects for example all long double variants of math library functions which use x87 FPU and not SSE.

% cat t.c
#include <stdio.h>
#include <xmmintrin.h>

static unsigned short _mm_getfcw()
	unsigned short word;
	asm volatile("fstcw %0" : "=m" (*(&word)));
	return word;

int main()
	printf("%x %x\n", _mm_getfcw(), _mm_getcsr());
% cc -o t t.c
centos% ./t
37f 1f80
wsl% ./t
27f 1f80
  • What's wrong / what should be happening instead:
    The initial x87 control word is expected to be 0x37f.

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

  • For WSL launch issues, please collect detailed logs.

See our contributing instructions for assistance.


This comment has been minimized.

Copy link

therealkenc commented Mar 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.