Compile z_bgcheck.c on arm64 macOS with -ffp-contract=off#6584
Conversation
|
thinking more, we can apply this flag globally |
|
I know audio stuttering has been an issue on the macOS version in the past, but I can try running a version with the flag applied globally to get a quick idea of any effects on performance when I get home from work this evening |
|
mac stuttering was caused by calling |
1142edf to
8369c56
Compare
|
I just tested a build with the flag applied globally in the top-level CMakeLists.txt and didn't observe any performance regressions |
|
I'm curious if this is needed for Windows ARM too, #6635 |
i fully fixed macos audio here btw, try it out Kenix3/libultraship#1098 + #6594 |
|
i tested this pr also fixes the water temple softlock from #6620 |
When compiling for arm64 and x86_64, compiler optimizations for contracting floating point operations to fused-multiply-add instructions behave differently, producing code that is not IEEE 754 compliant on arm64 macOS. In some specific scenarios, these inconsistencies result in different behavior from the base game, such as not being able to enter Bottom of the Well as adult using a weirdshot.
This pull request adds the compiler flag "-ffp-contract=off" only on arm64 macOS to disable these optimizations in z_bgcheck.c, restoring IEEE 754 compliant behavior for those specific interactions.
Build Artifacts