-
Enhancement
-
Resolution: Fixed
-
P4
-
23, 24, 25
-
b14
This came up in:
https://mail.openjdk.org/pipermail/panama-dev/2024-March/020327.html
"But then why does this one:
public void scalarSegmentArray(Data state) {
final MemorySegment input = state.inputSegment;
final double[] output = state.outputArray;
for(int i = 0; i < SIZE; i++) {
output[i] += input.getAtIndex(JAVA_DOUBLE, i);
}
}
not vectorize? input and output can't overlap because one is off heap
and the other is on heap. It seems for doubles the MemorySegment API
reads a double in 2 steps: use getLongUnaligned() and then convert the
result to double with Double.longBitsToDouble(). The vectorizer doesn't
support vectorization of that long to double move."
"MemorySegment reads double in the same way as other (pre-existing)
VarHandles - e.g. as longs which are then converted to doubles (w/o
using Unsafe::getDouble directly)."
"I prefer to see vectorizer handling "MoveX2Y (LoadX mem)"
=> "VectorReinterpret (LoadVector mem)" well and then introduce rules to
strength-reduce it to mismatched access."
https://mail.openjdk.org/pipermail/panama-dev/2024-March/020327.html
"But then why does this one:
public void scalarSegmentArray(Data state) {
final MemorySegment input = state.inputSegment;
final double[] output = state.outputArray;
for(int i = 0; i < SIZE; i++) {
output[i] += input.getAtIndex(JAVA_DOUBLE, i);
}
}
not vectorize? input and output can't overlap because one is off heap
and the other is on heap. It seems for doubles the MemorySegment API
reads a double in 2 steps: use getLongUnaligned() and then convert the
result to double with Double.longBitsToDouble(). The vectorizer doesn't
support vectorization of that long to double move."
"MemorySegment reads double in the same way as other (pre-existing)
VarHandles - e.g. as longs which are then converted to doubles (w/o
using Unsafe::getDouble directly)."
"I prefer to see vectorizer handling "MoveX2Y (LoadX mem)"
=> "VectorReinterpret (LoadVector mem)" well and then introduce rules to
strength-reduce it to mismatched access."
- causes
-
JDK-8366845 C2 SuperWord: wrong VectorCast after VectorReinterpret with swapped src/dst type
-
- Resolved
-
- relates to
-
JDK-8366531 Add vector size checks for IRNode.VECTOR_REINTERPRET
-
- Open
-
-
JDK-8366532 Add vector size checks for IRNode.STORE_VECTOR
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/8c4090c2
-
Review(master) openjdk/jdk/26457