Message155590
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. |
|
Date |
User |
Action |
Args |
2012-03-13 11:47:32 | skrah | set | recipients:
+ skrah, jcea, mark.dickinson, eric.smith, python-dev, samuel.iseli |
2012-03-13 11:47:32 | skrah | set | messageid: <1331639252.57.0.280781355485.issue13889@psf.upfronthosting.co.za> |
2012-03-13 11:47:31 | skrah | link | issue13889 messages |
2012-03-13 11:47:31 | skrah | create | |
|