Do we need an unsigned multiplyHigh?

Peter Lawrey peter.lawrey at
Thu Sep 28 06:39:23 UTC 2017

For context,
While I am more than happy to the builtin encryption libraries which don't
need to be written in Java, we do use wider integers to speed up our parser
and text renders. e.g. it is faster to parse/cache a date/time as if it was
a 128-bit value, than 16 bytes, one byte at a time. This is a use case
which I wouldn't expect a library have an intrinsic for.


On 27 September 2017 at 21:45, John Rose <john.r.rose at> wrote:

> On Sep 27, 2017, at 8:25 AM, Peter Lawrey <peter.lawrey at> wrote:
> 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)
> That seems likely; we are aiming in both of those directions,
> to support direct programming with AVX-type registers (not
> just x86 specific, by the way) and general support for by-value
> return of structured objects (starting with "minimal value types").
> For now, though, every method is limited to at most 64 bits
> of return value "payload", which means that 128-bit operations
> need to be split into two method calls, or else buffer their
> result into a temp object (e.g., array).  The JIT knows how
> to combine two intrinsic calls into a single machine operation,
> in some very limited circumstances, notably the classic
> "div/rem" instructions.  This technique would probably work
> for 64-to-128 multiplies.  (Also AES-128, by the way.)
> — John

More information about the discuss mailing list