Commit 1207a369 authored by Rafaël Carré's avatar Rafaël Carré Committed by Rémi Denis-Courmont

Remove vlc_memcpy

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 31c8cef1
......@@ -4233,8 +4233,6 @@ AC_CONFIG_FILES([
modules/visualization/Makefile
modules/visualization/visual/Makefile
modules/mmx/Makefile
modules/mmxext/Makefile
modules/3dnow/Makefile
modules/sse2/Makefile
modules/altivec/Makefile
modules/arm_neon/Makefile
......
......@@ -878,9 +878,6 @@ static inline void *vlc_memalign(size_t align, size_t size)
VLC_API void vlc_tdestroy( void *, void (*)(void *) );
/* Fast large memory copy */
VLC_API void * vlc_memcpy( void *, const void *, size_t );
/*****************************************************************************
* I18n stuff
*****************************************************************************/
......
......@@ -105,9 +105,5 @@ VLC_API unsigned vlc_CPU( void );
# endif
typedef void *(*vlc_memcpy_t) (void *tgt, const void *src, size_t n);
VLC_API void vlc_fastmem_register(vlc_memcpy_t cpy);
#endif /* !VLC_CPU_H */
libmemcpy3dn_plugin_la_SOURCES = memcpy.c ../mmx/fastmemcpy.h
libmemcpy3dn_plugin_la_CFLAGS = $(AM_CFLAGS)
libmemcpy3dn_plugin_la_LIBADD = $(AM_LIBADD)
libmemcpy3dn_plugin_la_DEPENDENCIES =
if HAVE_WIN32
libvlc_LTLIBRARIES += \
libmemcpy3dn_plugin.la \
$(NULL)
endif
/*****************************************************************************
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_cpu.h>
#define HAVE_3DNOW
#include "../mmx/fastmemcpy.h"
static int Activate( vlc_object_t *p_this )
{
if( !(vlc_CPU() & CPU_CAPABILITY_3DNOW) )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
vlc_module_begin ()
set_category( CAT_ADVANCED )
set_subcategory( SUBCAT_ADVANCED_MISC )
set_description( N_("3D Now! memcpy") )
add_shortcut( "3dn", "3dnow", "memcpy3dn", "memcpy3dnow" )
set_capability( "memcpy", 100 )
set_callbacks( Activate, NULL )
vlc_module_end ()
......@@ -25,9 +25,7 @@ EXTRA_SUBDIRS = \
mux \
stream_out \
mmx \
mmxext \
sse2 \
3dnow \
altivec \
arm_neon \
lua \
......@@ -41,15 +39,9 @@ endif
if HAVE_MMX
SUBDIRS += mmx
endif
if HAVE_MMXEXT
SUBDIRS += mmxext
endif
if HAVE_SSE2
SUBDIRS += sse2
endif
if HAVE_3DNOW
SUBDIRS += 3dnow
endif
if HAVE_ALTIVEC
SUBDIRS += altivec
endif
......
libmemcpyaltivec_plugin_la_SOURCES = memcpy.c
libmemcpyaltivec_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_memcpyaltivec)
libmemcpyaltivec_plugin_la_LIBADD = $(AM_LIBADD) $(LIBS_memcpyaltivec)
libmemcpyaltivec_plugin_la_DEPENDENCIES =
libi420_yuy2_altivec_plugin_la_SOURCES = \
../video_chroma/i420_yuy2.c \
../video_chroma/i420_yuy2.h
......@@ -11,6 +6,5 @@ libi420_yuy2_altivec_plugin_la_LIBADD = $(AM_LIBADD) $(LIBS_i420_yuy2_altivec)
libi420_yuy2_altivec_plugin_la_DEPENDENCIES =
libvlc_LTLIBRARIES += \
libmemcpyaltivec_plugin.la \
libi420_yuy2_altivec_plugin.la \
$(NULL)
/*****************************************************************************
* memcpy.c : AltiVec memcpy module
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef __BUILD_ALTIVEC_ASM__
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_cpu.h>
#ifdef HAVE_ALTIVEC_H
# include <altivec.h>
#endif
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static void * fast_memcpy ( void * to, const void * from, size_t len );
/*****************************************************************************
* Module initializer.
*****************************************************************************/
static int Activate ( vlc_object_t *p_this )
{
if( !(vlc_CPU() & CPU_CAPABILITY_ALTIVEC) )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
vlc_module_begin ()
set_description( N_("AltiVec memcpy") )
set_category( CAT_ADVANCED )
set_subcategory( SUBCAT_ADVANCED_MISC )
set_capability( "memcpy", 100 )
set_callbacks( Activate, NULL )
add_shortcut( "altivec" )
vlc_module_end ()
#else
typedef unsigned long size_t;
#endif /* __BUILD_ALTIVEC_ASM__ */
#if defined(CAN_COMPILE_C_ALTIVEC) || defined( __BUILD_ALTIVEC_ASM__ )
#define vector_s16_t vector signed short
#define vector_u16_t vector unsigned short
#define vector_s8_t vector signed char
#define vector_u8_t vector unsigned char
#define vector_s32_t vector signed int
#define vector_u32_t vector unsigned int
#define MMREG_SIZE 16
#define SMALL_MEMCPY(to, from, len) \
{ \
unsigned char * end = to + len; \
while( to < end ) \
{ \
*to++ = *from++; \
} \
}
static void * fast_memcpy( void * _to, const void * _from, size_t len )
{
void * retval = _to;
unsigned char * to = (unsigned char *)_to;
unsigned char * from = (unsigned char *)_from;
if( len > 16 )
{
/* Align destination to MMREG_SIZE -boundary */
register unsigned long int delta;
delta = ((unsigned long)to)&(MMREG_SIZE-1);
if( delta )
{
delta = MMREG_SIZE - delta;
len -= delta;
SMALL_MEMCPY(to, from, delta);
}
if( len & ~(MMREG_SIZE-1) )
{
vector_u8_t perm, ref0, ref1, tmp;
perm = vec_lvsl( 0, from );
ref0 = vec_ld( 0, from );
ref1 = vec_ld( 15, from );
from += 16;
len -= 16;
tmp = vec_perm( ref0, ref1, perm );
while( len & ~(MMREG_SIZE-1) )
{
ref0 = vec_ld( 0, from );
ref1 = vec_ld( 15, from );
from += 16;
len -= 16;
vec_st( tmp, 0, to );
tmp = vec_perm( ref0, ref1, perm );
to += 16;
}
vec_st( tmp, 0, to );
to += 16;
}
}
if( len )
{
SMALL_MEMCPY( to, from, len );
}
return retval;
}
#endif
#if !defined(CAN_COMPILE_C_ALTIVEC) && !defined(__BUILD_ALTIVEC_ASM__)
/*
* The asm code is generated with:
*
* gcc-2.95 -fvec -D__BUILD_ALTIVEC_ASM__ -O9 -fomit-frame-pointer -mregnames -S * memcpyaltivec.c
*
* sed 's/.L/._L/g' memcpyaltivec.s |
* awk '{args=""; len=split ($2, arg, ",");
* for (i=1; i<=len; i++) { a=arg[i]; if (i<len) a=a",";
* args = args sprintf ("%-6s", a) }
* printf ("\t\"\t%-16s%-24s\\n\"\n", $1, args) }' |
* unexpand -a
*/
static void * fast_memcpy( void * _to, const void * _from, size_t len )
{
asm (" \n"
" cmplwi %cr0, %r5, 16 \n"
" mr %r9, %r3 \n"
" bc 4, 1, ._L3 \n"
" andi. %r0, %r3, 15 \n"
" bc 12, 2, ._L4 \n"
" subfic %r0, %r0, 16 \n"
" add %r11, %r3, %r0 \n"
" cmplw %cr0, %r3, %r11 \n"
" subf %r5, %r0, %r5 \n"
" bc 4, 0, ._L4 \n"
" ._L7: \n"
" lbz %r0, 0(%r4) \n"
" stb %r0, 0(%r9) \n"
" addi %r9, %r9, 1 \n"
" cmplw %cr0, %r9, %r11 \n"
" addi %r4, %r4, 1 \n"
" bc 12, 0, ._L7 \n"
" ._L4: \n"
" rlwinm. %r0, %r5, 0, 0, 27 \n"
" bc 12, 2, ._L3 \n"
" addi %r5, %r5, -16 \n"
" li %r11, 15 \n"
" lvsl %v12, 0, %r4 \n"
" lvx %v1, 0, %r4 \n"
" lvx %v0, %r11, %r4 \n"
" rlwinm. %r0, %r5, 0, 0, 27 \n"
" vperm %v13, %v1, %v0, %v12 \n"
" addi %r4, %r4, 16 \n"
" bc 12, 2, ._L11 \n"
" ._L12: \n"
" addi %r5, %r5, -16 \n"
" li %r11, 15 \n"
" lvx %v1, 0, %r4 \n"
" lvx %v0, %r11, %r4 \n"
" rlwinm. %r0, %r5, 0, 0, 27 \n"
" stvx %v13, 0, %r9 \n"
" vperm %v13, %v1, %v0, %v12 \n"
" addi %r4, %r4, 16 \n"
" addi %r9, %r9, 16 \n"
" bc 4, 2, ._L12 \n"
" ._L11: \n"
" stvx %v13, 0, %r9 \n"
" addi %r9, %r9, 16 \n"
" ._L3: \n"
" cmpwi %cr0, %r5, 0 \n"
" bclr 12, 2 \n"
" add %r5, %r9, %r5 \n"
" cmplw %cr0, %r9, %r5 \n"
" bclr 4, 0 \n"
" ._L17: \n"
" lbz %r0, 0(%r4) \n"
" stb %r0, 0(%r9) \n"
" addi %r9, %r9, 1 \n"
" cmplw %cr0, %r9, %r5 \n"
" addi %r4, %r4, 1 \n"
" bc 12, 0, ._L17 \n"
);
}
#endif
......@@ -9,9 +9,6 @@ SOURCES_inhibit = inhibit.c
SOURCES_sqlite = sqlite.c
SOURCES_xml = xml/libxml.c
SOURCES_memcpy = memcpy.c
libvlc_LTLIBRARIES += libmemcpy_plugin.la
libgnutls_plugin_la_SOURCES = gnutls.c dhparams.h
libgnutls_plugin_la_CFLAGS = $(AM_CFLAGS) $(GNUTLS_CFLAGS) $(GCRYPT_CFLAGS)
libgnutls_plugin_la_LIBADD = $(AM_LIBADD) $(GNUTLS_LIBS) $(GCRYPT_LIBS)
......
/*****************************************************************************
* memcpy.c : default memcpy plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
static int OpenDummy(vlc_object_t *);
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin ()
set_shortname( N_("Dummy") )
set_description( N_("libc memcpy") )
set_capability( "memcpy", 50 )
set_callbacks( OpenDummy, NULL )
add_shortcut( "c", "libc" )
vlc_module_end ()
static int OpenDummy( vlc_object_t *obj )
{
(void) obj;
return VLC_SUCCESS;
}
libmemcpymmx_plugin_la_SOURCES = memcpy.c fastmemcpy.h
libmemcpymmx_plugin_la_CFLAGS = $(AM_CFLAGS)
libmemcpymmx_plugin_la_LIBADD = $(AM_LIBADD)
libmemcpymmx_plugin_la_DEPENDENCIES =
libi420_rgb_mmx_plugin_la_SOURCES = \
../video_chroma/i420_rgb.c \
../video_chroma/i420_rgb.h \
......@@ -31,7 +26,3 @@ libvlc_LTLIBRARIES += \
libi420_yuy2_mmx_plugin.la \
libi422_yuy2_mmx_plugin.la \
$(NULL)
if HAVE_WIN32
libvlc_LTLIBRARIES += libmemcpymmx_plugin.la
endif
This diff is collapsed.
/*****************************************************************************
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_cpu.h>
#define HAVE_MMX
#include "../mmx/fastmemcpy.h"
static int Activate( vlc_object_t *p_this )
{
if( !(vlc_CPU() & CPU_CAPABILITY_MMX) )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
vlc_module_begin ()
set_category( CAT_ADVANCED )
set_subcategory( SUBCAT_ADVANCED_MISC )
set_description( N_("MMX memcpy") )
add_shortcut( "mmx", "memcpymmx" )
set_capability( "memcpy", 100 )
set_callbacks( Activate, NULL )
vlc_module_end ()
libmemcpymmxext_plugin_la_SOURCES = memcpy.c ../mmx/fastmemcpy.h
libmemcpymmxext_plugin_la_CFLAGS = $(AM_CFLAGS)
libmemcpymmxext_plugin_la_LIBADD = $(AM_LIBADD)
libmemcpymmxext_plugin_la_DEPENDENCIES =
if HAVE_WIN32
libvlc_LTLIBRARIES += \
libmemcpymmxext_plugin.la \
$(NULL)
endif
/*****************************************************************************
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_cpu.h>
#define HAVE_MMX2
#include "../mmx/fastmemcpy.h"
static int Activate( vlc_object_t *p_this )
{
if( !(vlc_CPU() & CPU_CAPABILITY_MMXEXT) )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
vlc_module_begin ()
set_category( CAT_ADVANCED )
set_subcategory( SUBCAT_ADVANCED_MISC )
set_description( N_("MMX EXT memcpy") )
add_shortcut( "mmxext", "memcpymmxext" )
set_capability( "memcpy", 200 )
set_callbacks( Activate, NULL )
vlc_module_end ()
......@@ -184,7 +184,6 @@ lib/video.c
lib/vlm.c
# modules
modules/3dnow/memcpy.c
modules/access/alsa.c
modules/access/attachment.c
modules/access/avio.h
......@@ -281,7 +280,6 @@ modules/access/vcdx/vcdplayer.c
modules/access/vcdx/vcdplayer.h
modules/access/vdr.c
modules/access/zip/zipstream.c
modules/altivec/memcpy.c
modules/arm_neon/audio_format.c
modules/arm_neon/chroma_yuv.c
modules/audio_filter/audiobargraph_a.c
......@@ -922,7 +920,6 @@ modules/misc/inhibit/mce.c
modules/misc/inhibit/xdg.c
modules/misc/inhibit/xscreensaver.c
modules/misc/logger.c
modules/misc/memcpy.c
modules/misc/osd/osd_menu.c
modules/misc/osd/osd_menu.h
modules/misc/osd/parser.c
......@@ -940,8 +937,6 @@ modules/misc/stats/encoder.c
modules/misc/stats/stats.c
modules/misc/stats/stats.h
modules/misc/xml/libxml.c
modules/mmxext/memcpy.c
modules/mmx/memcpy.c
modules/mux/asf.c
modules/mux/avi.c
modules/mux/dummy.c
......
......@@ -5095,10 +5095,6 @@ msgstr ""
msgid "Scale factor"
msgstr ""
#: modules/3dnow/memcpy.c:49
msgid "3D Now! memcpy"
msgstr ""
#: modules/access/alsa.c:71 modules/access/oss.c:66
msgid "Capture the audio stream in stereo."
msgstr ""
......@@ -6435,7 +6431,7 @@ msgstr ""
#: modules/access/idummy.c:42 modules/access_output/dummy.c:46
#: modules/audio_output/adummy.c:40 modules/codec/ddummy.c:46
#: modules/codec/edummy.c:39 modules/control/dummy.c:48
#: modules/misc/memcpy.c:41 modules/text_renderer/tdummy.c:35
#: modules/text_renderer/tdummy.c:35
#: modules/video_output/vdummy.c:47
msgid "Dummy"
msgstr ""
......@@ -8250,10 +8246,6 @@ msgstr ""
msgid "Zip access"
msgstr ""
#: modules/altivec/memcpy.c:64
msgid "AltiVec memcpy"
msgstr ""
#: modules/arm_neon/audio_format.c:36
msgid "ARM NEON audio format conversions"
msgstr ""
......@@ -19636,10 +19628,6 @@ msgstr ""
msgid "Specify the log filename."
msgstr ""
#: modules/misc/memcpy.c:42
msgid "libc memcpy"
msgstr ""
#: modules/misc/osd/parser.c:51
msgid "OSD configuration importer"
msgstr ""
......@@ -19730,14 +19718,6 @@ msgstr ""
msgid "XML Parser (using libxml2)"
msgstr ""
#: modules/mmxext/memcpy.c:49
msgid "MMX EXT memcpy"
msgstr ""
#: modules/mmx/memcpy.c:49
msgid "MMX memcpy"
msgstr ""
#: modules/mux/asf.c:57
msgid "Title to put in ASF comments."
msgstr ""
......
......@@ -508,7 +508,6 @@ vlc_event_manager_fini
vlc_event_manager_init
vlc_event_manager_register_event_type
vlc_event_send
vlc_fastmem_register
vlc_fourcc_GetCodec
vlc_fourcc_GetCodecAudio
vlc_fourcc_GetCodecFromString
......@@ -529,7 +528,6 @@ vlc_iconv_open
vlc_join
vlc_list_children
vlc_list_release
vlc_memcpy
vlc_meta_AddExtra
vlc_meta_CopyExtraNames
vlc_meta_Delete
......
......@@ -372,20 +372,3 @@ void vlc_CPU_dump (vlc_object_t *obj)
if (p > buf)
msg_Dbg (obj, "CPU has capabilities %s", buf);
}
static vlc_memcpy_t pf_vlc_memcpy = memcpy;
void vlc_fastmem_register (vlc_memcpy_t cpy)
{
assert (cpy != NULL);
pf_vlc_memcpy = cpy;
}
/**
* vlc_memcpy: fast CPU-dependent memcpy
*/
void *vlc_memcpy (void *tgt, const void *src, size_t n)
{
return pf_vlc_memcpy (tgt, src, n);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment