From f256f4f9b959b9f846c4dba6231ccf081f5bdf3c Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 14 Aug 2004 15:17:39 +0000 Subject: Improved SPARC CPU detection and SPARC compilation fixes. patch by jb13@gomerbud.com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13019 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 33 +++++++++++++++++++++++++++++++-- libmpeg2/Makefile | 4 ++++ libmpeg2/cpu_accel.c | 2 +- libmpeg2/motion_comp.c | 2 ++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c3bffe2ac2..c5c20df4a5 100755 --- a/configure +++ b/configure @@ -449,7 +449,8 @@ if test -z "$_target" ; then 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 @@ EOF _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_3DNOW = $_3dnow TARGET_3DNOWEX = $_3dnowex TARGET_SSE = $_sse TARGET_ALTIVEC = $_altivec +TARGET_VIS = $_vis # --- GUI stuff --- GTKLIB = $_ld_static $_ld_gtk @@ -6820,6 +6848,7 @@ $_def_altivec_h // enables usage of altivec.h $_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 diff --git a/libmpeg2/Makefile b/libmpeg2/Makefile index 2c4c77b467..19674ed5bd 100644 --- a/libmpeg2/Makefile +++ b/libmpeg2/Makefile @@ -13,6 +13,10 @@ ifeq ($(TARGET_ALTIVEC),yes) 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 diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c index e87f5b20a9..bf0d94bb59 100644 --- a/libmpeg2/cpu_accel.c +++ b/libmpeg2/cpu_accel.c @@ -108,7 +108,7 @@ static inline uint32_t arch_accel (void) } #endif /* ARCH_X86 */ -#if defined(ARCH_PPC) || defined(ARCH_SPARC) +#if defined(ARCH_PPC) || (defined(ARCH_SPARC) && defined(HAVE_VIS)) #include #include diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c index 6686b016c1..f22370884a 100644 --- a/libmpeg2/motion_comp.c +++ b/libmpeg2/motion_comp.c @@ -55,9 +55,11 @@ void mpeg2_mc_init (uint32_t accel) 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; } -- cgit v1.2.3