Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
928d731d
Commit
928d731d
authored
Apr 03, 2002
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed altivec memcpy module [OS X port]
parent
dd5d92a4
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
256 additions
and
182 deletions
+256
-182
Makefile.opts.in
Makefile.opts.in
+2
-0
configure
configure
+105
-99
configure.in
configure.in
+6
-2
plugins/memcpy/Makefile
plugins/memcpy/Makefile
+1
-1
plugins/memcpy/fastmemcpy.h
plugins/memcpy/fastmemcpy.h
+1
-70
plugins/memcpy/memcpy.c
plugins/memcpy/memcpy.c
+1
-10
plugins/memcpy/memcpyaltivec.c
plugins/memcpy/memcpyaltivec.c
+140
-0
No files found.
Makefile.opts.in
View file @
928d731d
...
...
@@ -95,6 +95,7 @@ LIB_KDE = @LIB_KDE@
LIB_LIRC
=
@LIB_LIRC@
LIB_MACOSX
=
@LIB_MACOSX@
LIB_MAD
=
@LIB_MAD@
LIB_MEMCPYALTIVEC
=
@LIB_MEMCPYALTIVEC@
LIB_MOTIONALTIVEC
=
@LIB_MOTIONALTIVEC@
LIB_MPEG_TS
=
@LIB_MPEG_TS@
LIB_NCURSES
=
@LIB_NCURSES@
...
...
@@ -126,6 +127,7 @@ CFLAGS_KDE = @CFLAGS_KDE@
CFLAGS_IDCTALTIVEC
=
@CFLAGS_IDCTALTIVEC@
CFLAGS_MACOSX
=
@CFLAGS_MACOSX@
CFLAGS_MAD
=
@CFLAGS_MAD@
CFLAGS_MEMCPYALTIVEC
=
@CFLAGS_MEMCPYALTIVEC@
CFLAGS_MOTIONALTIVEC
=
@CFLAGS_MOTIONALTIVEC@
CFLAGS_QT
=
@CFLAGS_QT@
CFLAGS_SDL
=
@CFLAGS_SDL@
...
...
configure
View file @
928d731d
This diff is collapsed.
Click to expand it.
configure.in
View file @
928d731d
...
...
@@ -383,7 +383,7 @@ THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
if test x$SYS != xmingw32; then
SSE_MODULES="imdctsse downmixsse"
fi
ALTIVEC_MODULES="idctaltivec motionaltivec
memcpyaltivec
"
ALTIVEC_MODULES="idctaltivec motionaltivec"
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
[ac_cv_mmx_inline],
...
...
@@ -461,8 +461,9 @@ if test x"$ac_cv_c_altivec" != x"no"; then
AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_c_altivec"
CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_c_altivec"
CFLAGS_MEMCPYALTIVEC="$CFLAGS_MEMCPYALTIVEC $ac_cv_c_altivec"
CFLAGS_VLC="$CFLAGS_VLC $ac_cv_c_altivec"
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}
memcpyaltivec
"
fi
AC_CACHE_CHECK([if linker needs -framework vecLib],
...
...
@@ -475,6 +476,7 @@ AC_CACHE_CHECK([if linker needs -framework vecLib],
if test x"$ac_cv_ld_altivec" != x"no"; then
LIB_IDCTALTIVEC="${LIB_IDCTALTIVEC} -framework vecLib"
LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
LIB_MEMCPYALTIVEC="${LIB_MEMCPYALTIVEC} -framework vecLib"
LIB_VLC="${LIB_VLC} -framework vecLib"
fi
fi # end if mingw32
...
...
@@ -1458,6 +1460,7 @@ AC_SUBST(LIB_KDE)
AC_SUBST(LIB_LIRC)
AC_SUBST(LIB_MACOSX)
AC_SUBST(LIB_MAD)
AC_SUBST(LIB_MEMCPYALTIVEC)
AC_SUBST(LIB_MOTIONALTIVEC)
AC_SUBST(LIB_MPEG_TS)
AC_SUBST(LIB_NCURSES)
...
...
@@ -1486,6 +1489,7 @@ AC_SUBST(CFLAGS_KDE)
AC_SUBST(CFLAGS_IDCTALTIVEC)
AC_SUBST(CFLAGS_MACOSX)
AC_SUBST(CFLAGS_MAD)
AC_SUBST(CFLAGS_MEMCPYALTIVEC)
AC_SUBST(CFLAGS_MOTIONALTIVEC)
AC_SUBST(CFLAGS_OPTIM)
AC_SUBST(CFLAGS_OPTIM_NODEBUG)
...
...
plugins/memcpy/Makefile
View file @
928d731d
...
...
@@ -2,4 +2,4 @@ memcpy_SOURCES = memcpy.c
memcpymmx_SOURCES
=
memcpy.c
memcpymmxext_SOURCES
=
memcpy.c
memcpy3dn_SOURCES
=
memcpy.c
memcpyaltivec_SOURCES
=
memcpy.c
memcpyaltivec_SOURCES
=
memcpy
altivec
.c
plugins/memcpy/fastmemcpy.h
View file @
928d731d
/*****************************************************************************
* fastmemcpy.h : fast memcpy routines
*****************************************************************************
* $Id: fastmemcpy.h,v 1.
2 2002/04/02 22:16:07
massiot Exp $
* $Id: fastmemcpy.h,v 1.
3 2002/04/03 22:36:50
massiot Exp $
*
* Authors: various Linux kernel hackers
* various MPlayer hackers
* Nick Kurshev <nickols_k@mail.ru>
* Christophe Massiot <massiot@via.ecp.fr> (Altivec)
*
* 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
...
...
@@ -383,71 +382,3 @@ void * _M( fast_memcpy )(void * to, const void * from, size_t len)
#endif
/* #if defined( HAVE_MMX2 ) || defined( HAVE_3DNOW ) || defined( HAVE_MMX ) */
#ifdef HAVE_ALTIVEC
# 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
#undef MMREG_SIZE
#define MMREG_SIZE 16
void
*
_M
(
fast_memcpy
)(
void
*
_to
,
const
void
*
_from
,
size_t
len
)
{
void
*
retval
=
_to
;
u8
*
to
=
(
u8
*
)
_to
;
u8
*
from
=
(
u8
*
)
_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
;
memcpy
(
to
,
from
,
delta
);
to
+=
delta
;
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
);
do
{
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
;
}
while
(
len
&
~
(
MMREG_SIZE
-
1
)
);
vec_st
(
tmp
,
0
,
to
);
}
}
if
(
len
)
{
memcpy
(
to
,
from
,
len
);
}
return
retval
;
}
# endif
#endif
plugins/memcpy/memcpy.c
View file @
928d731d
...
...
@@ -2,7 +2,7 @@
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: memcpy.c,v 1.
6 2002/04/02 22:16:07
massiot Exp $
* $Id: memcpy.c,v 1.
7 2002/04/03 22:36:50
massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -45,9 +45,6 @@
#elif defined( MODULE_NAME_IS_memcpymmxext )
# define HAVE_MMX2
# include "fastmemcpy.h"
#elif defined( MODULE_NAME_IS_memcpyaltivec )
# define HAVE_ALTIVEC
# include "fastmemcpy.h"
#endif
/*****************************************************************************
...
...
@@ -91,12 +88,6 @@ MODULE_INIT_START
ADD_REQUIREMENT
(
MMXEXT
)
ADD_SHORTCUT
(
"mmxext"
)
ADD_SHORTCUT
(
"memcpymmxext"
)
#elif defined( MODULE_NAME_IS_memcpyaltivec )
SET_DESCRIPTION
(
"Altivec memcpy module"
)
ADD_CAPABILITY
(
MEMCPY
,
100
)
ADD_REQUIREMENT
(
ALTIVEC
)
ADD_SHORTCUT
(
"altivec"
)
ADD_SHORTCUT
(
"memcpyaltivec"
)
#endif
MODULE_INIT_STOP
...
...
plugins/memcpy/memcpyaltivec.c
0 → 100644
View file @
928d731d
/*****************************************************************************
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: memcpyaltivec.c,v 1.1 2002/04/03 22:36:50 massiot Exp $
*
* Authors: 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef __BUILD_ALTIVEC_ASM__
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h>
#include <string.h>
#include <videolan/vlc.h>
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
static
void
memcpy_getfunctions
(
function_list_t
*
p_function_list
);
void
*
_M
(
fast_memcpy
)
(
void
*
to
,
const
void
*
from
,
size_t
len
);
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION
(
"Altivec memcpy module"
)
ADD_CAPABILITY
(
MEMCPY
,
100
)
ADD_REQUIREMENT
(
ALTIVEC
)
ADD_SHORTCUT
(
"altivec"
)
ADD_SHORTCUT
(
"memcpyaltivec"
)
MODULE_INIT_STOP
MODULE_ACTIVATE_START
memcpy_getfunctions
(
&
p_module
->
p_functions
->
memcpy
);
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/* Following functions are local */
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static
void
memcpy_getfunctions
(
function_list_t
*
p_function_list
)
{
p_function_list
->
functions
.
memcpy
.
pf_memcpy
=
_M
(
fast_memcpy
);
}
#else
# include <sys/types.h>
# define _M( toto ) toto
#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
void
*
_M
(
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
;
memcpy
(
to
,
from
,
delta
);
to
+=
delta
;
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
);
do
{
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
;
}
while
(
len
&
~
(
MMREG_SIZE
-
1
)
);
vec_st
(
tmp
,
0
,
to
);
}
}
if
(
len
)
{
memcpy
(
to
,
from
,
len
);
}
return
retval
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment