-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimisations. #4
Conversation
Setting the rounding mode on some host architectures (including x86, according to <http://www.mega-nerd.com/FPcast/>) empties the floating-point unit's pipeline, resulting in poorer performance. Omitting the rounding mode before exact operations restores some performance. Affected opcodes are CVT.W.S, CVT.W.D, CVT.L.S, CVT.L.D, ABS.S, MOV.S, NEG.S, ABS.D, MOV.D and NEG.D.
The rounding mode is completely unneeded when converting from W (32-bit integer) or S (32-bit floating-point) to D (64-bit floating-point), and is actually unused on MIPS processors. Quoting from the MIPS Programmer's Manual, volume 2, for CVT.D.fmt: The value in FPR fs, in format fmt, is converted to a value in double floating point format and rounded according to the current rounding mode in FCSR. The result is placed in FPR fd. If fmt is S or W, then the operation is always exact.
Hi Nebuleon, thanks for this patch. In reviewing the changes, I think that the following instructions still need to retain the rounding mode set function call: cvt_w_s These instructions perform a conversion from floating-point to integer, which loses precision. As such, I think that their results will be affected by the current rounding mode. Aside from this, the other changes look good. |
Because none of the sixteen functions actually needs the rounding mode to already be set, the issue is not that the rounding mode is not needed, it's that the rounding mode is needlessly set twice. I am sorry for the confusion and the lumping into the same commit. Reference: mupen64plus-core/src/r4300/fpu.h Line 162 in f2247c5
|
I see, thanks for the explanation. |
Move seek_track logic to disk module
Capture backend
I attach some commits that optimise some rather common cases in interpreted opcodes:
J*_OUT
andB*_OUT
) targetting the physical addresses (0x80000000
inclusive to0xC0000000
exclusive).