Page 1 of 1

Slightly OT: Mame compiler questions

Posted: Fri May 22, 2009 5:47 pm
by sheath
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?

Posted: Fri May 22, 2009 8:08 pm
by Chilly Willy
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.

Posted: Fri May 22, 2009 8:30 pm
by AamirM
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.

Posted: Fri May 22, 2009 9:38 pm
by Chilly Willy
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.

Posted: Sat May 23, 2009 12:18 am
by sheath
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.