<div dir="ltr"><div>Indeed cleanliness is in the eye of the beholder. ;)</div><div>I feel for mathematical code like this it should be possible to write something as fast and clear as C++, whether that is desirable or not is another matter.</div><div><br></div>Perhaps project Valhalla will be a way to return multiple values by having a composite value type, or panama with it's support for XMM instructions (or both)<div><br></div><div><br></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=acGV0ZXIubGF3cmV5QGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=5527b480-3ba2-45d9-ab1b-67f98ce3ca8c"><font color="#ffffff" size="1">ᐧ</font></div><div class="gmail_extra"><br><div class="gmail_quote">On 27 September 2017 at 16:44, Andrew Haley <span dir="ltr"><<a href="mailto:aph@redhat.com" target="_blank">aph@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 27/09/17 11:28, Peter Lawrey wrote:<br>
> If you need multiplyHigh for 128-bit then you need uint256. At some point<br>
> you have to decide whether you need that many bits as a supported<br>
> operation.  When Java was created a 64-bit long as the widest type made<br>
> sense, however CPUs such as x64 now support 128, 256 and 512 bit natively<br>
> and having the JVM dong its best to work this out is not as clean as<br>
> defining it explicitly.<br>
<br>
</span>I guess cleanliness is in the eye of the beholder.  IMO multiplyHigh is<br>
as clean as we need, and I'd rather see more complexity there than in<br>
the type system.  It'd be nice to be able to return more than one scalar<br>
value from a method, for sure.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Andrew Haley<br>
Java Platform Lead Engineer<br>
Red Hat UK Ltd. <<a href="https://www.redhat.com" rel="noreferrer" target="_blank">https://www.redhat.com</a>><br>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671<br>
</div></div></blockquote></div><br></div>