>>> On 17.01.16 at 22:58, <haozhong.zh...@intel.com> wrote: > This patch adds several functions to take multiplication, division and > shifting involving 64-bit integers. > > Signed-off-by: Haozhong Zhang <haozhong.zh...@intel.com> > Reviewed-by: Boris Ostrovsky <boris.ostrov...@oracle.com> > --- > Changes in v4: > (addressing Jan Beulich's comments) > * Rewrite mul_u64_u64_shr() in assembly.
Thanks, but it puzzles me that the other one didn't get converted as well. Anyway, I'm not going to make this a requirement, since at least it appears to match Linux'es variant. > +static inline u64 mul_u64_u64_shr(u64 a, u64 mul, unsigned int n) > +{ > + u64 hi, lo; > + > + asm volatile ( "mulq %2; shrdq %1,%0" > + : "=a" (lo), "=d" (hi) > + : "rm" (mul), "0" (a), "c" (n) ); SHRD formally is a 3-operand instruction, and the fact that gas' AT&T syntax supports a 2-operand "alias" is, well, odd. Please let's use the specification mandated 3-operand form properly, to avoid surprises with e.g. clang. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel