rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

PPU: FCMPO inaccuracies

Open AniLeo opened this issue 8 years ago • 9 comments

Currently FCMPO has equal implementation as FCMPU.

Whenever [11] appears on comparison, it returns 00001000 on getFPSCR(), which is the correct value for FCMPU, but not for FCMPO. On a real PS3, this value is A0081000 on FCMPO. Since we fall back to using the same implemention of FCMPU, we're obtaining the wrong value here when using FCMPO.

Tested on Recompiler (LLVM), everything else besides that scenario is accurate.

Note: On Interpreters on RPCS3, the sample always returns 00000000 on getFPSCR(). Something is wrong there as well.

Verified with ppu_float_compare on latest RPCS3 and physical PS3.

AniLeo avatar Sep 29 '17 23:09 AniLeo

After doing some research the issue is that the NaN exceptions are not implemented. If you look at https://github.com/RPCS3/rpcs3/blob/adf119e960cc455d526de650bc53901fc1755a40/rpcs3/Emu/Cell/PPUTranslator.cpp#L4141-L4153 you can see the NaN exception calls are commented out (and if you do uncomment it, it doesn't compile).

Perhaps this could be added to the roadmap?

hcorion avatar Sep 30 '17 06:09 hcorion

Needs updating / retesting.

dio-gh avatar Oct 08 '19 17:10 dio-gh

Interpreter's bug has been fixed.

elad335 avatar Oct 08 '19 17:10 elad335

So it's still an issue on the recompiler? Would make sense to keep the ticket open then I guess.

dio-gh avatar Oct 08 '19 17:10 dio-gh

Yes, but they are both on the same state now.

elad335 avatar Oct 08 '19 17:10 elad335

Closable then. :tada:

dio-gh avatar Oct 08 '19 17:10 dio-gh

I meant only this.

Note: On Interpreters on RPCS3, the sample always returns 00000000 on getFPSCR(). Something is wrong there as well.

elad335 avatar Oct 08 '19 17:10 elad335

The issue still persists since FCMPO and FCMPU are still implemented by exactly the same code

AniLeo avatar Apr 08 '25 04:04 AniLeo

This should be investigated, who knows whats being broken because of this

FarmerJoe7355 avatar Nov 12 '25 19:11 FarmerJoe7355

maybe this is another bug that could be analyzed and fixed by @elad335, as he did recently with a similar bug fixed by #17690?

digant73 avatar Nov 18 '25 10:11 digant73

Long story short, there is no practical different between FCMPU and FCMPO for generic applications. Which is why PS3 applications work even though the implementation is identical. The difference lies in how they raise floating point exceptions, not known application read floating point exceptions.

elad335 avatar Nov 18 '25 10:11 elad335

@elad335 I see, so it’s not necessarily needed then

FarmerJoe7355 avatar Nov 28 '25 10:11 FarmerJoe7355