Commit abb3845b authored by Michel Lespinasse's avatar Michel Lespinasse
Browse files

Added support for MMX optimizations on x86_64

My favourite test stream gets about 187 fps on an Opteron 800 running
in 64 bit mode; compared to about 170 fps on an athlon 950.
parent 356826f9
......@@ -39,7 +39,7 @@ elif test x"$GCC" = x"yes"; then
dnl arch-specific flags
case "$host" in
i?86-* | k?-*)
i?86-* | k?-* | x86_64-*)
AC_DEFINE([ARCH_X86],,[x86 architecture])
case "$host" in
i386-*) OPT_CFLAGS="$CFLAGS -mcpu=i386";;
......
......@@ -45,10 +45,10 @@ static inline uint32_t arch_accel (void)
: "cc")
#else /* PIC version : save ebx */
#define cpuid(op,eax,ebx,ecx,edx) \
__asm__ ("pushl %%ebx\n\t" \
__asm__ ("push %%ebx\n\t" \
"cpuid\n\t" \
"movl %%ebx,%1\n\t" \
"popl %%ebx" \
"pop %%ebx" \
: "=a" (eax), \
"=r" (ebx), \
"=c" (ecx), \
......@@ -57,16 +57,16 @@ static inline uint32_t arch_accel (void)
: "cc")
#endif
__asm__ ("pushfl\n\t"
"pushfl\n\t"
"popl %0\n\t"
__asm__ ("pushf\n\t"
"pushf\n\t"
"pop %0\n\t"
"movl %0,%1\n\t"
"xorl $0x200000,%0\n\t"
"pushl %0\n\t"
"popfl\n\t"
"pushfl\n\t"
"popl %0\n\t"
"popfl"
"push %0\n\t"
"popf\n\t"
"pushf\n\t"
"pop %0\n\t"
"popf"
: "=r" (eax),
"=r" (ebx)
:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment