-
Bug
-
Resolution: Fixed
-
P3
-
18, 19, 20, 21, 22
-
b05
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8312885 | 21.0.1 | Tobias Hartmann | P3 | Resolved | Fixed | b04 |
JDK-8311558 | 21 | Tobias Hartmann | P3 | Resolved | Fixed | b31 |
Following test shows incorrect results with -XX:-TieredCompilation, but works fine with -XX:TieredStopAtLevel=1
IPROMPT>java --add-modules=jdk.incubator.vector -cp . shuffle
WARNING: Using incubator modules: jdk.incubator.vector
[res] 30378688 [time] 35 ms
IPROMPT>java --add-modules=jdk.incubator.vector -XX:TieredStopAtLevel=1 -cp . shuffle
WARNING: Using incubator modules: jdk.incubator.vector
[res] 4096 [time] 1351 ms
------------------------------------------------------------------------------------------
import jdk.incubator.vector.*;
public class shuffle {
public static int micro(int i) {
return ShortVector.SPECIES_512.iotaShuffle(i, 1, false)
.toVector()
.reinterpretAsShorts()
.reduceLanes(VectorOperators.ADD);
}
public static void main(String [] args) {
int res = 0;
for (int i = 0; i < 10000; i++) {
res += micro(i & 31);
}
long t1 = System.currentTimeMillis();
for (int i = 0; i < 1000000; i++) {
res += micro(i & 31);
}
long t2 = System.currentTimeMillis();
System.out.println("[res] " + res + " [time] " + (t2-t1) + " ms");
}
}
--------------------------------------------------------------------------------------------
Looks like the problem with the comparison predicate in iotaShuffle inline expander.
IPROMPT>java --add-modules=jdk.incubator.vector -cp . shuffle
WARNING: Using incubator modules: jdk.incubator.vector
[res] 30378688 [time] 35 ms
IPROMPT>java --add-modules=jdk.incubator.vector -XX:TieredStopAtLevel=1 -cp . shuffle
WARNING: Using incubator modules: jdk.incubator.vector
[res] 4096 [time] 1351 ms
------------------------------------------------------------------------------------------
import jdk.incubator.vector.*;
public class shuffle {
public static int micro(int i) {
return ShortVector.SPECIES_512.iotaShuffle(i, 1, false)
.toVector()
.reinterpretAsShorts()
.reduceLanes(VectorOperators.ADD);
}
public static void main(String [] args) {
int res = 0;
for (int i = 0; i < 10000; i++) {
res += micro(i & 31);
}
long t1 = System.currentTimeMillis();
for (int i = 0; i < 1000000; i++) {
res += micro(i & 31);
}
long t2 = System.currentTimeMillis();
System.out.println("[res] " + res + " [time] " + (t2-t1) + " ms");
}
}
--------------------------------------------------------------------------------------------
Looks like the problem with the comparison predicate in iotaShuffle inline expander.
- backported by
-
JDK-8311558 Incorrect result with unwrapped iotaShuffle.
-
- Resolved
-
-
JDK-8312885 Incorrect result with unwrapped iotaShuffle.
-
- Resolved
-
- relates to
-
JDK-8304450 [vectorapi] Refactor VectorShuffle implementation
-
- Resolved
-
-
JDK-8311305 Enable intrinsification for non-constant or out-of-range unwrapped shuffle Iota
-
- Open
-
- links to
-
Commit openjdk/jdk21/0ee169f1
-
Commit openjdk/jdk/d6578bff
-
Review openjdk/jdk21/95
-
Review(master) openjdk/jdk/14700
(3 links to)