[Liboil] [PATCH] SSE2 intrinsics check is broken

Will Dyson will.dyson at gmail.com
Wed Apr 26 16:27:48 PDT 2006


Hi,

I was playing with the liboil-using branch of libtheora, on my amd64
debian workstation (debian unstable, which has liboil 0.3.8). In the
process, I noticed that liboil was failing to compile the sse/
directory (because I was not seeing the speedup I was expecting).

It turns out that the check for HAVE_SSE2_INTRINSICS is broken. The
configure test program for this has an error that will always cause a
compile failure. It is trying to pass a __m128d variable to an
intrinsic that expects a variable of type __m128i (shift right is not
a sensible thing to do to a floating point type).

Simple patch follows (attatched as well, due to the gmail patch
mangle-o-matic). I plan to submit this to the Debian BTS as well.

diff -Nru liboil-0.3.8/m4/as-intrinsics.m4 liboil-0.3.8.mod/m4/as-intrinsics.m4
--- liboil-0.3.8/m4/as-intrinsics.m4	2006-02-15 16:02:15.000000000 -0500
+++ liboil-0.3.8.mod/m4/as-intrinsics.m4	2006-04-26 18:36:27.000000000 -0400
@@ -69,7 +69,7 @@

   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -msse2"
-  AC_TRY_COMPILE([#include <emmintrin.h>], [__m128d a; a =
_mm_setzero_pd(); a = _mm_srli_epi16(a,8)], [flag_ok=yes],
[flag_ok=no])
+  AC_TRY_COMPILE([#include <emmintrin.h>], [__m128i a; a =
_mm_setzero_si128(); a = _mm_srli_epi16(a,8)], [flag_ok=yes],
[flag_ok=no])
   CFLAGS="$save_CFLAGS"

   $1="-msse2"


--
Will Dyson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: liboil_sse_test.patch
Type: text/x-patch
Size: 616 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/liboil/attachments/20060426/60907050/liboil_sse_test.bin


More information about the Liboil mailing list