Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

memcpy.c

00001 /*****************************************************************************
00002  * memcpy.c : classic memcpy module
00003  *****************************************************************************
00004  * Copyright (C) 2001 the VideoLAN team
00005  * $Id: memcpy.c 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Samuel Hocevar <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  * 
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 /*****************************************************************************
00025  * Preamble
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  * Extern prototype
00054  *****************************************************************************/
00055 #ifndef MODULE_NAME_IS_memcpy
00056 #   define fast_memcpy E_(fast_memcpy)
00057 #   include "fastmemcpy.h"
00058 #endif
00059 
00060 /*****************************************************************************
00061  * Module initializer
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  * Module descriptor
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 

Generated on Tue Dec 20 10:14:48 2005 for vlc-0.8.4a by  doxygen 1.4.2