[xiph-commits] r3872 - in liboggplay/trunk: . src/liboggplay

wiking at svn.annodex.net wiking at svn.annodex.net
Tue Mar 3 06:22:49 PST 2009


Author: wiking
Date: 2009-03-03 06:22:48 -0800 (Tue, 03 Mar 2009)
New Revision: 3872

Modified:
   liboggplay/trunk/configure.ac
   liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb_x86.c
   liboggplay/trunk/src/liboggplay/yuv2rgb_x86.h
   liboggplay/trunk/src/liboggplay/yuv2rgb_x86_vs.h
Log:
- fix attribute alignment in case of MSVC
- detect maximum attribute alignment with configure script


Modified: liboggplay/trunk/configure.ac
===================================================================
--- liboggplay/trunk/configure.ac	2009-03-03 11:18:00 UTC (rev 3871)
+++ liboggplay/trunk/configure.ac	2009-03-03 14:22:48 UTC (rev 3872)
@@ -304,6 +304,26 @@
 fi
 dnl changequote([,])dnl
 
+dnl Checks for __attribute__(aligned()) directive
+AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
+    [ac_cv_c_attribute_aligned],
+    [ac_cv_c_attribute_aligned=0
+     CFLAGS_save="${CFLAGS}"
+     CFLAGS="${CFLAGS} -Werror"
+     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
+       AC_TRY_COMPILE([],
+                      [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
+                      [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
+     done
+       CFLAGS="${CFLAGS_save}"])
+if test "${ac_cv_c_attribute_aligned}" != "0"; then
+  AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
+                     [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
+fi
+
+
+
+
 dnl
 dnl  Configuration tests complete -- provide summary of results.
 dnl

Modified: liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb_x86.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb_x86.c	2009-03-03 11:18:00 UTC (rev 3871)
+++ liboggplay/trunk/src/liboggplay/oggplay_yuv2rgb_x86.c	2009-03-03 14:22:48 UTC (rev 3872)
@@ -40,15 +40,9 @@
 #include "yuv2rgb_x86.h" 
 #endif
 
-#ifdef ATTRIBUTE_ALIGNED_MAX
-#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
-#else
-#define ATTR_ALIGN(align)
-#endif
-
 typedef union
 {
-	long long 		q[2];
+	long long               q[2];
 	unsigned long long	uq[2]; 	
 	int                     d[4]; 
 	unsigned int            ud[4];
@@ -57,9 +51,6 @@
 	char                    b[16];
 	unsigned char           ub[16];
 	float                   s[4];
-#if defined(__GNUC__)
-	long long __attribute__ ((__vector_size__ (16), __may_alias__)) int128;
-#endif
 } ATTR_ALIGN(16) simd_t;
 
 #define UV_128 0x0080008000800080LL 

Modified: liboggplay/trunk/src/liboggplay/yuv2rgb_x86.h
===================================================================
--- liboggplay/trunk/src/liboggplay/yuv2rgb_x86.h	2009-03-03 11:18:00 UTC (rev 3871)
+++ liboggplay/trunk/src/liboggplay/yuv2rgb_x86.h	2009-03-03 14:22:48 UTC (rev 3872)
@@ -8,7 +8,13 @@
 #define RIP
 # endif
 
-#define emms() __asm__ __volatile ( "emms;" );
+# ifdef ATTRIBUTE_ALIGNED_MAX
+#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
+# else
+#define ATTR_ALIGN(align)
+# endif
+
+#define emms() __asm__ __volatile__ ( "emms;" );
 #define MMX_MOVNTQ "movntq"
 #define SSE2_MOVNTQ "movdqu"
 

Modified: liboggplay/trunk/src/liboggplay/yuv2rgb_x86_vs.h
===================================================================
--- liboggplay/trunk/src/liboggplay/yuv2rgb_x86_vs.h	2009-03-03 11:18:00 UTC (rev 3871)
+++ liboggplay/trunk/src/liboggplay/yuv2rgb_x86_vs.h	2009-03-03 14:22:48 UTC (rev 3872)
@@ -1,6 +1,8 @@
 #ifndef __OGGPLAY_YUV2RGB_VS_H__
 #define __OGGPLAY_YUV2RGB_VS_H__
 
+#define ATTR_ALIGN(_align) __declspec(align(_align))
+
 #define emms() __asm emms
 #define MMX_MOVNTQ movntq
 #define SSE2_MOVNTQ movdqu



More information about the commits mailing list