Fixes to properly conditionally compile architecture-dependent code
authorDavid Schleef <ds@schleef.org>
Tue, 6 Nov 2001 12:49:01 +0000 (12:49 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 6 Nov 2001 12:49:01 +0000 (12:49 +0000)
Original commit message from CVS:
Fixes to properly conditionally compile architecture-dependent code

libs/resample/Makefile.am
libs/resample/dtos.c
libs/resample/resample.h

index 02c664d..fa31cb0 100644 (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)
 
index ce4a1c0..c02d0ef 100644 (file)
 
 
 #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
 
 
index e5347f0..4c1b2a5 100644 (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__ */