[SCM] libav/experimental: Portability and testing issues
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 15:29:49 UTC 2013
The following commit has been merged in the experimental branch:
commit c10e9f70c0509ee17c5f339672550e610ff82a36
Author: Nick Kurshev <nickols_k at mail.ru>
Date: Wed Aug 8 16:26:51 2001 +0000
Portability and testing issues
Originally committed as revision 55 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c345a65..d2be0e7 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -37,7 +37,7 @@ LIB= libavcodec.a
TESTS= imgresample-test dct-test
all: $(LIB)
-tests: apiexample $(TESTS)
+tests: apiexample cpuid_test $(TESTS)
$(LIB): $(OBJS) $(ASM_OBJS)
rm -f $@
@@ -70,6 +70,10 @@ distclean: clean
apiexample: apiexample.c $(LIB)
$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
+# cpuid test
+cpuid_test: i386/cputest.c
+ $(CC) $(CFLAGS) -D__TEST__ -o $@ $<
+
# testing progs
imgresample-test: imgresample.c
diff --git a/libavcodec/i386/cputest.c b/libavcodec/i386/cputest.c
index 4847bac..e8f22dd 100644
--- a/libavcodec/i386/cputest.c
+++ b/libavcodec/i386/cputest.c
@@ -6,13 +6,13 @@
/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
#define cpuid(index,eax,ebx,ecx,edx)\
- asm ("movl %%ebx, %%esi\n\t"\
+ __asm __volatile\
+ ("movl %%ebx, %%esi\n\t"\
"cpuid\n\t"\
"xchgl %%ebx, %%esi"\
: "=a" (eax), "=S" (ebx),\
"=c" (ecx), "=d" (edx)\
- : "0" (index)\
- : "cc")\
+ : "0" (index));
/* Function to test if multimedia instructions are supported... */
int mm_support(void)
@@ -102,3 +102,13 @@ int mm_support(void)
return 0;
}
}
+
+#ifdef __TEST__
+int main ( void )
+{
+ int mm_flags;
+ mm_flags = mm_support();
+ printf("mm_support = 0x%08u\n",mm_flags);
+ return 0;
+}
+#endif
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list