00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <stdlib.h>
00028 #include <string.h>
00029
00030 #include <vlc/vlc.h>
00031
00032 #undef HAVE_MMX
00033 #undef HAVE_MMX2
00034 #undef HAVE_SSE
00035 #undef HAVE_SSE2
00036 #undef HAVE_3DNOW
00037 #undef HAVE_ALTIVEC
00038
00039 #if defined( MODULE_NAME_IS_memcpy3dn )
00040 # define PRIORITY 100
00041 # define HAVE_3DNOW
00042 #elif defined( MODULE_NAME_IS_memcpymmx )
00043 # define PRIORITY 100
00044 # define HAVE_MMX
00045 #elif defined( MODULE_NAME_IS_memcpymmxext )
00046 # define PRIORITY 200
00047 # define HAVE_MMX2
00048 #else
00049 # define PRIORITY 50
00050 #endif
00051
00052
00053
00054
00055 #ifndef MODULE_NAME_IS_memcpy
00056 # define fast_memcpy E_(fast_memcpy)
00057 # include "fastmemcpy.h"
00058 #endif
00059
00060
00061
00062
00063 static int Activate ( vlc_object_t *p_this )
00064 {
00065 #ifdef MODULE_NAME_IS_memcpy
00066 p_this->p_vlc->pf_memcpy = memcpy;
00067 p_this->p_vlc->pf_memset = memset;
00068 #else
00069 p_this->p_vlc->pf_memcpy = fast_memcpy;
00070 p_this->p_vlc->pf_memset = NULL;
00071 #endif
00072
00073 return VLC_SUCCESS;
00074 }
00075
00076
00077
00078
00079 vlc_module_begin();
00080 set_category( CAT_ADVANCED );
00081 set_subcategory( SUBCAT_ADVANCED_MISC );
00082 #ifdef MODULE_NAME_IS_memcpy
00083 set_description( _("libc memcpy") );
00084 add_shortcut( "c" );
00085 add_shortcut( "libc" );
00086 #elif defined( MODULE_NAME_IS_memcpy3dn )
00087 set_description( _("3D Now! memcpy") );
00088 add_requirement( 3DNOW );
00089 add_shortcut( "3dn" );
00090 add_shortcut( "3dnow" );
00091 add_shortcut( "memcpy3dn" );
00092 add_shortcut( "memcpy3dnow" );
00093 #elif defined( MODULE_NAME_IS_memcpymmx )
00094 set_description( _("MMX memcpy") );
00095 add_requirement( MMX );
00096 add_shortcut( "mmx" );
00097 add_shortcut( "memcpymmx" );
00098 #elif defined( MODULE_NAME_IS_memcpymmxext )
00099 set_description( _("MMX EXT memcpy") );
00100 add_requirement( MMXEXT );
00101 add_shortcut( "mmxext" );
00102 add_shortcut( "memcpymmxext" );
00103 #endif
00104 set_capability( "memcpy", PRIORITY );
00105 set_callbacks( Activate, NULL );
00106 vlc_module_end();
00107