mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 15:00:53 +02:00
This comes in the form of a new define and a new function. Assuming assert doesn't quite cover 100% of our asserting logging use cases so we need to break this out. If the compiler can't see through side effects at compile time for the predicate then it'll throw a warning. This gives us a nice behaviour. In the case that asserts are enabled, we fall down the assert checking path. So if an assert fails to predicate we will do an assert log like normal. The change comes when we build release without asserts, we use the `__builtin_assume` definition to allow the compiler to optimize around assumptions. Since these aren't runtime asserts in release build, this gives us some small optimizations in various locations. Clang will very specifically do additional optimizations when you provide it `__builtin_assume` directives that can really be worth it.