libretro / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
41 stars 63 forks source link

Add aarch64 support to the SH2 dynarec #87

Open dsx724 opened 6 years ago

dsx724 commented 6 years ago

Right now, the SH2 dynarec (used for Sega 32X) only works for the following platforms:

Every other architecture right now has to fall back on an interpreter core which is not fast enough for many low powered Aarch64 SoCs, including the one on the Nintendo Switch.

This bounty is for the purpose of adding an Aarch64 dynarec backend as well to the existing SH2 dynarec. Perfomance needs to be comparable or better than the existing dynarecs.

https://www.bountysource.com/issues/64126757-missing-feature-ifdef-__aarch64__-in-cpu-sh2-compiler-c

Bounty has been started and starts at $50.

Edited by: twinaphex

dmiller423 commented 6 years ago

They are what 20mhz? The interpreter must be terribly slow...
This is odd since the instructions are 16b like thumb and a jump table / [] func *'s caches well compressed. Theoretically even on bad performance 2x of them should only take ~400-500mhz to emulate...

Also isn't ARMv8 capable of running 32b arm code?

andres-asm commented 6 years ago

ARMv8 can, switch, or at least libnx can't. Even if it could that doesn't make the bounty irrelevant. AARC64 SoCs are becoming common and there are gonna be slow SoCs, fast SoCs, bad SoCs, good SoCs.

dmiller423 commented 6 years ago

I don't have a ton of time, but given enough interest, perhaps I could add an aarch64 emitter to the dynarec in reicast and add it to picodrive as well.

dsx724 commented 6 years ago

How much time would you estimate such a project would take?

dmiller423 commented 6 years ago

A full aarch64 emitter to satisfy reicast would take a few weeks, updating the recompiler and testing would take several more per target. Prob ~ 2-3mo

irixxxx commented 5 years ago

Would this be satisfactory: https://github.com/irixxxx/picodrive

m4xw commented 5 years ago

@irixxxx I will check it out and try it on the Switch, if it's satisfactory and you want the bounty, sure go claim afterwards. Will probably be a few days since I have a lot of stuff to do IRL.

Panderner commented 4 years ago

Current state of aarch64 dynarec?

hizzlekizzle commented 4 years ago

no change

Panderner commented 4 years ago

Any updates for this?

hizzlekizzle commented 4 years ago

Nope. No change.

irixxxx commented 3 years ago

With current core It should be enabled on all build targets with aarch64 architecture. Any feedback?

m4xw commented 3 years ago

It doesn't seem to be enabled for Switch (libnx)? I would expect a crash since it would need support for dual bases in the emitter (different rx and rw buffers) but it runs as usual. Should be fairly simple to add support tho if its now in the repo.