[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile
From: |
Wessel, Jason |
Subject: |
RE: [Qemu-devel] [PATCH] add a simple 24mhz clock for the versatile |
Date: |
Fri, 30 Mar 2007 16:30:24 -0700 |
uint64_t now =
qemu_get_clock(vm_clock);
return (uint32_t)((now*3)/125);
The optimizer should fix this up with no floating point
ops.
Jason.
If you're ok you can shift it left 4 bits, then add half that
result then shift right 10 bits.
Of course, you'll only get 23.4Mhz
that way :-)
jonathan
On 3/30/07, Paul
Brook <address@hidden>
wrote:
>
+ uint64_t now = qemu_get_clock(vm_clock);
> + return
(uint32_t)(now*.024);
We should be able to do this without resorting
to floating point
arithmetic.
Paul
--
--
Jonathan Kalbfeld
+1 323 620 6682