changeset 13018:adb93ef6b07f

Improved SPARC CPU detection and SPARC compilation fixes. patch by jb13@gomerbud.com
author diego
date Sat, 14 Aug 2004 15:17:39 +0000
parents 5b9c594dc6e9
children 69a86525f49e
files configure libmpeg2/Makefile libmpeg2/cpu_accel.c libmpeg2/motion_comp.c
diffstat 4 files changed, 38 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Aug 14 10:03:26 2004 +0000
+++ b/configure	Sat Aug 14 15:17:39 2004 +0000
@@ -449,7 +449,8 @@
       x86_64|amd64) host_arch=x86_64 ;;
       macppc|ppc) host_arch=ppc ;;
       alpha) host_arch=alpha ;;
-      sparc*) host_arch=sparc ;;
+      sparc) host_arch=sparc ;;
+      sparc64) host_arch=sparc64 ;;
       parisc*|hppa*|9000*) host_arch=hppa ;;
       arm*) host_arch=arm ;;
       s390) host_arch=s390 ;;
@@ -885,7 +886,33 @@
     _def_arch='#define ARCH_SPARC 1'
     _target_arch='TARGET_ARCH_SPARC = yes'
     iproc='sparc'
-    proc='v8'
+    if sunos ; then
+	echocheck "CPU type"
+	karch=`uname -m`
+	case "`echo $karch`" in
+	    sun4) proc=v7 ;;
+	    sun4c) proc=v7 ;; 
+	    sun4d) proc=v8 ;;
+	    sun4m) proc=v8 ;;
+	    sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
+	    *) ;;
+	esac
+	echores "$proc"
+    else
+	proc=v8
+    fi
+    _march=''
+    _mcpu="-mcpu=$proc"
+    _optimizing="$proc"
+    ;;
+
+  sparc64)
+    _def_arch='#define ARCH_SPARC 1'
+    _target_arch='TARGET_ARCH_SPARC = yes'
+    _vis='yes'
+    _def_vis='#define HAVE_VIS = yes'
+    iproc='sparc'
+    proc='v9'
     _march=''
     _mcpu="-mcpu=$proc"
     _optimizing="$proc"
@@ -6265,6 +6292,7 @@
 TARGET_3DNOWEX = $_3dnowex
 TARGET_SSE = $_sse
 TARGET_ALTIVEC = $_altivec
+TARGET_VIS = $_vis
 
 # --- GUI stuff ---
 GTKLIB = $_ld_static $_ld_gtk
@@ -6820,6 +6848,7 @@
 
 
 $_def_mlib  // Sun mediaLib, available only on solaris
+$_def_vis	// only define if you have VIS ( ultrasparc )
 
 /* libmpeg2 uses a different feature test macro for mediaLib */
 #ifdef HAVE_MLIB
--- a/libmpeg2/Makefile	Sat Aug 14 10:03:26 2004 +0000
+++ b/libmpeg2/Makefile	Sat Aug 14 15:17:39 2004 +0000
@@ -13,6 +13,10 @@
 SRCS += motion_comp_altivec.c idct_altivec.c
 endif
 
+ifeq ($(TARGET_VIS),yes)
+SRCS += motion_comp_vis.c
+endif
+
 .SUFFIXES: .c .o
 
 # .PHONY: all clean
--- a/libmpeg2/cpu_accel.c	Sat Aug 14 10:03:26 2004 +0000
+++ b/libmpeg2/cpu_accel.c	Sat Aug 14 15:17:39 2004 +0000
@@ -108,7 +108,7 @@
 }
 #endif /* ARCH_X86 */
 
-#if defined(ARCH_PPC) || defined(ARCH_SPARC)
+#if defined(ARCH_PPC) || (defined(ARCH_SPARC) && defined(HAVE_VIS))
 #include <signal.h>
 #include <setjmp.h>
 
--- a/libmpeg2/motion_comp.c	Sat Aug 14 10:03:26 2004 +0000
+++ b/libmpeg2/motion_comp.c	Sat Aug 14 15:17:39 2004 +0000
@@ -55,10 +55,12 @@
     else
 #endif
 #ifdef ARCH_SPARC
+#ifdef HAVE_VIS
     if (accel & MPEG2_ACCEL_SPARC_VIS)
 	mpeg2_mc = mpeg2_mc_vis;
     else
 #endif
+#endif
 	mpeg2_mc = mpeg2_mc_c;
 }