From 34d11b875f96cab642893f12656f24899ca42ad7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@gmx.de>
Date: Tue, 26 May 2009 05:00:51 +0000
Subject: [PATCH] Change HAVE_PPC64 to ARCH_PPC64. As a side-effect this also
 gives it the correct value on e.g. PPC970FX-based PPC64 systems, thus fixing
 "make test" (mp2/mp3 decoding).

Originally committed as revision 18953 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 configure                    | 6 +++---
 libavcodec/ppc/dsputil_ppc.h | 8 ++++----
 libavcodec/ppc/mathops.h     | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 49468d76f2a..590853e27d0 100755
--- a/configure
+++ b/configure
@@ -833,6 +833,7 @@ ARCH_LIST='
     mips64
     parisc
     ppc
+    ppc64
     s390
     sh4
     sparc
@@ -906,7 +907,6 @@ HAVE_LIST="
     mkstemp
     pld
     posix_memalign
-    ppc64
     round
     roundf
     sdl
@@ -1514,6 +1514,7 @@ case "$arch" in
     ;;
     ppc64)
         arch="ppc"
+        subarch="ppc64"
         enable fast_64bit
         enable fast_unaligned
     ;;
@@ -1807,12 +1808,11 @@ if test $cpu != "generic"; then
         G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
             add_cflags -mcpu=970 -mpowerpc-gfxopt -mpowerpc64
             warn_altivec disabled PPC970
-            enable ppc64
         ;;
         Cell|CELL|cell)
             add_cflags -mcpu=cell
             warn_altivec disabled Cell
-            enable ppc64 ldbrx
+            enable ldbrx
         ;;
         # targets that do NOT support conditional mov (cmov)
         i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
diff --git a/libavcodec/ppc/dsputil_ppc.h b/libavcodec/ppc/dsputil_ppc.h
index 3583acfc462..d028574f020 100644
--- a/libavcodec/ppc/dsputil_ppc.h
+++ b/libavcodec/ppc/dsputil_ppc.h
@@ -27,7 +27,7 @@
 void powerpc_display_perf_report(void);
 /* the 604* have 2, the G3* have 4, the G4s have 6,
    and the G5 are completely different (they MUST use
-   HAVE_PPC64, and let's hope all future 64 bis PPC
+   ARCH_PPC64, and let's hope all future 64 bis PPC
    will use the same PMCs... */
 #define POWERPC_NUM_PMC_ENABLED 6
 /* if you add to the enum below, also add to the perfname array
@@ -70,7 +70,7 @@ enum powerpc_data_index {
 };
 extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
 
-#if !HAVE_PPC64
+#if !ARCH_PPC64
 #define POWERP_PMC_DATATYPE unsigned long
 #define POWERPC_GET_PMC1(a) __asm__ volatile("mfspr %0, 937" : "=r" (a))
 #define POWERPC_GET_PMC2(a) __asm__ volatile("mfspr %0, 938" : "=r" (a))
@@ -88,7 +88,7 @@ extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][
 #define POWERPC_GET_PMC5(a) do {} while (0)
 #define POWERPC_GET_PMC6(a) do {} while (0)
 #endif
-#else /* HAVE_PPC64 */
+#else /* ARCH_PPC64 */
 #define POWERP_PMC_DATATYPE unsigned long long
 #define POWERPC_GET_PMC1(a) __asm__ volatile("mfspr %0, 771" : "=r" (a))
 #define POWERPC_GET_PMC2(a) __asm__ volatile("mfspr %0, 772" : "=r" (a))
@@ -106,7 +106,7 @@ extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][
 #define POWERPC_GET_PMC5(a) do {} while (0)
 #define POWERPC_GET_PMC6(a) do {} while (0)
 #endif
-#endif /* HAVE_PPC64 */
+#endif /* ARCH_PPC64 */
 #define POWERPC_PERF_DECLARE(a, cond)       \
     POWERP_PMC_DATATYPE                     \
         pmc_start[POWERPC_NUM_PMC_ENABLED], \
diff --git a/libavcodec/ppc/mathops.h b/libavcodec/ppc/mathops.h
index a74fcfa792a..1dcc09aebd8 100644
--- a/libavcodec/ppc/mathops.h
+++ b/libavcodec/ppc/mathops.h
@@ -44,7 +44,7 @@ static inline av_const int MULH(int a, int b){
     return r;
 }
 
-#if !HAVE_PPC64
+#if !ARCH_PPC64
 static inline av_const int64_t MAC64(int64_t d, int a, int b)
 {
     union { uint64_t x; unsigned hl[2]; } x = { d };
-- 
GitLab