Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Dne 3.8.2011 17:43, Norbert Thiebaud napsal(a):

I haven't read the patch, but you should use HAVE_GCC_AVX to stay
similar to existing check like that.

Ok, that is easy, I renamed the variable :)

Tom
From 6ac456072b160f2786840b878c136408bac2559a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tomas.chvatal@gmail.com>
Date: Wed, 3 Aug 2011 13:52:13 +0200
Subject: [PATCH] Add check for avx support.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Tomáš Chvátal <tomas.chvatal@gmail.com>
---
 configure.in |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index cf308dc..3317d42 100755
--- a/configure.in
+++ b/configure.in
@@ -1885,6 +1885,37 @@ fi
 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
 
 dnl ===================================================================
+dnl Check for AVX
+dnl ===================================================================
+AS_IF([test "x$AVX_CFLAGS" = "x"], [
+  AS_IF([test "x$SUNCC" = "xyes" && test "x$AMD64_ABI" = "xno"], [
+       AVX_CFLAGS="-xarch=avx"
+  ])
+], [
+  AVX_CFLAGS="-mavx -Winline"
+])
+
+have_avx_intrinsics=no
+AC_MSG_CHECKING(whether to use AVX intrinsics)
+avx_save_CFLAGS=$CFLAGS
+CFLAGS="$AVX_CFLAGS $CFLAGS"
+AC_COMPILE_IFELSE([
+#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))
+#   if !defined(__amd64__) && !defined(__x86_64__)
+#      error "Need GCC >= 4.5 for AVX intrinsics on x86"
+#   endif
+#endif
+#include <immintrin.h>
+int main () {
+    __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
+        c = _mm256_permute2f128_si256 (a, b, 0);
+    return 0;
+}], have_avx_intrinsics=yes)
+CFLAGS=$avx_save_CFLAGS
+AC_MSG_RESULT([$have_avx_intrinsics])
+AM_CONDITIONAL(HAVE_GCC_AVX, [test "x$have_avx_intrinsics" = "xyes"])
+
+dnl ===================================================================
 dnl Set up a different compiler to produce tools to run on the build
 dnl machine when doing cross-compilation
 dnl ===================================================================
-- 
1.7.3.4

From 735f0f2d175fcfd656468fef25596753bea9c926 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tomas.chvatal@gmail.com>
Date: Mon, 1 Aug 2011 17:41:29 +0200
Subject: [PATCH] Fix segmentation fault when linking -mavx on new CPUs is enabled by explicitly 
adding -mno-avx to CXXFLAGS.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Tomáš Chvátal <tomas.chvatal@gmail.com>
---
 .../source/cpp_uno/gcc3_linux_intel/makefile.mk    |    6 ++++++
 .../source/cpp_uno/gcc3_linux_x86-64/makefile.mk   |    6 ++++++
 bridges/source/cpp_uno/mingw_intel/makefile.mk     |    6 ++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk 
b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk
index beedf9d..d0acc23 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk
@@ -52,6 +52,12 @@ CFLAGS += -DLEAK_STATIC_DATA
 # work with the .cxx sources in this directory:
 CFLAGSCXX += -fno-omit-frame-pointer -fno-strict-aliasing
 
+# In case the compiler supports AVX this code segfaults so specifically turn
+# it off.
+ifdef HAVE_GCC_AVX
+    CFLAGSCXX+= -mno-avx
+endif
+
 CFLAGSNOOPT=-O0
 
 SLOFILES= \
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk
index dd35432..ee934e0 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/makefile.mk
@@ -52,6 +52,12 @@ CFLAGS += -DLEAK_STATIC_DATA
 # work with the .cxx sources in this directory:
 CFLAGSCXX += -fno-omit-frame-pointer -fno-strict-aliasing
 
+# In case the compiler supports AVX this code segfaults so specifically turn
+# it off.
+ifdef HAVE_GCC_AVX
+    CFLAGSCXX+= -mno-avx
+endif
+
 SLOFILES= \
     $(SLO)$/abi.obj                    \
     $(SLO)$/except.obj         \
diff --git a/bridges/source/cpp_uno/mingw_intel/makefile.mk 
b/bridges/source/cpp_uno/mingw_intel/makefile.mk
index 2c7a8da..189cb15 100644
--- a/bridges/source/cpp_uno/mingw_intel/makefile.mk
+++ b/bridges/source/cpp_uno/mingw_intel/makefile.mk
@@ -51,6 +51,12 @@ CFLAGS += -DBROKEN_ALLOCA
 # work with the .cxx sources in this directory:
 CFLAGSCXX += -fno-omit-frame-pointer
 
+# In case the compiler supports AVX this code segfaults so specifically turn
+# it off.
+ifdef HAVE_GCC_AVX
+    CFLAGSCXX+= -mno-avx
+endif
+
 NOOPTFILES= \
     $(SLO)$/uno2cpp.obj
 
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.