Skip to content

Commit 50bf433

Browse files
author
Sandhya Viswanathan
committedJan 5, 2021
8259213: Vector conversion with part > 0 is not getting intrinsic implementation
Reviewed-by: psandoz
1 parent b7940aa commit 50bf433

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractShuffle.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, 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
@@ -120,6 +120,9 @@ public int[] toArray() {
120120

121121
@ForceInline
122122
public final VectorShuffle<E> checkIndexes() {
123+
if (VectorIntrinsics.VECTOR_ACCESS_OOB_CHECK == 0) {
124+
return this;
125+
}
123126
// FIXME: vectorize this
124127
for (int index : reorder()) {
125128
if (index < 0) {

‎src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractVector.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2021, 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
@@ -312,7 +312,7 @@ AbstractVector<F> reinterpretShapeTemplate(VectorSpecies<F> toSpecies, int part)
312312
int origin = shapeChangeOrigin(vsp, rsp, false, part);
313313
//System.out.println("*** origin = "+origin+", part = "+part+", reinterpret");
314314
if (part > 0) { // Expansion: slice first then cast.
315-
return slice(origin, vsp.zero()).convert0('X', rsp);
315+
return slice(origin).convert0('X', rsp);
316316
} else { // Contraction: cast first then unslice.
317317
return rsp.zero().slice(rsp.laneCount() - origin,
318318
convert0('X', rsp));
@@ -323,6 +323,9 @@ AbstractVector<F> reinterpretShapeTemplate(VectorSpecies<F> toSpecies, int part)
323323
@Override
324324
public abstract AbstractVector<E> slice(int origin, Vector<E> v1);
325325

326+
@Override
327+
public abstract AbstractVector<E> slice(int origin);
328+
326329
/**
327330
* This is the template for Vector::convertShape, to be
328331
* specialized by each distinct vector class.
@@ -365,7 +368,7 @@ AbstractVector<F> convertShapeTemplate(Conversion<E,F> conv, VectorSpecies<F> to
365368
int origin = shapeChangeOrigin(vsp, rsp, true, part);
366369
//System.out.println("*** origin = "+origin+", part = "+part+", lanewise");
367370
if (part > 0) { // Expansion: slice first then cast.
368-
return slice(origin, vsp.zero()).convert0(kind, rsp);
371+
return slice(origin).convert0(kind, rsp);
369372
} else { // Contraction: cast first then unslice.
370373
return rsp.zero().slice(rsp.laneCount() - origin,
371374
convert0(kind, rsp));

0 commit comments

Comments
 (0)
Please sign in to comment.