RFR: 8287289: Gather/Scatter with Index Vector [v3]
Quan Anh Mai
qamai at openjdk.org
Tue Apr 11 04:23:59 UTC 2023
On Tue, 11 Apr 2023 03:14:57 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - remove memory segment support
>> - load store from memory segment
>
> src/hotspot/share/opto/vectorIntrinsics.cpp line 1417:
>
>> 1415: const TypeInstPtr* idx_vector_klass = gvn().type(argument(4))->isa_instptr();
>> 1416: const TypeInstPtr* idx_elem_klass = gvn().type(argument(5))->isa_instptr();
>> 1417: const TypeLong* scale_type = gvn().type(argument(10))->isa_long();
>
> Can we caculate the scale value from the `elem_bt` instead of adding such a constant argument?
This is a provision for support of memory segment access where offsets are not scaled.
> src/hotspot/share/opto/vectornode.hpp line 893:
>
>> 891: : GatherNode(c, mem, adr, at, vt, indices, scale) {
>> 892: assert(indices->bottom_type()->is_vect()->element_basic_type() == T_LONG, "");
>> 893: }
>
> We can also get the index type info from the index vector. So is it possible that we use a single node for the gather op, and do the different codegen in ad files based on the index element type? The same to the scatter op.
I'm not sure that all architectures will support 32-bit indices and 64-bit indices similarly. So I think split them make it easier querying for backend support. In x86 a 64-bit index gather support depends on the vector length while 32-bit one depends on the vector length in byte.
> test/hotspot/jtreg/compiler/vectorapi/VectorGatherScatterTest.java line 45:
>
>> 43: * @key randomness
>> 44: * @library /test/lib /
>> 45: * @requires vm.cpu.features ~= ".*sve.*" & (vm.opt.MaxVectorSize == "null" | vm.opt.MaxVectorSize >= 16)
>
> We have to make sure this test is run with "MaxVectorSize >= 16", or following code will throw exception due to no vector shape maps (e.g. `32-bit/8-byte`):
>
> private static final VectorSpecies<Float> F_SPECIES =
> VectorSpecies.of(float.class, VectorShape.forBitSize(L_SPECIES.vectorBitSize() / 2));
>
> We added the this requirement in case people run the tests with "-XX:MaxVectorSize=8".
Got it let me add that back
-------------
PR Review Comment: https://git.openjdk.org/panama-vector/pull/213#discussion_r1162284377
PR Review Comment: https://git.openjdk.org/panama-vector/pull/213#discussion_r1162284061
PR Review Comment: https://git.openjdk.org/panama-vector/pull/213#discussion_r1162284509
More information about the panama-dev
mailing list