mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-12-06 20:53:40 +01:00
All PowerPC add and subtract instructions compute a + b + carry_in, with ~rA as a for the subtract forms. Helper_Add computes this sum in 64 bits and writes rD. Depending on its template parameters, it also writes CA (bit 32 of the sum), and OV and CR0 as requested by the OE and Rc bits. This replaces the carry and overflow code of each instruction and HasAddOverflowed. There is no behavior change. With GCC -O3 on x86-64, each instruction compiles to the same number of host instructions as before, or one fewer.