On Sat, 16 Oct 2021 00:56:14 GMT, Paul Sandoz <psan...@openjdk.org> wrote:
>> This PR improves the performance of vector operations that accept masks on >> architectures that support masking in hardware, specifically Intel AVX512 >> and ARM SVE. >> >> On architectures that do not support masking in hardware the same technique >> as before is applied to most operations, specifically composition using >> blend. >> >> Masked loads/stores are a special form of masked operation that require >> additional care to ensure out-of-bounds access throw exceptions. The range >> checking has not been fully optimized and will require further work. >> >> No API enhancements were required and only a few additional tests were >> needed. > > Paul Sandoz has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains seven commits: > > - Merge branch 'master' into JDK-8271515-vector-api > - Apply patch from https://github.com/openjdk/panama-vector/pull/152 > - Apply patch from https://github.com/openjdk/panama-vector/pull/142 > - Apply patch from https://github.com/openjdk/panama-vector/pull/139 > - Apply patch from https://github.com/openjdk/panama-vector/pull/151 > - Add new files. > - 8271515: Integration of JEP 417: Vector API (Third Incubator) src/hotspot/share/utilities/globalDefinitions.hpp line 36: > 34: > 35: #include COMPILER_HEADER(utilities/globalDefinitions) > 36: #include "utilities/globalDefinitions_vecApi.hpp" This change is not needed. src/hotspot/share/utilities/globalDefinitions_vecApi.hpp line 29: > 27: // the intent of this file to provide a header that can be included in .s > files. > 28: > 29: #ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_VECAPI_HPP The file src/hotspot/share/utilities/globalDefinitions_vecApi.hpp is not needed. src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java line 67: > 65: > 66: @Override > 67: public boolean laneIsSet(int i) { Missing ForceInline. src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java line 278: > 276: @Override > 277: @ForceInline > 278: public Byte128Vector lanewise(Unary op, VectorMask<Byte> m) { Should this method be final as well? src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java line 290: > 288: @Override > 289: @ForceInline > 290: public Byte128Vector lanewise(Binary op, Vector<Byte> v, > VectorMask<Byte> m) { Should this method be final as well? src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java line 313: > 311: public final > 312: Byte128Vector > 313: lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) { For unary and binary operator above, we use VectorOperators.Unary and VectorOperators.Binary. Should we use VectorOperators.Ternary here as well then? src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java line 321: > 319: public final > 320: Byte128Vector > 321: lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, > VectorMask<Byte> m) { Should we use VectorOperators.Ternary here? src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java line 731: > 729: @Override > 730: @ForceInline > 731: public long toLong() { Should this and other mask operation methods be final methods? src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java line 603: > 601: if (opKind(op, VO_SPECIAL)) { > 602: if (op == ZOMO) { > 603: return blend(broadcast(-1), compare(NE, 0, m)); This doesn't look correct. The lanes where mask is false should get the original lane value in this vector. ------------- PR: https://git.openjdk.java.net/jdk/pull/5873