[vectorIntrinsics] what about div?
John Rose
john.r.rose at oracle.com
Sat Jun 1 03:12:48 UTC 2019
On May 31, 2019, at 3:29 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
>
> Yes, the problem looks very similar to range checks for masked accesses (maybe even simpler? since zero reliably trigger the exception) and the solution should be easily extended to masked variant (v.equal(broadcast(0)).and(m).anyTrue()), but it's interesting to see how much overhead it introduces.
OK, I'll give it a whirl.
Both range checks and div-zero checks, when vectorized,
require an extra vector comparison or two (with broadcast
operands), followed by a mask-test (anyTrue). This check
can be sunk past other useful vector operations that can
proceed independently, as long nothing is committed to
memory. It seems like something a CPU could tolerate.
— John
More information about the panama-dev
mailing list