Skip to content

Conversation

@Andarwinux
Copy link
Contributor

Some platforms like MinGW have suboptimal isnan, so use __builtin_isnan instead if possible.

https://godbolt.org/z/snPKGPfKo

Some platforms like MinGW have suboptimal isnan, so use __builtin_isnan instead if possible.
@Andarwinux Andarwinux changed the title osdep/compiler.h: introduce mp_isnan osdep/compiler: introduce mp_isnan Nov 1, 2025
@Andarwinux
Copy link
Contributor Author

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.

https://godbolt.org/z/9GbP6dE8a

@kasper93
Copy link
Member

kasper93 commented Nov 2, 2025

@mstorsjo: Do you think we could improve situation upstream? Currently we are using inline impl from mingw. With __CRT__NO_INLINE=1 we can jmp to CRT isnan, but generally speaking would be nice to use compiler generated impl if possible, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants