Commit 5a964d93dce5ee2059d960afd3a5748f5b94456e
1 parent
e90f009b
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
Showing
1 changed file
with
2 additions
and
2 deletions
hw/apic.c
... | ... | @@ -109,7 +109,7 @@ static int fls_bit(uint32_t value) |
109 | 109 | { |
110 | 110 | unsigned int ret = 0; |
111 | 111 | |
112 | -#if defined(HOST_I386) | |
112 | +#if defined(HOST_I386) || defined(HOST_X86_64) | |
113 | 113 | __asm__ __volatile__ ("bsr %1, %0\n" : "+r" (ret) : "rm" (value)); |
114 | 114 | return ret; |
115 | 115 | #else |
... | ... | @@ -130,7 +130,7 @@ static int ffs_bit(uint32_t value) |
130 | 130 | { |
131 | 131 | unsigned int ret = 0; |
132 | 132 | |
133 | -#if defined(HOST_I386) | |
133 | +#if defined(HOST_I386) || defined(HOST_X86_64) | |
134 | 134 | __asm__ __volatile__ ("bsf %1, %0\n" : "+r" (ret) : "rm" (value)); |
135 | 135 | return ret; |
136 | 136 | #else | ... | ... |