gst/: Convert asm source into inline assembly.
authorDavid Schleef <ds@schleef.org>
Wed, 14 Apr 2004 01:24:41 +0000 (01:24 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 14 Apr 2004 01:24:41 +0000 (01:24 +0000)
Original commit message from CVS:
* gst/Makefile.am:
* gst/gstcpu.c: (gst_cpuid_i386): Convert asm source into inline
assembly.
* gst/gstcpuid_i386.s: remove

ChangeLog
common
gst/Makefile.am
gst/gstcpu.c
gst/gstcpuid_i386.s [deleted file]

index 864fc1b..8141982 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-04-13  David Schleef  <ds@schleef.org>
 
+       * gst/Makefile.am:
+       * gst/gstcpu.c: (gst_cpuid_i386): Convert asm source into inline
+       assembly.
+       * gst/gstcpuid_i386.s: remove
+
+2004-04-13  David Schleef  <ds@schleef.org>
+
        * docs/gst/tmpl/gstaggregator.sgml: Random checkin because gtk-doc
        seems to think it needs to be done.
        * docs/gst/tmpl/gstfakesink.sgml:
diff --git a/common b/common
index dfbe010..c4fb9e5 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit dfbe01076ca09686d37a2816a7c884c5adedb7af
+Subproject commit c4fb9e5b7bc69f9420a0f008230e3028fdc2b097
index cc889eb..38efc1f 100644 (file)
@@ -6,12 +6,6 @@ else
 noinst_LTLIBRARIES = libcothreads.la
 endif
 
-if HAVE_CPU_I386
-GSTARCH_SRCS = gstcpuid_i386.s
-else
-GSTARCH_SRCS = 
-endif
-
 #GST_INSTRUMENT_FLAGS = -finstrument-functions -DGST_ENABLE_FUNC_INSTRUMENTATION
 
 if GST_DISABLE_LOADSAVE
@@ -83,7 +77,7 @@ built_header_make = gstenumtypes.h gstmarshal.h
 built_source_make = $(GST_ENUMTYPES_SRC) gstmarshal.c
 
 EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
-       gstcpuid_i386.s gstmarshal.list gstxml.c gstparse.c gsttrace.c
+       gstmarshal.list gstxml.c gstparse.c gsttrace.c
 
 libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
        gst.c                   \
index 7606b74..10d3e2f 100644 (file)
@@ -32,8 +32,6 @@ static guint32 _gst_cpu_flags = 0;
 
 #ifdef HAVE_CPU_I386
 #define _gst_cpu_initialize_arch _gst_cpu_initialize_i386
-void gst_cpuid_i386 (int, unsigned long *, unsigned long *, unsigned long *,
-    unsigned long *);
 gboolean _gst_cpu_initialize_i386 (gulong * flags, GString * featurelist);
 #else
 #define _gst_cpu_initialize_arch _gst_cpu_initialize_none
@@ -65,6 +63,24 @@ _gst_cpu_initialize_none (gulong * flags, GString * featurelist)
 }
 
 #ifdef HAVE_CPU_I386
+static void
+gst_cpuid_i386 (int x, unsigned long *eax, unsigned long *ebx,
+    unsigned long *ecx, unsigned long *edx)
+{
+  unsigned long regs[4];
+
+asm ("  cpuid\n" "  movl %%eax, %0\n" "  movl %%ebx, %1\n" "  movl %%ecx, %2\n" "  movl %%edx, %3\n":"=o" (regs[0]),
+      "=o" (regs[1]),
+      "=o" (regs[2]), "=o" (regs[3])
+:    "a" (x)
+:    "ebx", "ecx", "edx");
+
+  *eax = regs[0];
+  *ebx = regs[1];
+  *ecx = regs[2];
+  *edx = regs[3];
+}
+
 gboolean
 _gst_cpu_initialize_i386 (gulong * flags, GString * featurelist)
 {
diff --git a/gst/gstcpuid_i386.s b/gst/gstcpuid_i386.s
deleted file mode 100644 (file)
index 9215f69..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-       .text
-.globl gst_cpuid_i386
-       .type    gst_cpuid_i386,@function
-gst_cpuid_i386:
-       pushl %ebp
-       movl %esp,%ebp
-       pushl %edi
-       pushl %ebx
-       pushl %ecx
-       pushl %edx
-       movl 8(%ebp),%eax
-       cpuid
-       movl 12(%ebp),%edi
-       test %edi,%edi
-       jz L1   
-       movl %eax,(%edi)
-L1:    movl 16(%ebp),%edi
-       test %edi,%edi
-       jz L2
-       movl %ebx,(%edi)
-L2:    movl 20(%ebp),%edi
-       test %edi,%edi
-       jz L3
-       movl %ecx,(%edi)
-L3:    movl 24(%ebp),%edi
-       test %edi,%edi
-       jz L4
-       movl %edx,(%edi)
-L4:    popl %edx
-       popl %ecx
-       popl %ebx
-       popl %edi
-       movl %ebp,%esp
-       popl %ebp
-       ret
-