gst/: Convert asm source into inline assembly.

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
This commit is contained in:
David Schleef 2004-04-14 01:24:41 +00:00
parent 3803e830d3
commit 26d7745271
5 changed files with 27 additions and 46 deletions

View file

@ -1,3 +1,10 @@
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

2
common

@ -1 +1 @@
Subproject commit dfbe01076ca09686d37a2816a7c884c5adedb7af
Subproject commit c4fb9e5b7bc69f9420a0f008230e3028fdc2b097

View 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 \

View 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)
{

View file

@ -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