root/modules/misc/memcpy/memcpy.c
| Revision 3561b9b28f58eb7a4183e158a8fd973800d31ceb, 3.4 kB (checked in by Rémi Denis-Courmont <rdenis@simphalempin.com>, 6 months ago) | |
|---|---|
| |
| Line | |
|---|---|
| 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 | |
| 35 | #undef HAVE_MMX |
| 36 | #undef HAVE_MMX2 |
| 37 | #undef HAVE_SSE |
| 38 | #undef HAVE_SSE2 |
| 39 | #undef HAVE_3DNOW |
| 40 | #undef HAVE_ALTIVEC |
| 41 | |
| 42 | #if defined( MODULE_NAME_IS_memcpy3dn ) |
| 43 | # define PRIORITY 100 |
| 44 | # define HAVE_3DNOW |
| 45 | #elif defined( MODULE_NAME_IS_memcpymmx ) |
| 46 | # define PRIORITY 100 |
| 47 | # define HAVE_MMX |
| 48 | #elif defined( MODULE_NAME_IS_memcpymmxext ) |
| 49 | # define PRIORITY 200 |
| 50 | # define HAVE_MMX2 |
| 51 | #else |
| 52 | # define PRIORITY 50 |
| 53 | #endif |
| 54 | |
| 55 | /***************************************************************************** |
| 56 | * Extern prototype |
| 57 | *****************************************************************************/ |
| 58 | #ifndef MODULE_NAME_IS_memcpy |
| 59 | # define fast_memcpy fast_memcpy |
| 60 | # include "fastmemcpy.h" |
| 61 | #endif |
| 62 | |
| 63 | /***************************************************************************** |
| 64 | * Module initializer |
| 65 | *****************************************************************************/ |
| 66 | static int Activate ( vlc_object_t *p_this ) |
| 67 | { |
| 68 | #ifndef MODULE_NAME_IS_memcpy |
| 69 | vlc_fastmem_register( fast_memcpy, NULL ); |
| 70 | #endif |
| 71 | |
| 72 | return VLC_SUCCESS; |
| 73 | } |
| 74 | |
| 75 | /***************************************************************************** |
| 76 | * Module descriptor |
| 77 | *****************************************************************************/ |
| 78 | vlc_module_begin(); |
| 79 | set_category( CAT_ADVANCED ); |
| 80 | set_subcategory( SUBCAT_ADVANCED_MISC ); |
| 81 | #ifdef MODULE_NAME_IS_memcpy |
| 82 | set_description( N_("libc memcpy") ); |
| 83 | add_shortcut( "c" ); |
| 84 | add_shortcut( "libc" ); |
| 85 | #elif defined( MODULE_NAME_IS_memcpy3dn ) |
| 86 | set_description( N_("3D Now! memcpy") ); |
| 87 | add_requirement( 3DNOW ); |
| 88 | add_shortcut( "3dn" ); |
| 89 | add_shortcut( "3dnow" ); |
| 90 | add_shortcut( "memcpy3dn" ); |
| 91 | add_shortcut( "memcpy3dnow" ); |
| 92 | #elif defined( MODULE_NAME_IS_memcpymmx ) |
| 93 | set_description( N_("MMX memcpy") ); |
| 94 | add_requirement( MMX ); |
| 95 | add_shortcut( "mmx" ); |
| 96 | add_shortcut( "memcpymmx" ); |
| 97 | #elif defined( MODULE_NAME_IS_memcpymmxext ) |
| 98 | set_description( N_("MMX EXT memcpy") ); |
| 99 | add_requirement( MMXEXT ); |
| 100 | add_shortcut( "mmxext" ); |
| 101 | add_shortcut( "memcpymmxext" ); |
| 102 | #endif |
| 103 | set_capability( "memcpy", PRIORITY ); |
| 104 | set_callbacks( Activate, NULL ); |
| 105 | vlc_module_end(); |
| 106 |
Note: See TracBrowser for help on using the browser.
