Tweaking configure.in

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Tweaking configure.in

Post by grinvader »

Currently...

Code: Select all

if test x$debug != xyes; then
	case "$target" in
		i486-*-*)
			CFLAGS="$CFLAGS -march=i486"
			AC_MSG_RESULT(486)
			;;
		i586-*-*)
			CFLAGS="$CFLAGS -march=pentium"
			AC_MSG_RESULT(586)
			;;
		i686-*-*)
			CFLAGS="$CFLAGS -march=pentiumpro"
			dnl CFLAGS="$CFLAGS -march=pentium3 -mmmx -msse -mfpmath=sse,387"
			AC_MSG_RESULT(686)
			;;
		*)
			AC_MSG_RESULT(386)
			AC_MSG_WARN(*** This is probably not what you want use --target)
			;;
Now that I know where to modify, I'd like some pointers on how to add other cpus to help optimizations.
Of course, we can do the ./autogen.sh, then manually edit Makefile to set the CFlag to whatever we want, but might as well put it in the autogen, no ?
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Do be aware that changing the optimizations on C code is not going to do much. Sure you can get faster DSP-1, Seta 10, some C4, but that's about it.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Kagerato
Lurker
Posts: 153
Joined: Mon Aug 09, 2004 1:40 am
Contact:

Post by Kagerato »

An excellent point, Nach. With the massive amount of x86, the C optimization settings won't make much difference.

However, I believe grinvader is probably thinking of the future. In which case, adding other processor's preferred optimizations is not a bad idea.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

After some tries... I now use:

Code: Select all

CFLAGS="$CFLAGS -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse,387"
The size of the UPX-compressed exe went down by 20 kB. And I swear that the water effect A (my personnal favourite CPU eater) is 10 times faster.

Also worth of note: Yoshi's Island (U) [SuperFX] is now always over 52/60. @1024*768 OGL FULL with hq2x and bilinear filters.
Even after 'touching fuzzy, getting dizzy'.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

grinvader wrote:After some tries... I now use:

Code: Select all

CFLAGS="$CFLAGS -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse,387"
Do you realize that -march=pentium4 includes those other ones?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
ipher
ZSNES Developer
ZSNES Developer
Posts: 269
Joined: Wed Jul 28, 2004 2:37 am
Contact:

Post by ipher »

when you use -march=whatever, it usually uses all of the optimizations that the processor uses, since you're basically saying "this processor is required".
[url=http://www.ipherswipsite.com]ipher's WIP Site[/url]
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

I wasn't sure about that, so I put them explicitly.
Let me rebuild and check if the exe's the same...

Edit: not quite. pentium4 alone makes an even smaller exe, but slightly slower on some intensive parts of Yoshi's Island involving flying drug clouds.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Kagerato
Lurker
Posts: 153
Joined: Mon Aug 09, 2004 1:40 am
Contact:

Post by Kagerato »

There's been much confusion and debate about whether the march flags actually include the mmx/sse/etc optimizations (they certainly imply them; I believe that's even mentioned in the gcc manual). I'm fairly sure they are included, and that only in rare circumstances would manually specifying -msse and so on makes a positive difference.

I use "-march=pentium4 -O2" for my CFLAGS in make.conf (gentoo system). I've found that -O3 does not improve speed by any significant margin over -O2.
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Re: Tweaking configure.in

Post by jdratlif »

grinvader wrote:Currently...

Code: Select all

if test x$debug != xyes; then
	case "$target" in
		i486-*-*)
			CFLAGS="$CFLAGS -march=i486"
			AC_MSG_RESULT(486)
			;;
		i586-*-*)
			CFLAGS="$CFLAGS -march=pentium"
			AC_MSG_RESULT(586)
			;;
		i686-*-*)
			CFLAGS="$CFLAGS -march=pentiumpro"
			dnl CFLAGS="$CFLAGS -march=pentium3 -mmmx -msse -mfpmath=sse,387"
			AC_MSG_RESULT(686)
			;;
		*)
			AC_MSG_RESULT(386)
			AC_MSG_WARN(*** This is probably not what you want use --target)
			;;
Now that I know where to modify, I'd like some pointers on how to add other cpus to help optimizations.
Of course, we can do the ./autogen.sh, then manually edit Makefile to set the CFlag to whatever we want, but might as well put it in the autogen, no ?
No. autogen should be thrown away and the configure script should be distributed. Not everyone has autoconf/automake installed, and it shouldn't be required to compile. autoconf is a developer tool, not an end-user tool.

The big point of autoconf is so that you can build that platform-independent configure script that doesn't need autoconf/automake/gnu m4 or some specialized make like gmake.

The generic INSTALL doc talks about configure. You shouldn't need to generate configure to run it. It should be part and parcel of the distribution.

BTW: make install doesn't create the parent directories if you don't install to the default prefix. This should be changed...
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
Post Reply