On Thu, 6 Feb 2025, LIU Hao wrote:

在 2025-02-06 20:19, Martin Storsjö 写道:
Hmm, using __asm__ this way does seem to be enough to avoid the issue in practice with Clang, but I presume you mean that there's a risk that a future version of Clang might still optimize it back to sincos()?

See e.g. https://gcc.godbolt.org/z/xParTM577 for a comparison of how Clang and GCC behave with this test snippet.

Yes exactly. If it has to be implemented in assembly then there should be a reason like that.

Right - but here I would very much like to _not_ implement this in assembly; we have a handful of other similar functions, e.g. exp2(x) -> pow(2, x) and similar, where it would be nice if we could just avoid unnecessary assembly.

So would you feel ok with doing sincos() here with __MINGW_ASM_CALL(), as practical Clang doesn't seem to break it at the moment, even though it in theory could do that?

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to