]> git.sesse.net Git - vlc/blob - modules/misc/memcpy/memcpy.c
08280d1a7110e4af8e1934aaa424b13efee612ee
[vlc] / modules / misc / memcpy / memcpy.c
1 /*****************************************************************************
2  * memcpy.c : classic memcpy module
3  *****************************************************************************
4  * Copyright (C) 2001 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31
32 #include <vlc_common.h>
33 #include <vlc_plugin.h>
34 #include <vlc_cpu.h>
35
36 #undef HAVE_MMX
37 #undef HAVE_MMX2
38 #undef HAVE_SSE
39 #undef HAVE_SSE2
40 #undef HAVE_3DNOW
41 #undef HAVE_ALTIVEC
42
43 #if defined( MODULE_NAME_IS_memcpy3dn )
44 #   define PRIORITY 100
45 #   define HAVE_3DNOW
46 #elif defined( MODULE_NAME_IS_memcpymmx )
47 #   define PRIORITY 100
48 #   define HAVE_MMX
49 #elif defined( MODULE_NAME_IS_memcpymmxext )
50 #   define PRIORITY 200
51 #   define HAVE_MMX2
52 #endif
53
54 /*****************************************************************************
55  * Extern prototype
56  *****************************************************************************/
57 #define fast_memcpy fast_memcpy
58 #include "fastmemcpy.h"
59
60 /*****************************************************************************
61  * Module initializer
62  *****************************************************************************/
63 static int Activate ( vlc_object_t *p_this )
64 {
65     VLC_UNUSED(p_this);
66     vlc_fastmem_register( fast_memcpy, NULL );
67
68     return VLC_SUCCESS;
69 }
70
71 /*****************************************************************************
72  * Module descriptor
73  *****************************************************************************/
74 vlc_module_begin ()
75     set_category( CAT_ADVANCED )
76     set_subcategory( SUBCAT_ADVANCED_MISC )
77 #if defined( MODULE_NAME_IS_memcpy3dn )
78     set_description( N_("3D Now! memcpy") )
79     add_requirement( 3DNOW )
80     add_shortcut( "3dn" )
81     add_shortcut( "3dnow" )
82     add_shortcut( "memcpy3dn" )
83     add_shortcut( "memcpy3dnow" )
84 #elif defined( MODULE_NAME_IS_memcpymmx )
85     set_description( N_("MMX memcpy") )
86     add_requirement( MMX )
87     add_shortcut( "mmx" )
88     add_shortcut( "memcpymmx" )
89 #elif defined( MODULE_NAME_IS_memcpymmxext )
90     set_description( N_("MMX EXT memcpy") )
91     add_requirement( MMXEXT )
92     add_shortcut( "mmxext" )
93     add_shortcut( "memcpymmxext" )
94 #endif
95     set_capability( "memcpy", PRIORITY )
96     set_callbacks( Activate, NULL )
97 vlc_module_end ()
98