Skip to content
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

Account creation on the wiki (or just answer to my question... 😅) #773

Closed
philou-felin opened this issue Aug 25, 2020 · 7 comments
Closed
Labels

Comments

@philou-felin
Copy link

Hello! I wanted to ask a question on the wiki (in a Talk page), but I can't create an account. (That would be neat to have an account!) I understand there are only 24 hours in a single day, but I simply have a some questions about CPU emulation. What are the differences between pure interpreter, cached interpreter and dynamic recompiler in terms of accuracy/compatibility and performances?

Thanks! 😀

@Narann
Copy link
Member

Narann commented Aug 26, 2020

Pure interpreter take every instruction and emulate it individually. So one N64 CPU instruction take many x86 CPU instruction to be emulated.

Cached interpreter, I don't know.

Dynamic recompiler (aka dynarec) recognize (sometime big) blocks of instructions that can be emulated more efficiently and generate x86 code on the fly (Just In Time, JIT). An example sum computation, sort algorithm, float manipulation etc. It recompiles N64 program code to x86 code.

The latest is faster the first is slower.

This shouldn't change anything to accuracy (both can be accurate and/or inaccurate), but because of the complexity, accuracy is easier to get with pure interpreter than dynarec.

@Narann Narann closed this as completed Aug 26, 2020
@richard42
Copy link
Member

For the pure interpreter, it has to do a bunch of work before it actually executes the instruction. For example, it needs to parse out the source, target, and destination registers bitfields from the instruction opcodes and use these to get pointers to the actual register locations inside the machine state table. Also, it needs to parse out the instruction type and get a pointer to an instruction table. For memory accesses, it needs to extract an offset value and calculate a pointer to the DRAM table, etc. For the Cached Interpreter, all of these variables which need to be calculated in order to execute the instruction, are saved into a cache data structure, so they do not need to be re-parsed and re-calculated every time the instruction in executed.

@philou-felin
Copy link
Author

Thanks to both of you! I initially did not replied because the issue was closed and I didn't know whether I could reply.
Are there any reasons to use Pure over Cached? (for gamers)

@Narann
Copy link
Member

Narann commented Aug 27, 2020

Gamers should use dynarec. If no dynarec is possible, cache can be an option depending on hardware power.

@philou-felin
Copy link
Author

Gamers should use dynarec. If no dynarec is possible, cache can be an option depending on hardware power.

There's a bug in the Libretro's Mupen64Plus-Next core when using the implementation of Dynarec + ParaLLEl RSP/RDP. There's an open issue if you are interested.

@Jj0YzL5nvJ
Copy link
Contributor

Are there any reasons to use Pure over Cached? (for gamers)

Very few, but there are some. The vast majority are indirectly related to the current FBInfo implementation, homebrew games and test ROMs: #710, #738, gonetz/GLideN64#2046, gonetz/GLideN64#2179, gonetz/GLideN64#2180, gonetz/GLideN64#2215

There's a bug in the Libretro's Mupen64Plus-Next core when using the implementation of Dynarec + ParaLLEl RSP/RDP.

Mupen64Plus-Next is a fork with its own characteristics. The real issue is whether the bug exists with NewDynarec+paraLLEl-RSP+Angrylion-RDP-Plus too.
If the answer is positive, then try paraLLEl-RSP+Angrylion-RDP-Plus on upstream with a NewDynerac core. paraLLEl-RSP also exists for mupen64plus (two branches actually). My branch is more in sync with RA.

There are some other differences between "OldDynarec" and NewDynarec. Even Pure Interpreter offers different results on NewDynarec builds (x86 core is pure madness): #572, ata4/angrylion-rdp-plus#89

@philou-felin
Copy link
Author

This is a little bit too advanced for me. 😅 I can only hope that maintainers from Libretro can work this out with other repo maintainers like you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants