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
Enable short float repr() on Solaris/x86 #50042
Comments
The short float repr() that's in 3.1 (probably) doesn't work on It probably works on Solaris/x86/gcc, though confirmation of that would be Marking as easy, because this should be an easy task for someone who has |
See the comments in the Include/pyport.h file for an explanation of |
There are some related comments in issue bpo-7281. |
I can confirm that short float repr() is active and all float tests are Ubuntu64bit -> KVM -> OpenSolaris32bit/Python3.2/gcc |
Stefan Krah mentions in the bpo-7281 discussion that suncc supports |
I see two alternatives: (1) Use fesetenv. I don't know what the appropriate value to pass would (2) Use inline assembly, assuming that suncc supports this. This seems |
Looking at: http://docs.sun.com/app/docs/doc/816-5172/fesetenv-3m it seems that fesetenv isn't what we want here. It 'only installs the |
Stefan, is it possible that suncc already accepts the assembler syntax |
The inline asm compiles, but I don't know how good the GNU inline asm That said, perhaps fesetprec works, too: |
Excellent! From a bit of searching, it looks as though this assembler Thanks for finding fesetprec as well. It's a shame this isn't standard Next problem: when compiling with suncc, how do I detect (in the (1) that I'm using suncc, and For gcc, configure.in is using: if test -n " to detect whether we're on x86. I guess it's too much to hope for that |
fesetprec and fegetprec are at least semi-standard, it seems. They're http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf ). |
If gcc and suncc are present, ./configure chooses gcc and everything is If only suncc is present, it's detected as cc. These tests should be stefan@opensolaris: |
Thanks. uname looks like the way to go, then. Is your copy of OpenSolaris running in 32-bit mode or 64-bit mode? Does I think the configure test for the inline assembly should go ahead on Actually, I guess I could just make that configure test unconditional. |
Stefan, please could you test the attached patch (against py3k) with |
My copy is 32-bit. I never installed a 64-bit version, but I strongly |
Tested the patch against an updated 3.2. repr-style is 'short', and I As for the other tests, the errors I get seem to be the same with or |
Many thanks for testing this, Stefan! I'll tidy up the patch a little bit |
Well *ideally* you shouldn't be getting any test failures :-). But I Tests I'd be worried about for the float repr change include: |
The tests that you mention run o.k., except capi, but that looks harmless: stefan@opensolaris:~/svn/py3k/Lib/test# ../../python test_capi.py ---------------------------------------------------------------------- OK
internal test_L_code
internal test_Z_code
internal test_capsule
internalTraceback (most recent call last):
File "test_capi.py", line 170, in <module>
test_main()
File "test_capi.py", line 130, in test_main
print("internal", name)
ImportError: No module named _curses Tests that fail: test_ascii_formatd, test_calendar, test_datetime, test_distutils, A lot of these fail either due to the inability to allocate resources or |
Is the test_ascii_formatd failure due to a failed 'from ctypes import Thanks for this. |
Yes, test_ascii_formatd fails with 'ImportError: No module named _ctypes'. |
Committed in r76300 (trunk) and r76301 (py3k). Thanks for all your help, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: