[vlc-devel] commit: vlc_cpu.h: dedicated header for CPU features ( Rémi Denis-Courmont )
git version control
git at videolan.org
Tue Sep 22 17:22:50 CEST 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Sep 22 18:20:20 2009 +0300| [1f133a02a44f8fdfe8d736902bc6105544bc01a3] | committer: Rémi Denis-Courmont
vlc_cpu.h: dedicated header for CPU features
Also segregate flags per architecture from now on.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f133a02a44f8fdfe8d736902bc6105544bc01a3
---
include/vlc_cpu.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/Makefile.am | 1 +
2 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/include/vlc_cpu.h b/include/vlc_cpu.h
new file mode 100644
index 0000000..8afe436
--- /dev/null
+++ b/include/vlc_cpu.h
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ * vlc_cpu.h: CPU capabilities
+ *****************************************************************************
+ * Copyright (C) 1998-2009 the VideoLAN team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/**
+ * \file
+ * This file provides CPU-specific optimization flags.
+ */
+
+#ifndef VLC_CPU_H
+# define VLC_CPU_H 1
+
+# if defined (__i386__) || defined (__x86_64__)
+# define CPU_CAPABILITY_MMX (1<<3)
+# define CPU_CAPABILITY_3DNOW (1<<4)
+# define CPU_CAPABILITY_MMXEXT (1<<5)
+# define CPU_CAPABILITY_SSE (1<<6)
+# define CPU_CAPABILITY_SSE2 (1<<7)
+# define CPU_CAPABILITY_SSE3 (1<<8)
+# define CPU_CAPABILITY_SSSE3 (1<<9)
+# define CPU_CAPABILITY_SSE4 (1<<10)
+
+# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
+# define CPU_CAPABILITY_ALTIVEC (1<<16)
+
+# elif defined (__arm__)
+# define CPU_CAPABILITY_NEON (1<<24)
+
+# endif
+
+/** Are floating point oeprations fast?
+ * If this bit is not set, you should try to use fixed-point instead.
+ */
+# define CPU_CAPABILITY_FPU (1<<31)
+
+VLC_EXPORT( unsigned, vlc_CPU, ( void ) );
+
+typedef void *(*vlc_memcpy_t) (void *tgt, const void *src, size_t n);
+typedef void *(*vlc_memset_t) (void *tgt, int c, size_t n);
+
+VLC_EXPORT( void, vlc_fastmem_register, (vlc_memcpy_t cpy, vlc_memset_t set) );
+
+#endif /* !VLC_CPU_H */
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 64af998..8c6c091 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -59,6 +59,7 @@ pluginsinclude_HEADERS = \
../include/vlc_config.h \
../include/vlc_config_cat.h \
../include/vlc_configuration.h \
+ ../include/vlc_cpu.h \
../include/vlc_dialog.h \
../include/vlc_demux.h \
../include/vlc_epg.h \
More information about the vlc-devel
mailing list