Emulation

xmame 0.106 (need some help with MIPSpro) - Page 1

Hi all,

I was able to compile xmame v0.106 with gcc, I attached it if anyone whats to give it a spin, I also included the makefile I used. It's pretty slow! I have a comparison picture of a fast xmame.36 I compiled a few years ago (that I spent a lot of time cutting stuff out in the source like audio and some other stuff - I attached it also if someone wants to give it a spin as well ) running pacman side by side.

I'm trying to compile v0.106 using MIPSpro, but I'm running into an error:

Code: Select all

Compiling src/cpu/m68000/m68kmake.c...
ld32: ERROR   146: Expecting relocatable objects: xmame.obj/cpu/m68000/m68kmake.o is IPA intermediate object; You must specify -IPA on link line.


I have -IPA in both the $CFLAGS and $LD, so there appears to be a link line somewhere and I just can't seem to find it - if someone might have an idea I would be grateful. If anyone wants to play with this the xmame .106 source can be found at http://web.archive.org/web/20090308015400/http://x.mame.net/download.html
gijoe77 wrote: I was able to compile xmame v0.106 with gcc
Nice, thank you.

Code: Select all

Compiling src/cpu/m68000/m68kmake.c...
ld32: ERROR   146: Expecting relocatable objects: xmame.obj/cpu/m68000/m68kmake.o is IPA intermediate object; You must specify -IPA on link line.
You get this type of error if you use -Ofast for optimization. In this case optimization takes place at linking stage and you need -IPA as a linker option. Often things are put together using libtool and I never figured out how you can use -IPA with libtool, also I never was able to link a shared library using -IPA. I would check for -Ofast in the make and config files and change it in -O3 .
:Tezro: :Fuel: :Octane2: :Octane: :Onyx2: :O2+: :O2: :Indy: :Indigo: :Cube:
Thank you diegel,

I changed -Ofast to -O3 and it worked! At least it got rid of the IPA complaints - I ran into a strange error I have no idea what to make of - can you shed any light on this?

Code: Select all

Compiling src/vidhrdw/scotrsht.c ...
Compiling src/drivers/scramble.c ...
<snip warnings>
### Assertion failure at line 1387 of ../../be/lno/lwn_util.cxx:
### Compiler Error in file src/machine/scramble.c during Loop Nest Optimizer phase:
### strange parent OPC_U4CVTL: 10064e60 != 1004a238
cc INTERNAL ERROR:  /usr/lib32/cmplrs/be returned non-zero status 1
gmake: *** [xmame.obj/machine/scramble.o] Error 1
bash-4.3#
turn on verbose make so that you can actually see the compilation line. then try the file in question with lower optimization or a different frontend as described there viewtopic.php?p=7373083#p7373083
r-a-c.de
looking over the MIPSpro books (I'm slowly trying to un-newb myself) it looks like maybe tuning the LNO options might be something I will double back on since that seems to be the failure here.

For now I'm just trying to get this to compile and so I changed -O3 to -O2 and it got passed the issue, but there was an error while linking xmame.obj (something about -lexpat), I had to go to work though so I will trying to figure out what the error means when I get back home.
gijoe77 wrote: there was an error while linking xmame.obj (something about -lexpat)

then you either have no expat or the linker can't find it
r-a-c.de
I had to add

Code: Select all

INCLUDES = -I/usr/nekoware/include


to the makefile because the compilier was bombing on not finding expat.h at some point, which seemed to fix the issue up until the final linking. I did verify expat was installed when I first ran into the expat.h issue. so now the trick for me will be how to make the linker find it :)
gijoe77 wrote: I had to add

Code: Select all

INCLUDES = -I/usr/nekoware/include


to the makefile because the compilier was bombing on not finding expat.h at some point, which seemed to fix the issue up until the final linking. I did verify expat was installed when I first ran into the expat.h issue. so now the trick for me will be how to make the linker find it :)

since you seem to use the nekoware expat add -L/usr/nekoware/lib to the LDFLAGS.

btw that's general stuff not related to a specific compiler. you said you compiled it with gcc so the same would have applied there, too
r-a-c.de
ok thanks, I missed that detail (working with two makefiles, I think they are both blurring together in my head).

That worked, although I'm surprised the gcc build runs a few frames faster then the MIPspro build! both were basically built with -O2 and that's about it with the fancy stuff. I'll be playing with the MIPSpro options and seeing if I can give it any speed boosts
gijoe77 wrote: I'm surprised the gcc build runs a few frames faster then the MIPspro build! both were basically built with -O2

basically? that doesn't help :P
have a look at a full compile line of each and compare all options. also keep in mind that the vast majority of all freeware is made for gcc hence the makefiles as well as the source code often contain additional "tunings" if gcc is detected. only after finding such stuff and making the appropriate changes a fair comparison can be done.
either way the main goal here is to use -O3, no matter which compiler
r-a-c.de
so whats the main difference between -O3 and -Ofast ? is -Ofast > -O3?

How exactly does -OPT:Olimit=0 come into play? Can that be used with either -O3 and/or -Ofast?
gijoe77 wrote: so whats the main difference between -O3 and -Ofast ? is -Ofast > -O3?

How exactly does -OPT:Olimit=0 come into play? Can that be used with either -O3 and/or -Ofast?

Code: Select all

man cc

;)
r-a-c.de
man cc


I knew that was coming ;) I was trying to lob as many questions as I could before the dreaded RTM came into play ^_^
These are my preferred mipspro optimization options:

Code: Select all

-O3 -mips4 -TARG:platform=IP35:proc=r16000 -OPT:Olimit=0:roundoff=3:alias=TYPED -INLINE
:Tezro: :Fuel: :Octane2: :Octane: :Onyx2: :O2+: :O2: :Indy: :Indigo: :Cube:
I compiled a frontend (gxmame version 0.34b) if anyone wants to give it a spin, works good for me for older version of xmame (v .58). not so much for my current .106 but its a work in progress...
diegel wrote: These are my preferred mipspro optimization options:

Code: Select all

-O3 -mips4 -TARG:platform=IP35:proc=r16000 -OPT:Olimit=0:roundoff=3:alias=TYPED -INLINE



sweet! thanks mate, gonna plug these in and see where i land!
gijoe77 wrote:
diegel wrote: These are my preferred mipspro optimization options:

Code: Select all

-O3 -mips4 -TARG:platform=IP35:proc=r16000 -OPT:Olimit=0:roundoff=3:alias=TYPED -INLINE



sweet! thanks mate, gonna plug these in and see where i land!

don't unless you know what each of them does. you might want something else or have a different machine or a different compiler version etc.
r-a-c.de
foetz wrote: don't unless you know what each of them does. you might want something else or have a different machine or a different compiler version etc.


best part of learning is falling down :)

eh.. this part here:

-

Code: Select all

OPT:Olimit=0:roundoff=3:alias=TYPED


kinda lost me to be honest
gijoe77 wrote: eh.. this part here:

Code: Select all

OPT:Olimit=0:roundoff=3:alias=TYPED


kinda lost me to be honest

seems you've not yet checked the manpage. there you'd find nice stuff like:
Olimit=n
Specifies that any routine bigger than n should not be
optimized. If -O2 or greater is in effect and a routine is so
big that the compile speed may be slow, the compiler generates
a message indicating the Olimit value that is needed to
optimize. You can recompile with that value of n. The
-OPT:Olimit=0 option is not recommended for general use.


not gonna paste the roundoff and alias parts :P
r-a-c.de
gijoe77 wrote:
foetz wrote: don't unless you know what each of them does. you might want something else or have a different machine or a different compiler version etc.
best part of learning is falling down :)
Since we are talking about mame this should be no problem.

Code: Select all

OPT:Olimit=0:roundoff=3:alias=TYPED
kinda lost me to be honest
man opt and man inline will explain the options.
:Tezro: :Fuel: :Octane2: :Octane: :Onyx2: :O2+: :O2: :Indy: :Indigo: :Cube: