mupen64plus / mupen64plus-core

Core module of the Mupen64Plus project
1.29k stars 257 forks source link

new_dynarec: fix FPU crashes #1027

Closed Rosalie241 closed 1 year ago

Rosalie241 commented 1 year ago

This patch fix the new dynarec crashes on ARM and ARM64 platforms since the interpreter accuracy improvements, a RMG user reported it a while back and I made this experimental patch for it which fixes it (tested it on my pinebook pro aswell).

I had no idea the new dynarec called the FPU functions from fpu.h, and for some reason it kept working fine on x86_64, so I didn't notice it at all until the report came in from a RMG user, after some discussion with @m4xw, he said that we could best wait for @Gillou68310 to come up with a proper patch, but that was a while ago already, so to correct my mistake, I'm offering my patch, which could be improved later by Gillou if he wants to, but it fixes the crashes now instead of later, so users who are trying the latest git version of mupen64plus won't be hit by this bug anymore, but it's upto you (the maintainers) whether you agree with my thoughts on that or not.

This code was written by looking at other FPU functions which already had fcr31 pointer as first argument before my changes, so I copied that dynarec code and placed it everywhere where needed, which solves the crashes.

Fixes https://github.com/mupen64plus/mupen64plus-core/issues/1026