Do we need an unsigned multiplyHigh?

Andrew Haley aph at redhat.com
Wed Sep 27 13:44:50 UTC 2017


On 27/09/17 11:28, Peter Lawrey wrote:
> If you need multiplyHigh for 128-bit then you need uint256. At some point
> you have to decide whether you need that many bits as a supported
> operation.  When Java was created a 64-bit long as the widest type made
> sense, however CPUs such as x64 now support 128, 256 and 512 bit natively
> and having the JVM dong its best to work this out is not as clean as
> defining it explicitly.

I guess cleanliness is in the eye of the beholder.  IMO multiplyHigh is
as clean as we need, and I'd rather see more complexity there than in
the type system.  It'd be nice to be able to return more than one scalar
value from a method, for sure.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the security-dev mailing list