Fixes to properly conditionally compile architecture-dependent code

Original commit message from CVS:
Fixes to properly conditionally compile architecture-dependent code
This commit is contained in:
David Schleef 2001-11-06 12:49:01 +00:00
parent a7f5c14936
commit 99edd18882
3 changed files with 26 additions and 5 deletions

View file

@ -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)

View file

@ -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

View file

@ -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__ */