qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5382] hw/apic.c: use bsr and bsf on x86_64
@ 2008-10-01 21:46 Aurelien Jarno
  2008-10-02 18:00 ` malc
  0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2008-10-01 21:46 UTC (permalink / raw)
  To: qemu-devel

Revision: 5382
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5382
Author:   aurel32
Date:     2008-10-01 21:45:59 +0000 (Wed, 01 Oct 2008)

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

(C.W. Betts)

Modified Paths:
--------------
    trunk/hw/apic.c

Modified: trunk/hw/apic.c
===================================================================
--- trunk/hw/apic.c	2008-10-01 21:45:51 UTC (rev 5381)
+++ trunk/hw/apic.c	2008-10-01 21:45:59 UTC (rev 5382)
@@ -109,7 +109,7 @@
 {
     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));
     return ret;
 #else
@@ -130,7 +130,7 @@
 {
     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));
     return ret;
 #else

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [5382] hw/apic.c: use bsr and bsf on x86_64
  2008-10-01 21:46 [Qemu-devel] [5382] hw/apic.c: use bsr and bsf on x86_64 Aurelien Jarno
@ 2008-10-02 18:00 ` malc
  0 siblings, 0 replies; 2+ messages in thread
From: malc @ 2008-10-02 18:00 UTC (permalink / raw)
  To: qemu-devel

On Wed, 1 Oct 2008, Aurelien Jarno wrote:

> Revision: 5382
>          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5382
> Author:   aurel32
> Date:     2008-10-01 21:45:59 +0000 (Wed, 01 Oct 2008)
>
> Log Message:
> -----------
> hw/apic.c: use bsr and bsf on x86_64
>
> (C.W. Betts)
>
> Modified Paths:
> --------------
>    trunk/hw/apic.c

I think this should just be changed to __builtin_ffs or clz and the
requirement to return 0 on 0 dropped (since all the users do check
for 0 anyway).

[..snip..]

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-02 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01 21:46 [Qemu-devel] [5382] hw/apic.c: use bsr and bsf on x86_64 Aurelien Jarno
2008-10-02 18:00 ` malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).