1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-31 07:51:55 +00:00

Replace Alpha MVI compiler workarounds by a proper configure check.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26051 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2008-02-21 16:47:05 +00:00
parent f1d416c70c
commit 884a2ba97a
5 changed files with 14 additions and 76 deletions

27
configure vendored
View File

@ -317,7 +317,7 @@ Codecs:
--enable-libdca enable libdca support [autodetect]
--disable-mp3lib disable builtin mp3lib [enabled]
--disable-liba52 disable builtin liba52 [enabled]
--disable-libmpeg2 disable builtin libmpeg2 [enabled]
--disable-libmpeg2 disable builtin libmpeg2 [autodetect]
--disable-musepack disable musepack support [autodetect]
--disable-libamr_nb disable libamr narrowband [autodetect]
--disable-libamr_wb disable libamr wideband [autodetect]
@ -568,7 +568,7 @@ _theora=auto
_mp3lib=yes
_liba52=yes
_libdca=auto
_libmpeg2=yes
_libmpeg2=auto
_faad_internal=auto
_faad_external=auto
_faad_fixed=no
@ -2179,15 +2179,6 @@ EOF
echores "$proc"
_optimizing="$proc"
echocheck "MVI instruction support in GCC"
if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
_def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
echores "yes"
else
_def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
fi
;;
mips)
@ -6039,6 +6030,17 @@ fi
echores "$_libdca"
echocheck "internal libmpeg2 support"
if test "$_libmpeg2" = auto ; then
_libmpeg2=yes
if alpha && test cc_vendor=gnu; then
case $cc_version in
2*|3.0*|3.1*) # cannot compile MVI instructions
_libmpeg2=no
_res_comment="broken gcc"
;;
esac
fi
fi
if test "$_libmpeg2" = yes ; then
_def_libmpeg2='#define USE_LIBMPEG2 1'
_codecmodules="libmpeg2 $_codecmodules"
@ -8329,9 +8331,6 @@ $_def_fast_unaligned
have the instruction. */
$_def_dcbzl
/* only gcc3 can compile mvi instructions (libmpeg2) */
$_def_gcc_mvi_support
/* Define this for Cygwin build for win32 */
$_def_confwin32

View File

@ -224,7 +224,6 @@ static uint32_t arch_accel (void)
#ifdef ARCH_ALPHA
static uint32_t arch_accel (void)
{
#ifdef CAN_COMPILE_ALPHA_MVI
uint64_t no_mvi;
asm volatile ("amask %1, %0"
@ -232,9 +231,6 @@ static uint32_t arch_accel (void)
: "rI" (256)); /* AMASK_MVI */
return no_mvi ? MPEG2_ACCEL_ALPHA : (MPEG2_ACCEL_ALPHA |
MPEG2_ACCEL_ALPHA_MVI);
#else
return MPEG2_ACCEL_ALPHA;
#endif
}
#endif /* ARCH_ALPHA */
#endif /* ACCEL_DETECT */

View File

@ -261,14 +261,11 @@ void mpeg2_idct_init (uint32_t accel)
} else
#endif
#ifdef ARCH_ALPHA
#ifdef CAN_COMPILE_ALPHA_MVI
if (accel & MPEG2_ACCEL_ALPHA_MVI) {
mpeg2_idct_copy = mpeg2_idct_copy_mvi;
mpeg2_idct_add = mpeg2_idct_add_mvi;
mpeg2_idct_alpha_init ();
} else
#endif
if (accel & MPEG2_ACCEL_ALPHA) {
} else if (accel & MPEG2_ACCEL_ALPHA) {
int i;
mpeg2_idct_copy = mpeg2_idct_copy_alpha;

View File

@ -161,7 +161,6 @@ static inline void idct_col (int16_t * const block)
block[8*7] = (a0 - b0) >> 17;
}
#ifdef CAN_COMPILE_ALPHA_MVI
void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride)
{
uint64_t clampmask;
@ -294,7 +293,6 @@ void mpeg2_idct_add_mvi (const int last, int16_t * block,
stq (p7, dest + 7 * stride);
}
}
#endif
void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
{

View File

@ -79,24 +79,6 @@
#endif
asm volatile ("mtspr 256, %0\n\t"
VAND (0, 0, 0)
@@ -195,6 +222,7 @@
#ifdef ARCH_ALPHA
static inline uint32_t arch_accel (void)
{
+#ifdef CAN_COMPILE_ALPHA_MVI
uint64_t no_mvi;
asm volatile ("amask %1, %0"
@@ -202,6 +230,9 @@
: "rI" (256)); /* AMASK_MVI */
return no_mvi ? MPEG2_ACCEL_ALPHA : (MPEG2_ACCEL_ALPHA |
MPEG2_ACCEL_ALPHA_MVI);
+#else
+ return MPEG2_ACCEL_ALPHA;
+#endif
}
#endif /* ARCH_ALPHA */
#endif /* ACCEL_DETECT */
@@ -212,7 +243,7 @@
accel = 0;
@ -233,40 +215,6 @@
mpeg2_idct_copy = mpeg2_idct_copy_mmx;
mpeg2_idct_add = mpeg2_idct_add_mmx;
mpeg2_idct_mmx_init ();
@@ -254,11 +261,14 @@
} else
#endif
#ifdef ARCH_ALPHA
+#ifdef CAN_COMPILE_ALPHA_MVI
if (accel & MPEG2_ACCEL_ALPHA_MVI) {
mpeg2_idct_copy = mpeg2_idct_copy_mvi;
mpeg2_idct_add = mpeg2_idct_add_mvi;
mpeg2_idct_alpha_init ();
- } else if (accel & MPEG2_ACCEL_ALPHA) {
+ } else
+#endif
+ if (accel & MPEG2_ACCEL_ALPHA) {
int i;
mpeg2_idct_copy = mpeg2_idct_copy_alpha;
--- libmpeg2/idct_alpha.c 2006-06-16 20:12:26.000000000 +0200
+++ libmpeg2/idct_alpha.c 2006-06-16 20:12:50.000000000 +0200
@@ -157,6 +161,7 @@
block[8*7] = (a0 - b0) >> 17;
}
+#ifdef CAN_COMPILE_ALPHA_MVI
void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride)
{
uint64_t clampmask;
@@ -289,6 +294,7 @@
stq (p7, dest + 7 * stride);
}
}
+#endif
void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
{
--- libmpeg2/idct_mmx.c 2006-06-16 20:12:26.000000000 +0200
+++ libmpeg2/idct_mmx.c 2006-06-16 20:12:50.000000000 +0200
@@ -23,7 +27,7 @@