osdep/compiler: introduce mp_isnan - #16995
Conversation
879e104 to
aaa222d
Compare
|
Using __CRT__NO_INLINE makes things worse, because MinGW's inline isnan in most cases only makes automatic vectorization less efficient, while libcall isnan even makes vectorization impossible. |
|
@mstorsjo: Do you think we could improve situation upstream? Currently we are using inline impl from mingw. With |
Some platforms like MinGW have suboptimal isnan, so use __builtin_isnan instead if possible.
aaa222d to
cf93d5c
Compare
|
Download the artifacts for this pull request: Windows |
|
Can we continue? Even if MinGW makes such changes internally, it would take a long time for them to reach distributions, but custom isnan would be available immediately. |
|
I don't know. What are we fixing here really? Is there critical performance issue that needs to be fixed or is this microoptimization? I agree it can be improved, but unless there is good reason I don't see why we need to do it in mpv, and not in toolchain. What about libplacebo or ffmpeg? |
libplacebo does not use isnan, while ffmpeg is already using a custom isnan. Speaking of performance, I initially discovered this issue in mujs and svtav1-psy, where a 5% improvement was observed in benchmarks (on top of PGO+LTO). |
I don't think in mpv you would see any measurable difference. I would rather focus on bottlenecks that we have. One of which is currently libass, if you want to profile and optimize that. |
Yes, I also plan to do this for libass later (it does have a noticeable impact). But there's no harm in doing it in mpv. |
Some platforms like MinGW have suboptimal isnan, so use __builtin_isnan instead if possible.
https://godbolt.org/z/snPKGPfKo