[vectorIntrinsics] what about div?
John Rose
john.r.rose at oracle.com
Fri May 31 07:41:48 UTC 2019
On May 31, 2019, at 12:34 AM, John Rose <john.r.rose at oracle.com> wrote:
>
> I propose that we move div up into the top level class,
BTW, this proposal relates to my previous one about
partial operations. I *do not* want to build special
division rules into the JIT. Instead, I want to implement
whatever crazy integer division emulation is necessary
in *Java*. To do that probably requires temporary
expansion of a Vector<Integer> to *two* Vector<Double>
temporaries. The JIT shouldn't deal with this, and with
the "part" convention we frame the computation in terms
of vector pairs like this:
Vector<Double> part0 = intv.convert(I2D, /*part*/0);
Vector<Double> part1 = intv.convert(I2D, /*part*/1);
…do float64 division in both part[01]…
VectorMask<Double> bad0 = findInfOrNan(part0);
VectorMask<Double> bad1 = findInfOrNan(part1);
if (bad0.or(bad1).anyTrue()) throw div0BadThing();
Vector<Integer> result0 = part0.convert(D2I, /*part*/0);
Vector<Integer> result1 = part1.convert(D2I, /*part*/1);
return result0.bitwise(OR, result1);
More information about the panama-dev
mailing list