This patch adds an option to enable native CPU optimizations
by adding -march=native to the compiler flags, tuning the
generated code for the build machine at the expense of portability.
In some tests, especially on wrlib I saw 8% perf improvement.
Should be used by developers or those who recompile wmaker for their own usage.
---
configure.ac | 17 +++++++++++++++++
doc/build/Compilation.texi | 4 ++++
2 files changed, 21 insertions(+)
diff --git a/
configure.ac b/
configure.acindex 86ac2a00..1d2bbe6e 100644
--- a/
configure.ac+++ b/
configure.ac@@ -130,6 +130,20 @@ AS_IF([test "x$debug" = "xyes"],
])
+dnl Native CPU Optimizations Option
+dnl =================
+m4_divert_push([INIT_PREPARE])dnl
+AC_ARG_ENABLE([native],
+ [AS_HELP_STRING([--enable-native], [enable native option, @<:@default=no@:>@])],
+ [AS_CASE(["$enableval"],
+ [yes], [native=yes],
+ [no], [native=no],
+ [AC_MSG_ERROR([bad value $enableval for --enable-native])] )],
+ [native=no])
+m4_divert_pop([INIT_PREPARE])dnl
+AS_IF([test "x$native" = "xyes"],
+ [AX_CFLAGS_GCC_OPTION([-march=native])])
+
AX_CFLAGS_GCC_OPTION([-Wall])
AX_CFLAGS_GCC_OPTION([-Wextra -Wno-sign-compare])
dnl
@@ -1037,6 +1051,9 @@ echo "Supported graphic format libraries :$supported_gfx"
echo "Unsupported features :$unsupported"
echo "Pango text layout support in WINGs : $pango"
echo "Translated languages to support :$supported_locales"
+AS_IF([test "x$native" = "xyes"],
+ [AS_ECHO(["Target architecture : native"]) ],
+ [AS_ECHO(["Target architecture : generic"]) ])
AS_IF([test "x$WEB_REPO_ROOT" != "x"],
[AS_ECHO(["Git repository for WMaker's Website : $WEB_REPO_ROOT"]) ])
AS_IF([test "x$debug" = "xyes"],
diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi
index 0046384a..bd4fc66d 100644
--- a/doc/build/Compilation.texi
+++ b/doc/build/Compilation.texi
@@ -651,6 +651,10 @@ appropriate requirements and works with this.
Despite all this, if you think there's a use for it and feel in the mood to help, do not hesitate to
discuss on the mailing list @value{emailsupport} to get it working.
+@item --enable-native
+Enable native CPU optimizations by adding @option{-march=native} to the compiler flags, tuning the
+generated code for the build machine at the expense of portability.
+
@item --with-web-repo=@i{PATH}
Enable generation of HTML documentation to be uploaded to @sc{Window Maker}'s website.
The @file{@i{PATH}} is the directory where you have cloned the homepage's repository.
--
2.43.0