Message155590
| Author |
skrah |
| Recipients |
eric.smith, jcea, mark.dickinson, python-dev, samuel.iseli, skrah |
| Date |
2012年03月13日.11:47:31 |
| SpamBayes Score |
1.0122991e-10 |
| Marked as misclassified |
No |
| Message-id |
<1331639252.57.0.280781355485.issue13889@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I've looked at the latest patch: It seems that new_387controlword is
not set if old_387controlword already has the desired precision and
rounding mode.
Attached is a revised patch that uses the same logic as the Linux
version. A couple of remarks:
- It would be possible to negate (_PC_53|_RC_NEAR) instead of
enumerating (_MCW_DN|_MCW_EM|_MCW_IC). I found it nice to
see all possibilities listed.
- Technically we might need to use #pragma fenv_access (on). I'm not sure
where though: If it is set in pyport.h, VS complains that Py_MATH_PI / 180.0
is not constant.
The patch is tested on win32/x64. Additionally, the patch is tested
with setting the rounding mode to _PC_64 in main.c. Then, the
patch is tested with replacing the 'if' bodies by 'abort()'. This
shows that in the regular build (_PC_53 on startup) the bodies of
the if statements are never executed.
Finally, inserting an #error after #if defined(_MSC_VER) && !defined(_WIN64)
on the x64 build shows that !defined(_WIN64) really does its job. |
|