[vlc-devel] [PATCH 1/3] Define VLC_MMX and VLC_SSE function attribute macros

Rémi Denis-Courmont remi at remlab.net
Sat Nov 19 11:22:35 CET 2011


---
 include/vlc_cpu.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/vlc_cpu.h b/include/vlc_cpu.h
index 932dc68..848e8e6 100644
--- a/include/vlc_cpu.h
+++ b/include/vlc_cpu.h
@@ -37,6 +37,23 @@
 #  define CPU_CAPABILITY_SSE4_1  (1<<10)
 #  define CPU_CAPABILITY_SSE4_2  (1<<11)
 #  define CPU_CAPABILITY_SSE4A   (1<<12)
+
+# if defined (__MMX__)
+#  define VLC_MMX
+# elif VLC_GCC_VERSION(4, 4)
+#  define VLC_MMX __attribute__ ((__target__ ("mmx")))
+# else
+#  error VLC_MMX not implemented on your compiler!
+# endif
+
+# if defined (__SSE__)
+#  define VLC_SSE
+# elif VLC_GCC_VERSION(4, 4)
+#  define VLC_SSE __attribute__ ((__target__ ("sse")))
+# else
+#  error VLC_SSE not implemented on your compiler!
+# endif
+
 # else
 #  define CPU_CAPABILITY_MMX     (0)
 #  define CPU_CAPABILITY_3DNOW   (0)
-- 
1.7.7.3




More information about the vlc-devel mailing list