# HG changeset patch # User michaelni # Date 1030956492 0 # Node ID 0012f75c92bb4d16933f210c47da5472adacf159 # Parent de12d5b9c9ad5887ec39e2c313adac73213e41bc altivec build tidyup patch by (Brian Foley ) diff -r de12d5b9c9ad -r 0012f75c92bb Makefile --- a/Makefile Sun Sep 01 20:54:38 2002 +0000 +++ b/Makefile Mon Sep 02 08:48:12 2002 +0000 @@ -73,6 +73,10 @@ endif ifeq ($(TARGET_ARCH_POWERPC),yes) +OBJS += ppc/dsputil_ppc.o +endif + +ifeq ($(TARGET_ALTIVEC),yes) CFLAGS += -faltivec OBJS += ppc/dsputil_altivec.o endif diff -r de12d5b9c9ad -r 0012f75c92bb dsputil.c --- a/dsputil.c Sun Sep 01 20:54:38 2002 +0000 +++ b/dsputil.c Mon Sep 02 08:48:12 2002 +0000 @@ -1340,9 +1340,7 @@ use_permuted_idct = 0; #endif #ifdef ARCH_POWERPC -#ifdef CONFIG_DARWIN - dsputil_init_altivec(); -#endif + dsputil_init_ppc(); #endif #ifdef SIMPLE_IDCT diff -r de12d5b9c9ad -r 0012f75c92bb dsputil.h --- a/dsputil.h Sun Sep 01 20:54:38 2002 +0000 +++ b/dsputil.h Mon Sep 02 08:48:12 2002 +0000 @@ -167,9 +167,7 @@ #define emms_c() #define __align8 __attribute__ ((aligned (16))) -#ifdef CONFIG_DARWIN -void dsputil_init_altivec(void); -#endif +void dsputil_init_ppc(void); #else diff -r de12d5b9c9ad -r 0012f75c92bb ppc/dsputil_altivec.c --- a/ppc/dsputil_altivec.c Sun Sep 01 20:54:38 2002 +0000 +++ b/ppc/dsputil_altivec.c Mon Sep 02 08:48:12 2002 +0000 @@ -127,15 +127,6 @@ return s; } -void dsputil_init_altivec(void) -{ - if (has_altivec()) { - pix_abs16x16 = pix_abs16x16_altivec; - pix_abs8x8 = pix_abs8x8_altivec; - pix_sum = pix_sum_altivec; - } -} - int has_altivec(void) { #if CONFIG_DARWIN diff -r de12d5b9c9ad -r 0012f75c92bb ppc/dsputil_altivec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppc/dsputil_altivec.h Mon Sep 02 08:48:12 2002 +0000 @@ -0,0 +1,5 @@ +extern int pix_abs16x16_altivec(uint8_t *pix1, uint8_t *pix2, int line_size); +extern int pix_abs8x8_altivec(uint8_t *pix1, uint8_t *pix2, int line_size); +extern int pix_sum_altivec(UINT8 * pix, int line_size); + +extern int has_altivec(void); diff -r de12d5b9c9ad -r 0012f75c92bb ppc/dsputil_ppc.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppc/dsputil_ppc.c Mon Sep 02 08:48:12 2002 +0000 @@ -0,0 +1,20 @@ +#include "../../config.h" +#include "../dsputil.h" + +#ifdef HAVE_ALTIVEC +#include "dsputil_altivec.h" +#endif + +void dsputil_init_ppc(void) +{ +#if HAVE_ALTIVEC + if (has_altivec()) { + pix_abs16x16 = pix_abs16x16_altivec; + pix_abs8x8 = pix_abs8x8_altivec; + pix_sum = pix_sum_altivec; + } else +#endif + { + /* Non-AltiVec PPC optimisations here */ + } +}