hw/apic.c: use bsr and bsf on x86_64

(C.W. Betts)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5382 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2008-10-01 21:45:59 +00:00
parent e90f009bd2
commit 5a964d93dc

View File

@ -109,7 +109,7 @@ static int fls_bit(uint32_t value)
{ {
unsigned int ret = 0; unsigned int ret = 0;
#if defined(HOST_I386) #if defined(HOST_I386) || defined(HOST_X86_64)
__asm__ __volatile__ ("bsr %1, %0\n" : "+r" (ret) : "rm" (value)); __asm__ __volatile__ ("bsr %1, %0\n" : "+r" (ret) : "rm" (value));
return ret; return ret;
#else #else
@ -130,7 +130,7 @@ static int ffs_bit(uint32_t value)
{ {
unsigned int ret = 0; unsigned int ret = 0;
#if defined(HOST_I386) #if defined(HOST_I386) || defined(HOST_X86_64)
__asm__ __volatile__ ("bsf %1, %0\n" : "+r" (ret) : "rm" (value)); __asm__ __volatile__ ("bsf %1, %0\n" : "+r" (ret) : "rm" (value));
return ret; return ret;
#else #else