dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

PowerPC: Raise alignment exceptions in more situations

Open JosJuice opened this issue 4 years ago • 8 comments

~Intends to improve https://bugs.dolphin-emu.org/issues/12565.~

To avoid affecting the performance, the JITs will most of the time not raise alignment exceptions unless you enable the new INI-only setting AlignmentExceptions.

JosJuice avatar Jul 05 '21 08:07 JosJuice

While alignment exceptions turned out to have nothing to do with issue 12565, alignment exceptions are still something that would make sense for us to emulate (even if it doesn't affect any games). I've cleaned up the PR after the merge of the PR that fixed 12565, and it should be more or less done other than my earlier question about Jit64.

JosJuice avatar Aug 16 '21 18:08 JosJuice

Do you have any rough measurements for how big of a performance hit checking for alignment exceptions is?

You are probably right about there being a hit, but I'd rather it was enabled by default (Or tied to the MMU option), if that's at all feasible.

phire avatar Aug 05 '22 10:08 phire

I tested the intro of Wind Waker on my laptop now, and unfortunately it's significant. At the most lightweight part of the intro I got around 80 FPS without checking for alignment exceptions, and around 50 FPS with. The difference in heavier parts of the intro was smaller – a difference of 5 to 10 FPS or so.

The part of the change that I think is the heaviest (I haven't benchmarked it) is that the JIT emits a few extra instructions for every float loadstore to manually check its alignment.

JosJuice avatar Aug 05 '22 12:08 JosJuice

Yeah, that's large.

phire avatar Aug 05 '22 12:08 phire