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

Get the SH2 dynarec working (x86/x64) #51

Open
inactive123 opened this issue Oct 13, 2018 · 7 comments
Open

Get the SH2 dynarec working (x86/x64) #51

inactive123 opened this issue Oct 13, 2018 · 7 comments

Comments

@inactive123
Copy link

I think one of the main stumbling blocks right now with the Yabause core is that we have to fall back on the SH2 interpreter instead of using the dynarec.

I believe PIC compliance issues are still a problem with the x86/x86_x64 dynarec as it is right now. Once this is fixed, I believe we could finally build yabause with the dynarec working.

@nayslayer I hope you will be able to research this. I am already putting down $50 towards this purpose.

Ideally this could be used for Kronos as well, which is another Yabause fork - you can find the repo for that one here -

@inactive123
Copy link
Author

Added this bounty here starting at $50 -

https://www.bountysource.com/issues/64699532-get-the-sh2-dynarec-working-x86-x64

@nayslayer You could consider this a separate stepping stone bounty to see if the Yabause dynarec approach is feasible for Beetle Saturn.

@nayslayer
Copy link

nayslayer commented Oct 19, 2018

@twinaphex Hey there. I've skimmed the relevant (assembly) code and it's indeed not PIC-compliant. I guess you've tried to build the x64 dynarec and it failed to link, am I right? I'll work on fixing that next. To skip the tedious work of adding (%rip) after every constant name I'll have to switch to the modern yasm (or otherwise nasm) assembler instead of the (hideous and obsolete) gnu as - hope you don't mind that too much.

@barbudreadmon
Copy link
Collaborator

The kronos libretro port is now a branch of this repo, and the cached interpreter method it is using might be the same performance-wise and better compatibility-wise.

@barbudreadmon
Copy link
Collaborator

@twinaphex @nayslayer There is a JIT interpreter in latest yabause sources (with arm, aarch64, x86 & x86_64 backends it seems), i tried enabling it in d951f40 but it just crashes for some reason (it's built by default upstream so i would expect it's supposed to work ?). Maybe someone would like to take a look.

Also tagging @d356, the author of this JIT, maybe he'll want to help

@rcaridade145
Copy link

@barbudreadmon That compiler is based on Play! Codegen and afaik it does not support sh2 Yabause#320 . Just DSP and others. Perhaps there has been some fix between 2016 and now to the codegen lib. What was the error?

@barbudreadmon
Copy link
Collaborator

Here is the error :

../sh2_jit.cpp:2739: void recompile_and_exec(SH2_struct*): Assertion `(context->jit.pc & 0xfff00000) == 0' failed.

This jit was added as a SH-2 cpu core in b12a74d, and also seems to be built by default, are you sure it's not supposed to work ?

@rcaridade145
Copy link

rcaridade145 commented Aug 27, 2019

@barbudreadmon I just remember reading that it was not ready for prime time. That work was all after the 0.9.15 release . So probably it is a work in progress, at least for the SH2.

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

No branches or pull requests

4 participants