summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@gmail.com>2015-12-18 12:25:53 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-12-18 12:26:26 +0000
commitb8bac2f99b5807f24b0ed4cdaad8ad09af149ff1 (patch)
tree63ea3584c7908390f0507d8e70028815d5a0140e
parent32a7c9c9fb25e173ea7318f9e9e01d6c7bea29dc (diff)
configura.ac: fix test for SSE4.1 assembler support
This patch modifies the SSE4.1 test in configure.ac to use a global variable to initialize vector variables. In addition, we now return the value of the computation instead of 0. This is done so gcc 4.9 (and lower) won't optimize the SSE4.1 assembly instructions (when using -O1 and higher), because then the configure test might incorrectly pass even though the assembler doesn't support the SSE4.1 instructions (the test will pass because the compiler does support the intrinsics). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91806 Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 6e44bbe0f5496b1aea2b4a29adae7990b62fda33)
-rw-r--r--configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index fa37bd11b9c..98fe173c6e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -375,10 +375,11 @@ save_CFLAGS="$CFLAGS"
CFLAGS="$SSE41_CFLAGS $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <smmintrin.h>
+int param;
int main () {
- __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
+ __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
c = _mm_max_epu32(a, b);
- return 0;
+ return _mm_cvtsi128_si32(c);
}]])], SSE41_SUPPORTED=1)
CFLAGS="$save_CFLAGS"
if test "x$SSE41_SUPPORTED" = x1; then