gh-153740: use native _Float16 in PyFloat_Pack/Unpack2 - #154796
gh-153740: use native _Float16 in PyFloat_Pack/Unpack2#154796skirpichev wants to merge 7 commits into
Conversation
|
Not sure how to fix this error: CC @StanFromIreland (fuzzers) |
|
The configure probe only tests a compile-time |
46fe384 to
8bda53a
Compare
Good idea, that works. |
| # Check for native half-float type. | ||
| AC_CACHE_CHECK([for _Float16 support], [ac_cv_float16_supported], | ||
| WITH_SAVE_ENV([ | ||
| CFLAGS="$CFLAGS -mf16c -O0" |
There was a problem hiding this comment.
Do you need/want -mf16c?
I think GCC will call __truncdfhf2 without it.
There was a problem hiding this comment.
You can get support for half-floats without real hardware support. This happened on my old laptop. I don't think it's useful.
There was a problem hiding this comment.
The F16C extensions (VCVTPH2PS and VCVTPS2PH) convert to/from binary32, which doesn't help you if you're trying to convert directly from binary64. So, I think you might as well eliminate the -mf16c from the configuration test above. (Also, it doesn't apply to AArch64, for which I use -march=armv8.4-a+sve when using half precsion.)
I hope you do get this PR merged. If CPython is compiled with -mavx512fp16 or -mavx10.1 or -mavx10.2, then the compiler will generate vcvtsd2sh (scalar double to scalar half) without calling the library's __truncdfhf2 function.
|
🤖 New build scheduled with the buildbot fleet by @skirpichev for commit ac38cb8 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154796%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Uh oh!
There was an error while loading. Please reload this page.