[vector] 1-byte and 2-byte vectors
Lupusoru, Razvan A
razvan.a.lupusoru at intel.com
Thu Mar 15 23:18:18 UTC 2018
Hi everyone,
Currently masks are represented as vectors in C2 IR. That is because type/size combination is a property that is also true of masks. However, there is a nuance which is related to the matcher file support for vectors. Namely, for x86, the minimum vector size supported is 4 bytes (aka Matcher::min_vector_size returns 4). I am not sure why this is the case but it appears that it is likely related to fact that VecS represents 4 bytes. Anyway, on loading of masks (unboxing) and storing of masks (boxing), it is possible to have 1-byte and 2-byte vectors because masks are stored as arrays of booleans. This affects masks for Float64, Int64, Double64, Long64, Double128, and Long128.
Please see attached patch which gets rid of this limitation. In a previous patch I have added .ad file entries for Load and Store of 1-byte and 2-byte vectors. And this new patch simply says that min_vector_size is 1. And in order to keep changes minimal, I also provide VecS as the register appropriate for these vectors. I was careful to not break vectorizer by still rejecting cases that are less than 4 bytes (by adding new method to Matcher). For all other architectures minimum remains same as before.
Anyway, I wanted to get some feedback or see if there are any other suggestions.
http://cr.openjdk.java.net/~rlupusoru/panama/webrev_1bytemasks_00/
This approach prevented the following invasive changes:
* Adding a new internal type to keep track of masks (TypeMask)
* Adding a new register type
* Transferring burden of memory interaction to nodes other than LoadVector and StoreVector
Thanks,
Razvan
More information about the panama-dev
mailing list