Quote:Reminder: MAMEdev strongly recommends using no ARCHOPTS for Intel Core-series processors (and especially 64-bit builds). They are so good that you do not need to optimize especially for them. The stock OPTIMIZE=3 is fine.

-R. Belmont

EDIT by Mr. Do November 9, 2010:

I'll leave this thread here, for posterity, but here are a couple notes regarding ARCHOPTS and current MAME builds (>2010). (Also note, I've removed the ARCHOPTS section from the compiling how-to page):

Quote:[Aaron Giles]

Remember, ARCHOPTS is not officially supported. No official testing is done with them, and they can be tweaked until the compiler does bad things. Looks like the new tools don't generate good code with some of them.

If you leave it blank, your builds are still optimized. Further, they are optimized in the same way the devs builds are, and thus guaranteed not to fall over.

Quote:[Aaron Giles]

Stop messing with the ARCHOPTS. It is silly on 64-bit. 64-bit only started showing up with the Core line of chips anyways, so it is by default already optimized for them.

Quote:[R.Belmont]

FACT: Messing with optimizer flags does not make a single game playable on systems where it wasn't before.FACT: Messing with optimizer flags is PROVEN to cause bugs (including gameplay logic errors) in games that don't have them on a normal MAME compile.

Quote:[Biafra Republic]

The way things are with the current toolchain, here's my not-so-definitive list of flags for ARCHOPTS, organized by newer CPU:

As of MAME 0.121u2, architecture flags for each CPU are no longer included in the stock makefile. You can specify them in an environment variable or command-line option to make called ARCHOPTS. Here are some useful options for a variety of IBM, Motorola and Intel CPUs. If you can think of any other options that would be useful to publish, post them in a reply to this thread.

There are two classes of options: "Maximum Tune" and "Just the Features".

"Maximum Tune" will tell the compiler about the features of the CPU, and also cause it to try to schedule instructions in such a way that the CPU pipelines are kept full. The CPUs that benefit most from this are the Intel Pentium 4, Motorola G4 7450 and IBM Cell (I know, there's no "Maximum Tune" option for this CPU yet). However, using "Maximum Tune" optimisation for x86 and x64 chips tends to bring out the bugs in GCC, so it isn't recommended for newer Intel CPUs. (Using "Maximum Tune" for PowerPC CPUs doesn't bring out the bugs - IBM and Apple have done a lot of work in this area.)

"Just the Features" will tell the compiler about optional features the CPU may have (additional FPU capabilities, vector unit, 64-bit, etc.) but won't tell it to perform scheduling optimisation. This may not be quite as fast, but it tends to be more reliable. These options are recommended for confirming bugs.