Slightly OT: Mame compiler questions

Talk about anything else you want

Moderator: BigEvilCorporation

Post Reply
sheath
Very interested
Posts: 141
Joined: Wed Aug 15, 2007 1:44 pm
Location: Texas
Contact:

Slightly OT: Mame compiler questions

Post by sheath » Fri May 22, 2009 5:47 pm

While testing Regen for AMD compatibility with Aamir I remembered something I thought about last year with MAME. There are compilers out there, and optimization tutorials for AMD processors. This would be a significant learning curve for me, as I've never compiled anything outside of a basic C or C++ file. Does anybody in here have experience or advice as to whether a MAME executable optimized for Athlon 64s would be of any benefit?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri May 22, 2009 8:08 pm

Probably not. If there really is an AMD issue with Regen, it's almost certainly in any assembly language sections he has. There are subtle differences between AMD and Intel that systems and compiler writers need to be aware of, and a good set of the manuals is more helpful. For example, AMD can have some issues with SSE instructions on improperly aligned data. That would be the first place I'd check for AMD issues - assembly functions using SSE. You see the same issues in video codecs, which usually have lots of hand-tuned assembly for best speed.

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM » Fri May 22, 2009 8:30 pm

I will be sending a profiler-enabled build to him to see where the problem is.
Does anybody in here have experience or advice as to whether a MAME executable optimized for Athlon 64s would be of any benefit?
For MAME, I don't think so. Thats because MAME is a accuracy oriented emulator that employs accurate but slower techniques to emulate. Optimizing like you said would only make a little effect.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri May 22, 2009 9:38 pm

I think he's talking about MAME's "universal" dynamic recompiler. It's an effort to try to make the emulation faster since a lot of the "newer" arcades they are emulating are at PSX or better levels, which means the old interpretive CPU cores don't cut it.

The problem with looking at MAME's DR is that DR is composed of very limited instruction sets - things like load, store, logical op, arithmetic op, branch... it's kept limited to make it more simple than most assembly languages which makes it easier to debug.

sheath
Very interested
Posts: 141
Joined: Wed Aug 15, 2007 1:44 pm
Location: Texas
Contact:

Post by sheath » Sat May 23, 2009 12:18 am

I see. Since I prefer using Mame Plus the complexity of such a task, combined with connecting it to the UI, is probably out of my reach anyway. I do have some time on my hands though, and I've always wanted to finish learning a non-web based programming language.

Post Reply