Commit 300e93ef authored by Laurent Aimar's avatar Laurent Aimar

* all: "8x8 SAD written in Sparc Assembly using VIS." Patch by Phil Jensen.



git-svn-id: svn://svn.videolan.org/x264/trunk@276 df754926-b1dd-0310-bc7b-ec298dee348c
parent 1a0920f5
......@@ -37,6 +37,12 @@ ifeq ($(ARCH),PPC)
SRCS += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c
endif
# VIS optims
ifeq ($(ARCH),UltraSparc)
ASMSRC += common/sparc/pixel.asm
OBJASM = $(ASMSRC:%.asm=%.o)
endif
ifneq ($(HAVE_GETOPT_LONG),1)
SRCS += extras/getopt.c
CFLAGS += -DHAVE_GETOPT_LONG=0
......
......@@ -40,6 +40,9 @@
#ifdef ARCH_PPC
# include "ppc/pixel.h"
#endif
#ifdef ARCH_UltraSparc
# include "sparc/pixel.h"
#endif
/****************************************************************************
......@@ -434,5 +437,8 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
x264_pixel_altivec_init( pixf );
}
#endif
#ifdef ARCH_UltraSparc
pixf->sad[PIXEL_8x8] = x264_pixel_sad_8x8_vis;
#endif
}
/*****************************************************************************
* pixel.asm: h264 encoder library
*****************************************************************************
* Copyright (C) 2005 x264 project
* $Id: $
*
* Authors: Phil Jensen <philj@csufresno.edu>
*
* 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.
*****************************************************************************/
! VIS optimized SAD for UltraSPARC
.text
.align 4
.global x264_pixel_sad_8x8_vis
x264_pixel_sad_8x8_vis:
save %sp, -120, %sp
fzero %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
alignaddr %i0, %g0, %l0
ldd [%l0], %f0
ldd [%l0+8], %f2
faligndata %f0, %f2, %f4
alignaddr %i2, %g0, %l2
ldd [%l2], %f6
ldd [%l2+8], %f8
faligndata %f6, %f8, %f10
add %i0, %i1, %i0
add %i2, %i3, %i2
pdist %f4, %f10, %f12
std %f12, [%fp-24]
ld [%fp-20], %i0
ret
restore
/*****************************************************************************
* pixel.h: h264 encoder library
*****************************************************************************
* Copyright (C) 2005 x264 project
* $Id: pixel.h,v 1.1 2004/06/03 19:27:07 fenrir Exp $
*
* Authors: Phil Jensen <philj@csufresno.edu>
*
* 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 _SPARC_PIXEL_H
#define _SPARC_PIXEL_H 1
int x264_pixel_sad_8x8_vis( uint8_t *, int, uint8_t *, int );
#endif
......@@ -107,9 +107,16 @@ case "$UNAMEM" in
CFLAGS="$CFLAGS -maltivec -mabi=altivec"
fi
;;
sun*)
sun4m|sun4d)
ARCH="Sparc"
;;
sun4u)
ARCH="UltraSparc"
CFLAGS="$CFLAGS -mcpu=ultrasparc"
LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
AS="as"
ASFLAGS="-xarch=v8plusa"
;;
*)
echo "Unknown platform $UNAMEM, edit the configure"
exit 1
......
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