vlc_cpu.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_cpu.h: CPU capabilities
00003  *****************************************************************************
00004  * Copyright (C) 1998-2009 the VideoLAN team
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00019  *****************************************************************************/
00020 
00021 /**
00022  * \file
00023  * This file provides CPU-specific optimization flags.
00024  */
00025 
00026 #ifndef VLC_CPU_H
00027 # define VLC_CPU_H 1
00028 
00029 # if defined (__i386__) || defined (__x86_64__)
00030 #  define CPU_CAPABILITY_MMX     (1<<3)
00031 #  define CPU_CAPABILITY_3DNOW   (1<<4)
00032 #  define CPU_CAPABILITY_MMXEXT  (1<<5)
00033 #  define CPU_CAPABILITY_SSE     (1<<6)
00034 #  define CPU_CAPABILITY_SSE2    (1<<7)
00035 #  define CPU_CAPABILITY_SSE3    (1<<8)
00036 #  define CPU_CAPABILITY_SSSE3   (1<<9)
00037 #  define CPU_CAPABILITY_SSE4_1  (1<<10)
00038 #  define CPU_CAPABILITY_SSE4_2  (1<<11)
00039 #  define CPU_CAPABILITY_SSE4A   (1<<12)
00040 # else
00041 #  define CPU_CAPABILITY_MMX     (0)
00042 #  define CPU_CAPABILITY_3DNOW   (0)
00043 #  define CPU_CAPABILITY_MMXEXT  (0)
00044 #  define CPU_CAPABILITY_SSE     (0)
00045 #  define CPU_CAPABILITY_SSE2    (0)
00046 #  define CPU_CAPABILITY_SSE3    (0)
00047 #  define CPU_CAPABILITY_SSSE3   (0)
00048 #  define CPU_CAPABILITY_SSE4_1  (0)
00049 #  define CPU_CAPABILITY_SSE4_2  (0)
00050 #  define CPU_CAPABILITY_SSE4A   (0)
00051 # endif
00052 
00053 # if defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
00054 #  define CPU_CAPABILITY_ALTIVEC (1<<16)
00055 # else
00056 #  define CPU_CAPABILITY_ALTIVEC (0)
00057 # endif
00058 
00059 # if defined (__arm__)
00060 #  define CPU_CAPABILITY_NEON    (1<<24)
00061 # else
00062 #  define CPU_CAPABILITY_NEON    (0)
00063 # endif
00064 
00065 VLC_EXPORT( unsigned, vlc_CPU, ( void ) );
00066 VLC_EXPORT( unsigned, vlc_GetCPUCount, ( void ) );
00067 
00068 /** Are floating point operations fast?
00069  * If this bit is not set, you should try to use fixed-point instead.
00070  */
00071 # if defined (__i386__) || defined (__x86_64__)
00072 #  define HAVE_FPU 1
00073 
00074 # elif defined (__powerpc__) || defined (__ppc__) || defined (__pc64__)
00075 #  define HAVE_FPU 1
00076 
00077 # elif defined (__arm__)
00078 #  define HAVE_FPU 0 /* revisit later? */
00079 
00080 # elif defined (__sparc__)
00081 #  define HAVE_FPU 1
00082 
00083 # else
00084 #  define HAVE_FPU 0
00085 
00086 # endif
00087 
00088 typedef void *(*vlc_memcpy_t) (void *tgt, const void *src, size_t n);
00089 typedef void *(*vlc_memset_t) (void *tgt, int c, size_t n);
00090 
00091 VLC_EXPORT( void, vlc_fastmem_register, (vlc_memcpy_t cpy, vlc_memset_t set) );
00092 
00093 #endif /* !VLC_CPU_H */
00094 

Generated on Mon Nov 22 07:55:19 2010 for VLC by  doxygen 1.5.6