Post Reply 
 
Thread Rating:
  • 1 Votes - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PPSSPP on a mips device?
06-09-2013, 09:35 AM
Post: #1
PPSSPP on a mips device?
Hi, i'm curentlly on the scene of a mips based open-source linux device called gcw-zero, so I was talking on the irc with mth, and we talked about psp emulation.

What I want to know is, can we run ppsspp on mips? since psp uses mips cpu we would only need to emulate the mediaengine apart.

So what do you think it would be easier, a wine-like aproach with low-level gpu comunication and emulating the extra stuff from scratch or using ppsspp as base?
Find all posts by this user
Quote this message in a reply
06-09-2013, 10:32 AM
Post: #2
RE: PPSSPP on a mips device?
You can't use the CPU directly, you still need to emulate parts of it. Then, we already have a wine like approach. Considering MIPS devices aren't so common, it's not likely that we'll have a proper MIPS version soon with the right amount of optimisations.
Find all posts by this user
Quote this message in a reply
06-09-2013, 02:32 PM
Post: #3
RE: PPSSPP on a mips device?
Supposedly it runs on one MIPS processor that internally emulates ARM or x86, I can't remember.

It's doable but we'd have to write a jit for it since the memory access has to be different, and the PSP has some special opcodes. So it can't really be native or even necessarily wine like, since the instructions themselves are different.

-[Unknown]
Find all posts by this user
Quote this message in a reply
06-09-2013, 06:20 PM
Post: #4
RE: PPSSPP on a mips device?
(06-09-2013 02:32 PM)[Unknown] Wrote:  Supposedly it runs on one MIPS processor that internally emulates ARM or x86, I can't remember.

It's doable but we'd have to write a jit for it since the memory access has to be different, and the PSP has some special opcodes. So it can't really be native or even necessarily wine like, since the instructions themselves are different.

-[Unknown]
Psp emulates arm/x86?

Wow, that's weird
Find all posts by this user
Quote this message in a reply
06-09-2013, 06:56 PM (This post was last modified: 06-09-2013 06:56 PM by [Unknown].)
Post: #5
RE: PPSSPP on a mips device?
No, no, backwards. I think it was Longsoon. Apparently its MIPS cpu has some dedicated instructions for emulating either x86 or arm (I forget which, I think x86?) I know there were fixes to make PPSSPP compile on it, and supposedly the jit works (with that emulation.)

The PSP itself does not emulate any other instruction sets.

-[Unknown]
Find all posts by this user
Quote this message in a reply
06-09-2013, 07:44 PM
Post: #6
RE: PPSSPP on a mips device?
(06-09-2013 06:56 PM)[Unknown] Wrote:  No, no, backwards. I think it was Longsoon. Apparently its MIPS cpu has some dedicated instructions for emulating either x86 or arm (I forget which, I think x86?) I know there were fixes to make PPSSPP compile on it, and supposedly the jit works (with that emulation.)

The PSP itself does not emulate any other instruction sets.

-[Unknown]

it was x86
Find all posts by this user
Quote this message in a reply
06-09-2013, 07:50 PM
Post: #7
RE: PPSSPP on a mips device?
Isn't MIPS and ARM very close? on an unrelated note, wouldn't ARM builds have more speed/compatibility potential than x86/x64?
Find all posts by this user
Quote this message in a reply
06-09-2013, 08:21 PM (This post was last modified: 06-09-2013 08:27 PM by [Unknown].)
Post: #8
RE: PPSSPP on a mips device?
Well, for CPU at least, the most crucial difference between MIPS and ARM is how they handle 32-bit constants, which turns out to be pretty common.

In MIPS, you'll often see:
lui a0, 0x1234
addiu a0, a0, 0x5678

On x86, this would be (and the jit combines it automatically):
MOV edx, 0x12346578

On ARM, it's reversed on ARMv6T2+ and has to eat a memory cycle on older ones.
MOV r2, 0x5678
MOVT r2, 0x1234

This seems like a trivial diffence, but it ends up adding a lot of ops from what I've seen. PSP games will lui once, and then use that same reg to displace other addresses. For example:
lui a0, 0x1234
addiu a1, a0, 0x4123
lw a2, a0(0x3214)
addiu a3, a0, 0x4980

This makes a lot of sense because of the way it's written. But in ARM, that has to end up something like this in the best case:
MOV r2, 0
MOVW r2, 0x1234
MOV r0, 0x4123
ADD r3, r2, r0
MOV r0, 0x3214
ADD r0, r0, r2
LDR r4, r11, +r0 ; All memory access has to be offset.
MOV r0, 0x4980
ADD r5, r2, r0

In practice, I think we actually do worse than the above with extra MOVW's. However, for *certain* constants we're able to optimize this down to less ops.

That's at least double as many instructions, just because they handle immediate values so differently. In contrast, here's what x64 (just to type simple reg names) looks like:

MOV rdx, 0x12340000
MOV r8, 0x12344123
MOV r9, [rbx + 0x12343214] ; All memory access has to be offset.
MOV r10, 0x12344980

So x86 is actually a lot more efficient in this case.

-[Unknown]
Find all posts by this user
Quote this message in a reply
08-30-2014, 02:51 PM
Post: #9
RE: PPSSPP on a mips device?
Sorry to reply in the old thread, but a new MIPS (Just MIPS32) Development Board called CI20 made me think about such port again. It seems that there's still no documentation saying that PPSSPP works on MIPS.

Here is the link for CI20: store.imgtec.com/product/mips-creator-ci20/
(HTTP of course)

It was available for free for a short time, and they ran out of available boards. I was thinking about making a PSP-emu board actually..
Find all posts by this user
Quote this message in a reply
08-30-2014, 05:20 PM
Post: #10
RE: PPSSPP on a mips device?
It would definitely need some porting efforts. Should be possible, though.

It won't run out of the box, primarily because you'll need to stub out the jit and use only the interpreter (and it'll be super slow until a jit is built.)

-[Unknown]
Find all posts by this user
Quote this message in a reply
11-12-2014, 07:42 AM
Post: #11
RE: PPSSPP on a mips device?
I have acquired a CI20 using that Ingenic MIPS processor.
I will begin porting efforts Smile
Find all posts by this user
Quote this message in a reply
11-12-2014, 09:18 AM
Post: #12
RE: PPSSPP on a mips device?
Cool Smile Getting it up and running on the interpreter shouldn't be too hard, at least.
Find all posts by this user
Quote this message in a reply
11-14-2014, 05:24 AM (This post was last modified: 11-14-2014 05:24 AM by xsacha.)
Post: #13
RE: PPSSPP on a mips device?
Interpreter running fine now on CI20 and GCW-Zero too.
Both devices having issue with graphics drivers.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: