8269246: Scoped ByteBuffer vector access

Reviewed-by: mcimadamore
This commit is contained in:
Paul Sandoz 2021-06-24 16:02:22 +00:00
parent 3fb28d3074
commit 63bcd3336e
42 changed files with 360 additions and 269 deletions

View File

@ -31,10 +31,15 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import java.lang.ref.Reference; import java.lang.ref.Reference;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import jdk.internal.access.JavaNioAccess;
import jdk.internal.access.SharedSecrets; import jdk.internal.access.SharedSecrets;
import jdk.internal.access.foreign.MemorySegmentProxy;
import jdk.internal.util.ArraysSupport; import jdk.internal.util.ArraysSupport;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport;
/** /**
@ -334,6 +339,126 @@ public class ScopedMemoryAccess {
Reference.reachabilityFence(scope); Reference.reachabilityFence(scope);
} }
} }
// ByteBuffer vector access ops
// Buffer access constants, to be initalized when required.
// Avoids a null value for NIO_ACCESS, due to class initalization dependencies
static final class BufferAccess {
// Buffer.address
static final long BUFFER_ADDRESS
= UNSAFE.objectFieldOffset(Buffer.class, "address");
// ByteBuffer.hb
static final long BYTE_BUFFER_HB
= UNSAFE.objectFieldOffset(ByteBuffer.class, "hb");
@ForceInline
static Object bufferBase(ByteBuffer bb) {
return UNSAFE.getReference(bb, BYTE_BUFFER_HB);
}
@ForceInline
static long bufferAddress(ByteBuffer bb, long offset) {
return UNSAFE.getLong(bb, BUFFER_ADDRESS) + offset;
}
static final JavaNioAccess NIO_ACCESS = SharedSecrets.getJavaNioAccess();
@ForceInline
static ScopedMemoryAccess.Scope scope(ByteBuffer bb) {
MemorySegmentProxy segmentProxy = NIO_ACCESS.bufferSegment(bb);
return segmentProxy != null ?
segmentProxy.scope() : null;
}
}
@ForceInline
public static
<V extends VectorSupport.Vector<E>, E, S extends VectorSupport.VectorSpecies<E>>
V loadFromByteBuffer(Class<? extends V> vmClass, Class<E> e, int length,
ByteBuffer bb, int offset,
S s,
VectorSupport.LoadOperation<ByteBuffer, V, E, S> defaultImpl) {
try {
return loadFromByteBufferScoped(
BufferAccess.scope(bb),
vmClass, e, length,
bb, offset,
s,
defaultImpl);
} catch (ScopedMemoryAccess.Scope.ScopedAccessError ex) {
throw new IllegalStateException("This segment is already closed");
}
}
@Scoped
@ForceInline
private static
<V extends VectorSupport.Vector<E>, E, S extends VectorSupport.VectorSpecies<E>>
V loadFromByteBufferScoped(ScopedMemoryAccess.Scope scope,
Class<? extends V> vmClass, Class<E> e, int length,
ByteBuffer bb, int offset,
S s,
VectorSupport.LoadOperation<ByteBuffer, V, E, S> defaultImpl) {
try {
if (scope != null) {
scope.checkValidState();
}
return VectorSupport.load(vmClass, e, length,
BufferAccess.bufferBase(bb), BufferAccess.bufferAddress(bb, offset),
bb, offset, s,
defaultImpl);
} finally {
Reference.reachabilityFence(scope);
}
}
@ForceInline
public static
<V extends VectorSupport.Vector<E>, E>
void storeIntoByteBuffer(Class<? extends V> vmClass, Class<E> e, int length,
V v,
ByteBuffer bb, int offset,
VectorSupport.StoreVectorOperation<ByteBuffer, V> defaultImpl) {
try {
storeIntoByteBufferScoped(
BufferAccess.scope(bb),
vmClass, e, length,
v,
bb, offset,
defaultImpl);
} catch (ScopedMemoryAccess.Scope.ScopedAccessError ex) {
throw new IllegalStateException("This segment is already closed");
}
}
@Scoped
@ForceInline
private static
<V extends VectorSupport.Vector<E>, E>
void storeIntoByteBufferScoped(ScopedMemoryAccess.Scope scope,
Class<? extends V> vmClass, Class<E> e, int length,
V v,
ByteBuffer bb, int offset,
VectorSupport.StoreVectorOperation<ByteBuffer, V> defaultImpl) {
try {
if (scope != null) {
scope.checkValidState();
}
VectorSupport.store(vmClass, e, length,
BufferAccess.bufferBase(bb), BufferAccess.bufferAddress(bb, offset),
v,
bb, offset,
defaultImpl);
} finally {
Reference.reachabilityFence(scope);
}
}
// typed-ops here // typed-ops here
// Note: all the accessor methods defined below take advantage of argument type profiling // Note: all the accessor methods defined below take advantage of argument type profiling

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -3562,9 +3563,8 @@ public abstract class ByteVector extends AbstractVector<Byte> {
final final
ByteVector fromByteBuffer0Template(ByteBuffer bb, int offset) { ByteVector fromByteBuffer0Template(ByteBuffer bb, int offset) {
ByteSpecies vsp = vspecies(); ByteSpecies vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -3613,9 +3613,8 @@ public abstract class ByteVector extends AbstractVector<Byte> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
ByteSpecies vsp = vspecies(); ByteSpecies vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -3173,9 +3174,8 @@ public abstract class DoubleVector extends AbstractVector<Double> {
final final
DoubleVector fromByteBuffer0Template(ByteBuffer bb, int offset) { DoubleVector fromByteBuffer0Template(ByteBuffer bb, int offset) {
DoubleSpecies vsp = vspecies(); DoubleSpecies vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -3224,9 +3224,8 @@ public abstract class DoubleVector extends AbstractVector<Double> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
DoubleSpecies vsp = vspecies(); DoubleSpecies vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -3160,9 +3161,8 @@ public abstract class FloatVector extends AbstractVector<Float> {
final final
FloatVector fromByteBuffer0Template(ByteBuffer bb, int offset) { FloatVector fromByteBuffer0Template(ByteBuffer bb, int offset) {
FloatSpecies vsp = vspecies(); FloatSpecies vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -3211,9 +3211,8 @@ public abstract class FloatVector extends AbstractVector<Float> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
FloatSpecies vsp = vspecies(); FloatSpecies vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -3269,9 +3270,8 @@ public abstract class IntVector extends AbstractVector<Integer> {
final final
IntVector fromByteBuffer0Template(ByteBuffer bb, int offset) { IntVector fromByteBuffer0Template(ByteBuffer bb, int offset) {
IntSpecies vsp = vspecies(); IntSpecies vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -3320,9 +3320,8 @@ public abstract class IntVector extends AbstractVector<Integer> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
IntSpecies vsp = vspecies(); IntSpecies vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -3172,9 +3173,8 @@ public abstract class LongVector extends AbstractVector<Long> {
final final
LongVector fromByteBuffer0Template(ByteBuffer bb, int offset) { LongVector fromByteBuffer0Template(ByteBuffer bb, int offset) {
LongSpecies vsp = vspecies(); LongSpecies vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -3223,9 +3223,8 @@ public abstract class LongVector extends AbstractVector<Long> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
LongSpecies vsp = vspecies(); LongSpecies vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -3549,9 +3550,8 @@ public abstract class ShortVector extends AbstractVector<Short> {
final final
ShortVector fromByteBuffer0Template(ByteBuffer bb, int offset) { ShortVector fromByteBuffer0Template(ByteBuffer bb, int offset) {
ShortSpecies vsp = vspecies(); ShortSpecies vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -3600,9 +3600,8 @@ public abstract class ShortVector extends AbstractVector<Short> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
ShortSpecies vsp = vspecies(); ShortSpecies vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -24,33 +24,11 @@
*/ */
package jdk.incubator.vector; package jdk.incubator.vector;
import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.util.Objects; import java.util.Objects;
/*non-public*/ class VectorIntrinsics { /*non-public*/ class VectorIntrinsics {
static final Unsafe U = Unsafe.getUnsafe();
static final long BUFFER_ADDRESS
= U.objectFieldOffset(Buffer.class, "address");
// Buffer.limit
static final long BUFFER_LIMIT
= U.objectFieldOffset(Buffer.class, "limit");
// ByteBuffer.hb
static final long BYTE_BUFFER_HB
= U.objectFieldOffset(ByteBuffer.class, "hb");
// ByteBuffer.isReadOnly
static final long BYTE_BUFFER_IS_READ_ONLY
= U.objectFieldOffset(ByteBuffer.class, "isReadOnly");
/* ============================================================================ */
static final int VECTOR_ACCESS_OOB_CHECK = Integer.getInteger("jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK", 2); static final int VECTOR_ACCESS_OOB_CHECK = Integer.getInteger("jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK", 2);
@ForceInline @ForceInline
@ -133,18 +111,4 @@ import java.util.Objects;
return Math.floorMod(index, Math.abs(size)); return Math.floorMod(index, Math.abs(size));
} }
} }
/* ============================================================================ */
/*package-private*/
@ForceInline
static Object bufferBase(ByteBuffer bb) {
return U.getReference(bb, BYTE_BUFFER_HB);
}
/*package-private*/
@ForceInline
static long bufferAddress(ByteBuffer bb, long offset) {
return U.getLong(bb, BUFFER_ADDRESS) + offset;
}
} }

View File

@ -33,6 +33,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import jdk.internal.misc.ScopedMemoryAccess;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.vector.VectorSupport; import jdk.internal.vm.vector.VectorSupport;
@ -4517,9 +4518,8 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
final final
$abstractvectortype$ fromByteBuffer0Template(ByteBuffer bb, int offset) { $abstractvectortype$ fromByteBuffer0Template(ByteBuffer bb, int offset) {
$Type$Species vsp = vspecies(); $Type$Species vsp = vspecies();
return VectorSupport.load( return ScopedMemoryAccess.loadFromByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
bb, offset, vsp, bb, offset, vsp,
(buf, off, s) -> { (buf, off, s) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
@ -4568,9 +4568,8 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
final final
void intoByteBuffer0(ByteBuffer bb, int offset) { void intoByteBuffer0(ByteBuffer bb, int offset) {
$Type$Species vsp = vspecies(); $Type$Species vsp = vspecies();
VectorSupport.store( ScopedMemoryAccess.storeIntoByteBuffer(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(), vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
bufferBase(bb), bufferAddress(bb, offset),
this, bb, offset, this, bb, offset,
(buf, off, v) -> { (buf, off, v) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import jdk.incubator.foreign.MemorySegment;
import jdk.incubator.foreign.ResourceScope;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.function.IntFunction;
public class AbstractVectorLoadStoreTest extends AbstractVectorTest {
static final Collection<ByteOrder> BYTE_ORDER_VALUES = Set.of(
ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN);
static final List<IntFunction<ByteBuffer>> BYTE_BUFFER_GENERATORS = List.of(
withToString("HB:RW:NE", (int s) -> {
return ByteBuffer.allocate(s)
.order(ByteOrder.nativeOrder());
}),
withToString("DB:RW:NE", (int s) -> {
return ByteBuffer.allocateDirect(s)
.order(ByteOrder.nativeOrder());
}),
withToString("MS:RW:NE", (int s) -> {
return MemorySegment.allocateNative(s, ResourceScope.newImplicitScope())
.asByteBuffer()
.order(ByteOrder.nativeOrder());
})
);
}

View File

@ -84,20 +84,6 @@ public class AbstractVectorTest {
}; };
} }
static final Collection<ByteOrder> BYTE_ORDER_VALUES = Set.of(
ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN);
static final List<IntFunction<ByteBuffer>> BYTE_BUFFER_GENERATORS = List.of(
withToString("HB:RW:NE", (int s) -> {
return ByteBuffer.allocate(s)
.order(ByteOrder.nativeOrder());
}),
withToString("DB:RW:NE", (int s) -> {
return ByteBuffer.allocateDirect(s)
.order(ByteOrder.nativeOrder());
})
);
static final List<IntFunction<boolean[]>> BOOL_ARRAY_GENERATORS = List.of( static final List<IntFunction<boolean[]>> BOOL_ARRAY_GENERATORS = List.of(
withToString("boolean[i % 2]", (int s) -> { withToString("boolean[i % 2]", (int s) -> {
return fill_boolean(s, return fill_boolean(s,

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Byte128VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Byte128VectorLoadStoreTests
* *
*/ */
@ -42,12 +42,11 @@ import org.testng.annotations.Test;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Byte128VectorLoadStoreTests extends AbstractVectorTest { public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Byte> SPECIES = static final VectorSpecies<Byte> SPECIES =
ByteVector.SPECIES_128; ByteVector.SPECIES_128;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Byte256VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Byte256VectorLoadStoreTests
* *
*/ */
@ -42,12 +42,11 @@ import org.testng.annotations.Test;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Byte256VectorLoadStoreTests extends AbstractVectorTest { public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Byte> SPECIES = static final VectorSpecies<Byte> SPECIES =
ByteVector.SPECIES_256; ByteVector.SPECIES_256;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Byte512VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Byte512VectorLoadStoreTests
* *
*/ */
@ -42,12 +42,11 @@ import org.testng.annotations.Test;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Byte512VectorLoadStoreTests extends AbstractVectorTest { public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Byte> SPECIES = static final VectorSpecies<Byte> SPECIES =
ByteVector.SPECIES_512; ByteVector.SPECIES_512;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Byte64VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Byte64VectorLoadStoreTests
* *
*/ */
@ -42,12 +42,11 @@ import org.testng.annotations.Test;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Byte64VectorLoadStoreTests extends AbstractVectorTest { public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Byte> SPECIES = static final VectorSpecies<Byte> SPECIES =
ByteVector.SPECIES_64; ByteVector.SPECIES_64;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation ByteMaxVectorLoadStoreTests * -XX:-TieredCompilation ByteMaxVectorLoadStoreTests
* *
@ -46,12 +46,11 @@ import java.lang.invoke.VarHandle;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class ByteMaxVectorLoadStoreTests extends AbstractVectorTest { public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Byte> SPECIES = static final VectorSpecies<Byte> SPECIES =
ByteVector.SPECIES_MAX; ByteVector.SPECIES_MAX;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Double128VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Double128VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Double128VectorLoadStoreTests extends AbstractVectorTest { public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Double> SPECIES = static final VectorSpecies<Double> SPECIES =
DoubleVector.SPECIES_128; DoubleVector.SPECIES_128;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Double256VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Double256VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Double256VectorLoadStoreTests extends AbstractVectorTest { public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Double> SPECIES = static final VectorSpecies<Double> SPECIES =
DoubleVector.SPECIES_256; DoubleVector.SPECIES_256;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Double512VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Double512VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Double512VectorLoadStoreTests extends AbstractVectorTest { public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Double> SPECIES = static final VectorSpecies<Double> SPECIES =
DoubleVector.SPECIES_512; DoubleVector.SPECIES_512;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Double64VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Double64VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Double64VectorLoadStoreTests extends AbstractVectorTest { public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Double> SPECIES = static final VectorSpecies<Double> SPECIES =
DoubleVector.SPECIES_64; DoubleVector.SPECIES_64;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation DoubleMaxVectorLoadStoreTests * -XX:-TieredCompilation DoubleMaxVectorLoadStoreTests
* *
@ -47,12 +47,11 @@ import java.nio.ByteBuffer;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class DoubleMaxVectorLoadStoreTests extends AbstractVectorTest { public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Double> SPECIES = static final VectorSpecies<Double> SPECIES =
DoubleVector.SPECIES_MAX; DoubleVector.SPECIES_MAX;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Float128VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Float128VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Float128VectorLoadStoreTests extends AbstractVectorTest { public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Float> SPECIES = static final VectorSpecies<Float> SPECIES =
FloatVector.SPECIES_128; FloatVector.SPECIES_128;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Float256VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Float256VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Float256VectorLoadStoreTests extends AbstractVectorTest { public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Float> SPECIES = static final VectorSpecies<Float> SPECIES =
FloatVector.SPECIES_256; FloatVector.SPECIES_256;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Float512VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Float512VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Float512VectorLoadStoreTests extends AbstractVectorTest { public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Float> SPECIES = static final VectorSpecies<Float> SPECIES =
FloatVector.SPECIES_512; FloatVector.SPECIES_512;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Float64VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Float64VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Float64VectorLoadStoreTests extends AbstractVectorTest { public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Float> SPECIES = static final VectorSpecies<Float> SPECIES =
FloatVector.SPECIES_64; FloatVector.SPECIES_64;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation FloatMaxVectorLoadStoreTests * -XX:-TieredCompilation FloatMaxVectorLoadStoreTests
* *
@ -47,12 +47,11 @@ import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class FloatMaxVectorLoadStoreTests extends AbstractVectorTest { public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Float> SPECIES = static final VectorSpecies<Float> SPECIES =
FloatVector.SPECIES_MAX; FloatVector.SPECIES_MAX;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Int128VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Int128VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Int128VectorLoadStoreTests extends AbstractVectorTest { public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Integer> SPECIES = static final VectorSpecies<Integer> SPECIES =
IntVector.SPECIES_128; IntVector.SPECIES_128;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Int256VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Int256VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Int256VectorLoadStoreTests extends AbstractVectorTest { public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Integer> SPECIES = static final VectorSpecies<Integer> SPECIES =
IntVector.SPECIES_256; IntVector.SPECIES_256;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Int512VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Int512VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Int512VectorLoadStoreTests extends AbstractVectorTest { public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Integer> SPECIES = static final VectorSpecies<Integer> SPECIES =
IntVector.SPECIES_512; IntVector.SPECIES_512;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Int64VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Int64VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Int64VectorLoadStoreTests extends AbstractVectorTest { public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Integer> SPECIES = static final VectorSpecies<Integer> SPECIES =
IntVector.SPECIES_64; IntVector.SPECIES_64;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation IntMaxVectorLoadStoreTests * -XX:-TieredCompilation IntMaxVectorLoadStoreTests
* *
@ -47,12 +47,11 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class IntMaxVectorLoadStoreTests extends AbstractVectorTest { public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Integer> SPECIES = static final VectorSpecies<Integer> SPECIES =
IntVector.SPECIES_MAX; IntVector.SPECIES_MAX;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Long128VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Long128VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer; import java.nio.LongBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Long128VectorLoadStoreTests extends AbstractVectorTest { public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Long> SPECIES = static final VectorSpecies<Long> SPECIES =
LongVector.SPECIES_128; LongVector.SPECIES_128;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Long256VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Long256VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer; import java.nio.LongBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Long256VectorLoadStoreTests extends AbstractVectorTest { public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Long> SPECIES = static final VectorSpecies<Long> SPECIES =
LongVector.SPECIES_256; LongVector.SPECIES_256;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Long512VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Long512VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer; import java.nio.LongBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Long512VectorLoadStoreTests extends AbstractVectorTest { public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Long> SPECIES = static final VectorSpecies<Long> SPECIES =
LongVector.SPECIES_512; LongVector.SPECIES_512;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Long64VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Long64VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer; import java.nio.LongBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Long64VectorLoadStoreTests extends AbstractVectorTest { public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Long> SPECIES = static final VectorSpecies<Long> SPECIES =
LongVector.SPECIES_64; LongVector.SPECIES_64;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation LongMaxVectorLoadStoreTests * -XX:-TieredCompilation LongMaxVectorLoadStoreTests
* *
@ -47,12 +47,11 @@ import java.nio.ByteBuffer;
import java.nio.LongBuffer; import java.nio.LongBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class LongMaxVectorLoadStoreTests extends AbstractVectorTest { public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Long> SPECIES = static final VectorSpecies<Long> SPECIES =
LongVector.SPECIES_MAX; LongVector.SPECIES_MAX;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Short128VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Short128VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.ShortBuffer; import java.nio.ShortBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Short128VectorLoadStoreTests extends AbstractVectorTest { public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Short> SPECIES = static final VectorSpecies<Short> SPECIES =
ShortVector.SPECIES_128; ShortVector.SPECIES_128;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Short256VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Short256VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.ShortBuffer; import java.nio.ShortBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Short256VectorLoadStoreTests extends AbstractVectorTest { public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Short> SPECIES = static final VectorSpecies<Short> SPECIES =
ShortVector.SPECIES_256; ShortVector.SPECIES_256;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Short512VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Short512VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.ShortBuffer; import java.nio.ShortBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Short512VectorLoadStoreTests extends AbstractVectorTest { public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Short> SPECIES = static final VectorSpecies<Short> SPECIES =
ShortVector.SPECIES_512; ShortVector.SPECIES_512;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm -XX:-TieredCompilation Short64VectorLoadStoreTests * @run testng/othervm -XX:-TieredCompilation Short64VectorLoadStoreTests
* *
*/ */
@ -43,12 +43,11 @@ import java.nio.ByteBuffer;
import java.nio.ShortBuffer; import java.nio.ShortBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class Short64VectorLoadStoreTests extends AbstractVectorTest { public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Short> SPECIES = static final VectorSpecies<Short> SPECIES =
ShortVector.SPECIES_64; ShortVector.SPECIES_64;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation ShortMaxVectorLoadStoreTests * -XX:-TieredCompilation ShortMaxVectorLoadStoreTests
* *
@ -47,12 +47,11 @@ import java.nio.ByteBuffer;
import java.nio.ShortBuffer; import java.nio.ShortBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class ShortMaxVectorLoadStoreTests extends AbstractVectorTest { public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest {
static final VectorSpecies<Short> SPECIES = static final VectorSpecies<Short> SPECIES =
ShortVector.SPECIES_MAX; ShortVector.SPECIES_MAX;

View File

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @modules jdk.incubator.foreign jdk.incubator.vector java.base/jdk.internal.vm.annotation
#if[MaxBit] #if[MaxBit]
* @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED
* -XX:-TieredCompilation $vectorteststype$ * -XX:-TieredCompilation $vectorteststype$
@ -57,12 +57,11 @@ import java.nio.$Type$Buffer;
#end[!byte] #end[!byte]
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException; import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.*; import java.util.function.*;
@Test @Test
public class $vectorteststype$ extends AbstractVectorTest { public class $vectorteststype$ extends AbstractVectorLoadStoreTest {
#if[MaxBit] #if[MaxBit]
static final VectorSpecies<$Wideboxtype$> SPECIES = static final VectorSpecies<$Wideboxtype$> SPECIES =
$Type$Vector.SPECIES_MAX; $Type$Vector.SPECIES_MAX;