From: David Schleef Date: Tue, 6 Nov 2001 12:49:01 +0000 (+0000) Subject: Fixes to properly conditionally compile architecture-dependent code X-Git-Tag: BRANCH-BUILD1-ROOT~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99edd1888221b15b6a85767e0e12cb57a829923d;p=platform%2Fupstream%2Fgstreamer.git Fixes to properly conditionally compile architecture-dependent code Original commit message from CVS: Fixes to properly conditionally compile architecture-dependent code --- diff --git a/libs/resample/Makefile.am b/libs/resample/Makefile.am index 02c664d..fa31cb0 100644 --- a/libs/resample/Makefile.am +++ b/libs/resample/Makefile.am @@ -15,5 +15,15 @@ test_SOURCES = test.c test_LDADD = libresample.la -CFLAGS += -O2 -ffast-math +if HAVE_CPU_I386 +ARCHCFLAGS = -march=i486 +else +if HAVE_CPU_PPC +ARCHCFLAGS = -Wa,-m7400 +else +ARCHCFLAGS = +endif +endif + +CFLAGS += -O2 -ffast-math $(ARCHCFLAGS) diff --git a/libs/resample/dtos.c b/libs/resample/dtos.c index ce4a1c0..c02d0ef 100644 --- a/libs/resample/dtos.c +++ b/libs/resample/dtos.c @@ -29,12 +29,12 @@ #define short_to_double_table -#define short_to_double_altivec +//#define short_to_double_altivec #define short_to_double_unroll #ifdef short_to_double_table -float ints_high[256]; -float ints_low[256]; +static float ints_high[256]; +static float ints_low[256]; void conv_double_short_table(double *dest, short *src, int n) { @@ -94,7 +94,7 @@ void conv_double_short_ref(double *dest, short *src, int n) } } -#ifdef short_to_double_altivec +#ifdef HAVE_CPU_PPC static union { int i[4]; float f[4]; } av_tmp __attribute__ ((__aligned__ (16))); void conv_double_short_altivec(double *dest, short *src, int n) @@ -141,6 +141,7 @@ void conv_short_double_ref(short *dest, double *src, int n) } } +#ifdef HAVE_CPU_PPC void conv_short_double_ppcasm(short *dest, double *src, int n) { int tmp[2]; @@ -168,5 +169,6 @@ void conv_short_double_ppcasm(short *dest, double *src, int n) : "r9", "r5" ); } +#endif diff --git a/libs/resample/resample.h b/libs/resample/resample.h index e5347f0..4c1b2a5 100644 --- a/libs/resample/resample.h +++ b/libs/resample/resample.h @@ -133,13 +133,22 @@ double functable_window_dboxcar(void *p, double x); void conv_double_short_table(double *dest, short *src, int n); void conv_double_short_unroll(double *dest, short *src, int n); void conv_double_short_ref(double *dest, short *src, int n); +#ifdef HAVE_CPU_PPC void conv_double_short_altivec(double *dest, short *src, int n); +#endif void conv_short_double_ref(short *dest, double *src, int n); +#ifdef HAVE_CPU_PPC void conv_short_double_ppcasm(short *dest, double *src, int n); +#endif +#ifdef HAVE_CPU_PPC #define conv_double_short conv_double_short_table #define conv_short_double conv_short_double_ppcasm +#else +#define conv_double_short conv_double_short_ref +#define conv_short_double conv_short_double_ref +#endif #endif /* __RESAMPLE_H__ */