<div dir="ltr"><br><br>On Tue, Nov 13, 2018 at 1:27 AM Andrew Jeffery <<a href="mailto:andrew@aj.id.au">andrew@aj.id.au</a>> wrote:<br>> By inspection the concept of the patch seems okay to me. However, the issue<br>> that host-utils.h takes care of in addition to providing helpers is support for<br>> those helpers on systems that don't support 128-bit integers. The patch should<br>> be sent to the upstream lists, and I don't think we should be breaking<br>> qemu-arm-* generally for systems that we might not care about.<div><br></div><div>Ah, yes - I missed that there were two - one for systems with int128 and one for them</div><div>without. Hm, that does complicate things.</div><div><br></div><div>Given that we only have one operand that is ever negative, how do you feel about a patch</div><div>that goes along the lines of:</div><div><br></div><div>if (delta >= 0) {</div><div> t->start += muldiv64(delta, NANOSECONDS_PER_SECOND, rate); <br></div><div>} else {</div><div>
t->start = (int64_t)t->start - muldiv64(-delta, NANOSECONDS_PER_SECOND, rate);</div><div>}</div><div><br></div><div>That should avoid any issues I think, save us/me from implementing a signed muldiv,</div><div>but cost a bit on the readable code side.</div><div><br></div></div>