IndexOutOfBoundsException with unset mask lanes
Joshua Zhu (Arm Technology China)
Joshua.Zhu at arm.com
Thu Mar 7 09:27:14 UTC 2019
Please help review this change.
This patch is used to fix IndexOutOfBoundsException for fromArray/intoArray/gather/scatter API with unset mask lanes.
Also enable exception testing.
To align with API doc, IndexOutOfBoundsException should only be thrown for any illegal vector lane index where the mask at lane is set.
This patch has been verified by testing.
P.S. There's another issue I would like to raise here.
When I was working on this patch, I found that currently scatter API may throw IndexOutOfBoundsException in the middle and result in partial storing.
For example, Byte/ShortVector's scatter API with mask  (without IndexMap vectorization).
Should we leave this behavior undefined or make the API performs like an atomic action,
i.e. make sure no lane of data store happens, while an OOB exception thrown?
I think we can choose to update API doc or enable index check with mask before storing.
Which way do you prefer?
More information about the panama-dev