IndexOutOfBoundsException with unset mask lanes
Joshua Zhu (Arm Technology China)
Joshua.Zhu at arm.com
Thu Mar 7 09:27:14 UTC 2019
Hi,
Please help review this change.
Webrev: http://cr.openjdk.java.net/~jzhu/vectorapi/OOB-fix.webrev.00/
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 [1] (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?
[1] https://hg.openjdk.java.net/panama/dev/file/9b51e3ed675d/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java#l1368
Best Regards,
Joshua
More information about the panama-dev
mailing list