[vector] RFR 8221816: IndexOutOfBoundsException for fromArray/intoArray with unset mask lanes - was: RE: IndexOutOfBoundsException with unset mask lanes

Joshua Zhu (Arm Technology China) Joshua.Zhu at arm.com
Mon Jun 3 09:17:58 UTC 2019


Hi John,

Thanks a lot for your detailed comments.

> P.S. What do you ARM experts think about having v.div(w) throw
> ArithmeticException when any lane in w is zero, for non-float types only?  I
> know ARM forces a non-exceptional result there, but that's not Java-like at all.
> In general, are we comfortable with adding exception exits to vector
> operations, like divide-by-zero and AIOOB (array index out of bounds) on
> scatter/gather?

Yes, IMO ArithmeticException should be thrown although zero is defined as the result of 1/0 in SVE.
Just as discussed in threads of "what about div?", I agree do "v.equal(broadcast(0)).anyTrue() for non-masked div" or
"v.equal(broadcast(0)).and(m).anyTrue() for masked div" is a good solution to div-zero check.

Best Regards,
Joshua


More information about the panama-dev mailing list