Skip to content

Commit 6c94580

Browse files
mikabl-armPaul Sandoz
authored and
Paul Sandoz
committed
8343779: Cannot build Vector API JMH benchmarks on vectorIntrinsics branch
Reviewed-by: psandoz
1 parent a92e325 commit 6c94580

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+97
-97
lines changed

Diff for: test/jdk/jdk/incubator/vector/templates/Perf-Scalar-header.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ public class $Type$Scalar extends AbstractVectorBenchmark {
7373
mt = fillMask(size, i -> true);
7474
rms = fillMask(size, i -> false);
7575

76-
ss = fillInt(size, i -> RANDOM.nextInt(Math.max(i,1)));
76+
ss = fillInt(size, i -> RAND.nextInt(Math.max(i,1)));
7777
}
7878

7979
final IntFunction<$type$[]> fa = vl -> as;

Diff for: test/jdk/jdk/incubator/vector/templates/Perf-header.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -109,7 +109,7 @@ public class $vectorbenchtype$ extends AbstractVectorBenchmark {
109109
mt = fillMask(size, i -> true);
110110
rm = fillMask(size, i -> false);
111111

112-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
112+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
113113
}
114114

115115
final IntFunction<$type$[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/bigdata/VectorDistance.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -65,11 +65,11 @@ public static float[] parseArray(byte[] input) {
6565
int l;
6666
l = input[i << 2];
6767
l &= 0xff;
68-
l |= ((long) input[(i << 2) + 1] << 8);
68+
l |= ((int) input[(i << 2) + 1] << 8);
6969
l &= 0xffff;
70-
l |= ((long) input[(i << 2) + 2] << 16);
70+
l |= ((int) input[(i << 2) + 2] << 16);
7171
l &= 0xffffff;
72-
l |= ((long) input[(i << 2) + 3] << 24);
72+
l |= ((int) input[(i << 2) + 3] << 24);
7373
floatArr[i] = Float.intBitsToFloat(l);
7474
}
7575
return floatArr;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/crypto/ChaChaBench.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -365,7 +365,7 @@ private static byte[] hexStringToByteArray(String str) {
365365
for (int i = 0; i < result.length; i++) {
366366
result[i] = (byte) Character.digit(str.charAt(2 * i), 16);
367367
result[i] <<= 4;
368-
result[i] += Character.digit(str.charAt(2 * i + 1), 16);
368+
result[i] += (byte) Character.digit(str.charAt(2 * i + 1), 16);
369369
}
370370
return result;
371371
}

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/crypto/Poly1305Bench.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -168,23 +168,23 @@ private static void toByteArray(long v0, long v1, long v2, long v3,
168168
v0 >>= 8;
169169
dst[3] = (byte) v0;
170170

171-
dst[3] += (v1 & 0x3F) << 2;
171+
dst[3] += (byte) ((v1 & 0x3F) << 2);
172172
v1 >>= 6;
173173
dst[4] = (byte) v1;
174174
v1 >>= 8;
175175
dst[5] = (byte) v1;
176176
v1 >>= 8;
177177
dst[6] = (byte) v1;
178178

179-
dst[6] += (v2 & 0xF) << 4;
179+
dst[6] += (byte) ((v2 & 0xF) << 4);
180180
v2 >>= 4;
181181
dst[7] = (byte) v2;
182182
v2 >>= 8;
183183
dst[8] = (byte) v2;
184184
v2 >>= 8;
185185
dst[9] = (byte) v2;
186186

187-
dst[9] += (v3 & 0x3) << 6;
187+
dst[9] += (byte) ((v3 & 0x3) << 6);
188188
v3 >>= 2;
189189
dst[10] = (byte) v3;
190190
v3 >>= 8;
@@ -266,9 +266,9 @@ public void computeTag(byte[] key, byte[] msg, byte[] out) {
266266
keyBytes[7] &= 15;
267267
keyBytes[11] &= 15;
268268
keyBytes[15] &= 15;
269-
keyBytes[4] &= 252;
270-
keyBytes[8] &= 252;
271-
keyBytes[12] &= 252;
269+
keyBytes[4] &= (byte) 252;
270+
keyBytes[8] &= (byte) 252;
271+
keyBytes[12] &= (byte) 252;
272272

273273
// Create IntegerModuloP elements from the r and s values
274274
int[][] r = new int[vectorWidth][];
@@ -514,9 +514,9 @@ public void computeTag(byte[] key, byte[] msg, byte[] out) {
514514
private static byte[] hexStringToByteArray(String str) {
515515
byte[] result = new byte[str.length() / 2];
516516
for (int i = 0; i < result.length; i++) {
517-
result[i] = (byte) Character.digit(str.charAt(2 * i), 16);
517+
result[i] = (byte) (Character.digit(str.charAt(2 * i), 16));
518518
result[i] <<= 4;
519-
result[i] += Character.digit(str.charAt(2 * i + 1), 16);
519+
result[i] += (byte) (Character.digit(str.charAt(2 * i + 1), 16));
520520
}
521521
return result;
522522
}

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/AbstractVectorBenchmark.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
2929
import java.util.function.IntFunction;
3030

3131
public class AbstractVectorBenchmark {
32-
static final Random RANDOM = new Random(Integer.getInteger("jdk.incubator.vector.random-seed", 1337));
32+
static final Random RAND = new Random(Integer.getInteger("jdk.incubator.vector.random-seed", 1337));
3333

3434
static final VectorSpecies<Byte> B64 = ByteVector.SPECIES_64;
3535
static final VectorSpecies<Byte> B128 = ByteVector.SPECIES_128;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Byte128Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public void init() {
101101
mt = fillMask(size, i -> true);
102102
rm = fillMask(size, i -> false);
103103

104-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
104+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
105105
}
106106

107107
final IntFunction<byte[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Byte256Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public void init() {
101101
mt = fillMask(size, i -> true);
102102
rm = fillMask(size, i -> false);
103103

104-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
104+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
105105
}
106106

107107
final IntFunction<byte[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Byte512Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public void init() {
101101
mt = fillMask(size, i -> true);
102102
rm = fillMask(size, i -> false);
103103

104-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
104+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
105105
}
106106

107107
final IntFunction<byte[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Byte64Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public void init() {
101101
mt = fillMask(size, i -> true);
102102
rm = fillMask(size, i -> false);
103103

104-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
104+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
105105
}
106106

107107
final IntFunction<byte[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/ByteMaxVector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public void init() {
101101
mt = fillMask(size, i -> true);
102102
rm = fillMask(size, i -> false);
103103

104-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
104+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
105105
}
106106

107107
final IntFunction<byte[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/ByteScalar.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ public void init() {
7171
mt = fillMask(size, i -> true);
7272
rms = fillMask(size, i -> false);
7373

74-
ss = fillInt(size, i -> RANDOM.nextInt(Math.max(i,1)));
74+
ss = fillInt(size, i -> RAND.nextInt(Math.max(i,1)));
7575
}
7676

7777
final IntFunction<byte[]> fa = vl -> as;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Double128Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<double[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Double256Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<double[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Double512Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<double[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Double64Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<double[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/DoubleMaxVector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<double[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/DoubleScalar.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@ public void init() {
7070
mt = fillMask(size, i -> true);
7171
rms = fillMask(size, i -> false);
7272

73-
ss = fillInt(size, i -> RANDOM.nextInt(Math.max(i,1)));
73+
ss = fillInt(size, i -> RAND.nextInt(Math.max(i,1)));
7474
}
7575

7676
final IntFunction<double[]> fa = vl -> as;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Float128Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<float[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Float256Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<float[]> fa = vl -> a;

Diff for: test/micro/org/openjdk/bench/jdk/incubator/vector/operation/Float512Vector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ public void init() {
8585
mt = fillMask(size, i -> true);
8686
rm = fillMask(size, i -> false);
8787

88-
s = fillInt(size, i -> RANDOM.nextInt(SPECIES.length()));
88+
s = fillInt(size, i -> RAND.nextInt(SPECIES.length()));
8989
}
9090

9191
final IntFunction<float[]> fa = vl -> a;

0 commit comments

Comments
 (0)