Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Merge upstream-jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
corretto-github-robot committed Feb 8, 2024
2 parents 669abbb + 9cc260d commit abcbb60
Show file tree
Hide file tree
Showing 39 changed files with 240 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -360,14 +360,6 @@ VectorShuffle<E> iotaShuffle(int start, int step, boolean wrap) {
return dummyVector().iotaShuffle(start, step, wrap);
}

@ForceInline
@Override
public final Vector<E> fromMemorySegment(MemorySegment ms, long offset, ByteOrder bo) {
return dummyVector()
.fromMemorySegment0(ms, offset)
.maybeSwap(bo);
}

@Override
public VectorMask<E> loadMask(boolean[] bits, int offset) {
return VectorMask.fromArray(this, bits, offset);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -4194,11 +4194,21 @@ final ByteVector fromIntValues(int[] values) {
@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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -3797,11 +3797,21 @@ final DoubleVector fromIntValues(int[] values) {
@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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -3747,11 +3747,21 @@ final FloatVector fromIntValues(int[] values) {
@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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -3903,11 +3903,21 @@ final IntVector fromIntValues(int[] values) {
@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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -3829,11 +3829,21 @@ final LongVector fromIntValues(int[] values) {
@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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -4188,11 +4188,21 @@ final ShortVector fromIntValues(int[] values) {
@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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -248,7 +248,8 @@ static byte[] fill(byte[] a, ToByteF f) {

@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
Expand All @@ -268,7 +269,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask<Byte> m) {

@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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -248,7 +248,8 @@ static byte[] fill(byte[] a, ToByteF f) {

@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
Expand All @@ -268,7 +269,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask<Byte> m) {

@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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -248,7 +248,8 @@ static byte[] fill(byte[] a, ToByteF f) {

@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
Expand All @@ -268,7 +269,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask<Byte> m) {

@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
Expand Down
8 changes: 5 additions & 3 deletions test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -248,7 +248,8 @@ static byte[] fill(byte[] a, ToByteF f) {

@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
Expand All @@ -268,7 +269,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask<Byte> m) {

@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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -255,7 +255,8 @@ static byte[] fill(byte[] a, ToByteF f) {

@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
Expand All @@ -275,7 +276,8 @@ static void intoArray(ByteVector v, byte[] a, int i, VectorMask<Byte> m) {

@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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -248,7 +248,8 @@ static double[] fill(double[] a, ToDoubleF f) {

@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
Expand All @@ -268,7 +269,8 @@ static void intoArray(DoubleVector v, double[] a, int i, VectorMask<Double> m) {

@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
Expand Down
Loading

0 comments on commit abcbb60

Please sign in to comment.