From 1ae851387f881263ccc6aeace5afdd0f49d41d33 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Fri, 2 Feb 2024 16:53:10 +0000 Subject: [PATCH] 8324858: [vectorapi] Bounds checking issues when accessing memory segments Reviewed-by: mcimadamore, jbhateja --- .../jdk/incubator/vector/AbstractSpecies.java | 10 +--------- .../classes/jdk/incubator/vector/ByteVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/DoubleVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/FloatVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/IntVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/LongVector.java | 14 ++++++++++++-- .../classes/jdk/incubator/vector/ShortVector.java | 14 ++++++++++++-- .../jdk/incubator/vector/X-Vector.java.template | 14 ++++++++++++-- .../vector/Byte128VectorLoadStoreTests.java | 8 +++++--- .../vector/Byte256VectorLoadStoreTests.java | 8 +++++--- .../vector/Byte512VectorLoadStoreTests.java | 8 +++++--- .../vector/Byte64VectorLoadStoreTests.java | 8 +++++--- .../vector/ByteMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Double128VectorLoadStoreTests.java | 8 +++++--- .../vector/Double256VectorLoadStoreTests.java | 8 +++++--- .../vector/Double512VectorLoadStoreTests.java | 8 +++++--- .../vector/Double64VectorLoadStoreTests.java | 8 +++++--- .../vector/DoubleMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Float128VectorLoadStoreTests.java | 8 +++++--- .../vector/Float256VectorLoadStoreTests.java | 8 +++++--- .../vector/Float512VectorLoadStoreTests.java | 8 +++++--- .../vector/Float64VectorLoadStoreTests.java | 8 +++++--- .../vector/FloatMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Int128VectorLoadStoreTests.java | 8 +++++--- .../vector/Int256VectorLoadStoreTests.java | 8 +++++--- .../vector/Int512VectorLoadStoreTests.java | 8 +++++--- .../vector/Int64VectorLoadStoreTests.java | 8 +++++--- .../vector/IntMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Long128VectorLoadStoreTests.java | 8 +++++--- .../vector/Long256VectorLoadStoreTests.java | 8 +++++--- .../vector/Long512VectorLoadStoreTests.java | 8 +++++--- .../vector/Long64VectorLoadStoreTests.java | 8 +++++--- .../vector/LongMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/Short128VectorLoadStoreTests.java | 8 +++++--- .../vector/Short256VectorLoadStoreTests.java | 8 +++++--- .../vector/Short512VectorLoadStoreTests.java | 8 +++++--- .../vector/Short64VectorLoadStoreTests.java | 8 +++++--- .../vector/ShortMaxVectorLoadStoreTests.java | 8 +++++--- .../vector/templates/X-LoadStoreTest.java.template | 8 +++++--- 39 files changed, 240 insertions(+), 116 deletions(-) diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java index fac0012e646..0ff4830ded5 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -360,14 +360,6 @@ abstract class AbstractSpecies extends jdk.internal.vm.vector.VectorSupport.V return dummyVector().iotaShuffle(start, step, wrap); } - @ForceInline - @Override - public final Vector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { - return dummyVector() - .fromMemorySegment0(ms, offset) - .maybeSwap(bo); - } - @Override public VectorMask loadMask(boolean[] bits, int offset) { return VectorMask.fromArray(this, bits, offset); diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java index ecd162bbdb8..4fc8626754a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -4194,11 +4194,21 @@ public abstract class ByteVector extends AbstractVector { @ForceInline @Override final public ByteVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return ByteVector .fromArray(this, (byte[]) a, offset); } + @ForceInline + @Override final + public ByteVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return ByteVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final ByteVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java index 9b3d683520e..59e67195732 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3797,11 +3797,21 @@ public abstract class DoubleVector extends AbstractVector { @ForceInline @Override final public DoubleVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return DoubleVector .fromArray(this, (double[]) a, offset); } + @ForceInline + @Override final + public DoubleVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return DoubleVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final DoubleVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java index f9bb4a9c630..45427817e3d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3747,11 +3747,21 @@ public abstract class FloatVector extends AbstractVector { @ForceInline @Override final public FloatVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return FloatVector .fromArray(this, (float[]) a, offset); } + @ForceInline + @Override final + public FloatVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return FloatVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final FloatVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java index b6e9cba0816..3317e25e73e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3903,11 +3903,21 @@ public abstract class IntVector extends AbstractVector { @ForceInline @Override final public IntVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return IntVector .fromArray(this, (int[]) a, offset); } + @ForceInline + @Override final + public IntVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return IntVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final IntVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java index 98cf154e4a7..9dd3f2eb136 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -3829,11 +3829,21 @@ public abstract class LongVector extends AbstractVector { @ForceInline @Override final public LongVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return LongVector .fromArray(this, (long[]) a, offset); } + @ForceInline + @Override final + public LongVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return LongVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final LongVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java index 0a0f359a40b..84f542f07ff 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -4188,11 +4188,21 @@ public abstract class ShortVector extends AbstractVector { @ForceInline @Override final public ShortVector fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return ShortVector .fromArray(this, (short[]) a, offset); } + @ForceInline + @Override final + public ShortVector fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return ShortVector + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final ShortVector dummyVector() { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template index 31441207a9e..ad878268404 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -5453,11 +5453,21 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @ForceInline @Override final public $abstractvectortype$ fromArray(Object a, int offset) { - // User entry point: Be careful with inputs. + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs return $abstractvectortype$ .fromArray(this, ($type$[]) a, offset); } + @ForceInline + @Override final + public $abstractvectortype$ fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) { + // User entry point + // Defer only to the equivalent method on the vector class, using the same inputs + return $abstractvectortype$ + .fromMemorySegment(this, ms, offset, bo); + } + @ForceInline @Override final $abstractvectortype$ dummyVector() { diff --git a/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java index 029c0ad5b0c..b95119678fb 100644 --- a/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java index f6368b4972e..fac54c8450c 100644 --- a/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java index 31cab63e85f..208f543855a 100644 --- a/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java index 69bdc215b8c..d486fae103c 100644 --- a/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java index 3d4272f1803..64e9b8d09dd 100644 --- a/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -255,7 +255,8 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromArray(byte[] a, int i) { - return ByteVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromArray(a, i); } @DontInline @@ -275,7 +276,8 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ByteVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ByteVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ByteVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java index f803bd85b4a..e2a18853b31 100644 --- a/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java index 5b040a4fa41..9ceb01569b4 100644 --- a/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java index c5a77fb5c9b..d997f19340e 100644 --- a/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java index db495f703ea..056fdebafcf 100644 --- a/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java index 6f5efbd89b1..69a6525ff99 100644 --- a/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -255,7 +255,8 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromArray(double[] a, int i) { - return DoubleVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromArray(a, i); } @DontInline @@ -275,7 +276,8 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static DoubleVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return DoubleVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (DoubleVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java index 79886797761..6c583c39195 100644 --- a/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java index 794e21ef648..fbb2496bd6e 100644 --- a/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java index 70e9863064b..adc9b7a89c5 100644 --- a/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java index f8ebeab7db2..e9d042c53c5 100644 --- a/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java index 61c9db74289..844942e2010 100644 --- a/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -255,7 +255,8 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromArray(float[] a, int i) { - return FloatVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromArray(a, i); } @DontInline @@ -275,7 +276,8 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static FloatVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return FloatVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (FloatVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java index 6bac67a5775..9e6d82510e1 100644 --- a/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java index 6d5212d0268..b90b0a42d10 100644 --- a/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java index fe3f55d65e5..424d4b63fcb 100644 --- a/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java index ce64e0fcd3c..e1abfdcccd9 100644 --- a/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java index f61bb34f813..3e11b366a77 100644 --- a/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -255,7 +255,8 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromArray(int[] a, int i) { - return IntVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromArray(a, i); } @DontInline @@ -275,7 +276,8 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static IntVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return IntVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (IntVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java index 5c36d67d0d6..7425e8e11e8 100644 --- a/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java index c8f932fda56..78e16570eb8 100644 --- a/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java index 825706ced04..cf41e488c44 100644 --- a/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java index ecbd349b279..532074f9d62 100644 --- a/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java index e601af509a5..462fe0dcd8c 100644 --- a/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -255,7 +255,8 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromArray(long[] a, int i) { - return LongVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromArray(a, i); } @DontInline @@ -275,7 +276,8 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static LongVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return LongVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (LongVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java index e51ccfeec19..6898bdea621 100644 --- a/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java index cbe0063168a..45044570a1a 100644 --- a/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java index eb847075ea4..fb467b6ed78 100644 --- a/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java index ad73af04b53..1b7e59bc9f9 100644 --- a/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -248,7 +248,8 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -268,7 +269,8 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java index 6412897c2c7..10621a68b6b 100644 --- a/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -255,7 +255,8 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromArray(short[] a, int i) { - return ShortVector.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromArray(a, i); } @DontInline @@ -275,7 +276,8 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { @DontInline static ShortVector fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return ShortVector.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return (ShortVector) SPECIES.fromMemorySegment(a, i, bo); } @DontInline diff --git a/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template b/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template index f9226d073b5..a2c642b7a86 100644 --- a/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template +++ b/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -268,7 +268,8 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { @DontInline static $abstractvectortype$ fromArray($type$[] a, int i) { - return $abstractvectortype$.fromArray(SPECIES, a, i); + // Tests the species method and the equivalent vector method it defers to + return ($abstractvectortype$) SPECIES.fromArray(a, i); } @DontInline @@ -288,7 +289,8 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { @DontInline static $abstractvectortype$ fromMemorySegment(MemorySegment a, int i, ByteOrder bo) { - return $abstractvectortype$.fromMemorySegment(SPECIES, a, i, bo); + // Tests the species method and the equivalent vector method it defers to + return ($abstractvectortype$) SPECIES.fromMemorySegment(a, i, bo); } @DontInline