<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59787>59787</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            x87 control word is different on Windows 32bit
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          icedrocket
      </td>
    </tr>
</table>

<pre>
    On Windows 32bit, the x87 control word has different default values than on other platforms. This not only introduces floating point precision issues, but also results in inconsistent behavior with other platforms. I tried adding the `-msse2` option to avoid using x87, but the compiler still generates binaries using only x87.

The code below outputs differently on Windows 32bit than on other platforms:
```c
#include <stdio.h>
#include <stdint.h>

int main() {
    int64_t n = 0b0000000000111111111111111111111111011111111111111111111111111111;
 printf("%lld, %.0f, %.0f", n, (float)n, (float)(uint64_t)n);

 return 0;
}
```

rust-lang/rust#105626
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U02P5CYQ_TX4UhoL4_bXwYfsdlrKKZeVcoywKbcrocGCYnrm30e4e3Y7M2pkYaDgveJRT8dIZ4c4iuabaI6FTrz6MNKMJvj5X-Ri8uZ9_NPBX-SMv0ao1UQs1HfgFeGt72D2joO3cPXBwKojGFoWDOgYDC46WYZXbRNG4FU78A48rxhgs5oXHy6xhB8rRXCewTv7DpTxTJoxwmK9ZnJn2Dw5hi3gTJG8A4oxYcxpTIlB2-ghYEyWI5ADcrN3kSLnJCZc9Sv5AFfi9Sv3H8CB0IA2JhPlW4lWvlxiRCVaCX7jTMge9KsnAynmbW9990GeT8z-spHFAJHJWjijw6AZI0zkdCCM92P7_d76rhTyKORvt_7HDmAQJrT-Cj7xlvhBRvueRfuf_s-kFPUdU7Ty9s33uarJzTYZBFF_j2zIl6uof38WdfwY3vv8ABdNTqheqAFE9-22DgD5ydrD3wwORH0EOcmfrXrSngb2JuoP8C2Q42XnVEI11pqsu1BNKZfHkcoTd1vp97IRavg8F6pP91Rv0eEn0Z0uIKfgQP5a746fFH3cH1LkF6vdWahTHgtVV7JpVVuYsTZDPegCx6rtVNsOapDFOpp6aFW_DHLuFtXiMhwWjRMq2SMuStcFjUqqWlZSVQdV1bJchm6ptGqMnprq0AziIPGiyZbWvl5KH87FboaxGbq-K6ye0Mbdzko5vN6ckvVpjkUY85mXKZ2jOEhLkeMvFCa2OH5xND0a-nMdFinYcWXe9spTJ6FOZ-I1TeXsL0KdMvj997IF_w_OLNTpw7ynPeX_AgAA__9-UWY-">