[AD] Pentium Pro optimizations under *nix |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
In Windows and DOS, it is possible to optimize for pentium pro by setting
TARGET_ARCH_COMPAT=i686. It is also possible to generate code specific for
a certain processor by specifying TARGET_ARCH_EXCL.
The Unix port only has the --enable-pentiumopts switch to configure, which
amounds to TARGET_ARCH_COMPAT=i585.
The attached patch adds a --enable-i686opts to the configure script
(default value: no) and a --enable-exclopts flag (default value again no)
that can be used to generate specific code for either the pentium, or the
pentium pro. If both --enable-pentiumopts and ---enable-i686opts are
specified, it goes with the lowest system, that is, the pentium.
Tested under Linux (on an i686) with 4.0.2 and WIP 4.1.3
On a side note, should these confugure options be documented anywhere?
--- configure.in.old Tue Oct 1 20:22:45 2002
+++ configure.in Tue Oct 1 20:37:16 2002
@@ -77,6 +77,16 @@
[ --enable-pentiumopts[=x] enable Pentium optimizations [default=no]],
test "X$enableval" != "Xno" && allegro_pentium_optimizations=yes)
+dnl Enable Pentium Pro optimizations.
+AC_ARG_ENABLE(i686opts,
+[ --enable-i686opts[=x] enable Pentium Pro optimizations [default=no]],
+test "X$enableval" != "Xno" && allegro_pentiumpro_optimizations=yes)
+
+dnl Enable exclusive code generation.
+AC_ARG_ENABLE(exclopts,
+[ --enable-exclopts[=x] enable processor exclusive optimizations [default=no]],
+test "X$enableval" != "Xno" && allegro_exclusive_optimizations=yes)
+
dnl Sanity check on shared/static options
if test "X$allegro_static_libraries" != "Xyes"; then
if test "X$allegro_shared_libraries" != "Xyes"; then
@@ -167,11 +177,22 @@
else
WFLAGS="-Wall"
fi
- if test "X$allegro_pentium_optimizations" = "Xyes"; then
- TARGET_ARCH="-mcpu=pentium"
+ if test "X$allegro_pentiumpro_optimizations" = "Xyes"; then
+ if test "X$allegro_exclusive_optimizations" = "Xyes"; then
+ TARGET_ARCH="-march=i686"
+ else
+ TARGET_ARCH="-mcpu=i686"
+ fi
else
TARGET_ARCH=
fi
+ if test "X$allegro_pentium_optimizations" = "Xyes"; then
+ if test "X$allegro_exclusive_optimizations" = "Xyes"; then
+ TARGET_ARCH="-march=pentium"
+ else
+ TARGET_ARCH="-mcpu=pentium"
+ fi
+ fi
if test "X$allegro_cv_support_fomit_frame_pointer" = "Xyes"; then
CFLAGS="$TARGET_ARCH -O2 -funroll-loops -ffast-math -fomit-frame-pointer $WFLAGS"
else