[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 07/13] x86: Add functions for 64-bit integer arithmetic

On 12/30/2015 10:03 PM, Haozhong Zhang wrote:
This patch adds several functions to take multiplication, division and
shifting involving 64-bit integers. Those functions are derived from
Linux kernel and will be used by later patches to calculate scaling
ratio and scaled TSC.

Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>

(although I not sure why you decided to change Linux' code in mul64() below)

+    c = (u64)rl.l.high + rm.l.low + rn.l.low;
+    rl.l.high = c;
+    c >>= 32;
+    c = c + rm.l.high + rn.l.high + rh.l.low;
+    rh.l.low = c;
+    rh.l.high += (u32)(c >> 32);

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.