Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8265128: [REDO] Optimize Vector API slice and unslice operations #3804

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
@@ -1981,11 +1981,11 @@ public final ByteVector blend(long e,
ByteVector sliceTemplate(int origin, Vector<Byte> v1) {
ByteVector that = (ByteVector) v1;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Byte> Iota = iotaShuffle();
VectorMask<Byte> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((byte)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return ((ByteVector)v1).rearrange(Iota).blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Byte> iota = iotaShuffle();
VectorMask<Byte> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((byte)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return ((ByteVector)v1).rearrange(iota).blend(this.rearrange(iota), BlendMask);
}

/**
@@ -2011,11 +2011,11 @@ ByteVector slice(int origin,
final
@ForceInline
ByteVector sliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Byte> Iota = iotaShuffle();
VectorMask<Byte> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((byte)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Byte> iota = iotaShuffle();
VectorMask<Byte> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((byte)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

/**
@@ -2032,12 +2032,12 @@ ByteVector sliceTemplate(int origin) {
unsliceTemplate(int origin, Vector<Byte> w, int part) {
ByteVector that = (ByteVector) w;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Byte> Iota = iotaShuffle();
VectorMask<Byte> BlendMask = Iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Byte> iota = iotaShuffle();
VectorMask<Byte> BlendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
(broadcast((byte)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return ((ByteVector)w).blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return ((ByteVector)w).blend(this.rearrange(iota), BlendMask);
}

/*package-private*/
@@ -2072,12 +2072,12 @@ ByteVector sliceTemplate(int origin) {
@ForceInline
ByteVector
unsliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Byte> Iota = iotaShuffle();
VectorMask<Byte> BlendMask = Iota.toVector().compare(VectorOperators.GE,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Byte> iota = iotaShuffle();
VectorMask<Byte> BlendMask = iota.toVector().compare(VectorOperators.GE,
(broadcast((byte)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

private ArrayIndexOutOfBoundsException
@@ -1894,11 +1894,11 @@ public final DoubleVector blend(long e,
DoubleVector sliceTemplate(int origin, Vector<Double> v1) {
DoubleVector that = (DoubleVector) v1;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Double> Iota = iotaShuffle();
VectorMask<Double> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((double)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return ((DoubleVector)v1).rearrange(Iota).blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Double> iota = iotaShuffle();
VectorMask<Double> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((double)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return ((DoubleVector)v1).rearrange(iota).blend(this.rearrange(iota), BlendMask);
}

/**
@@ -1924,11 +1924,11 @@ DoubleVector slice(int origin,
final
@ForceInline
DoubleVector sliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Double> Iota = iotaShuffle();
VectorMask<Double> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((double)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Double> iota = iotaShuffle();
VectorMask<Double> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((double)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

/**
@@ -1945,12 +1945,12 @@ DoubleVector sliceTemplate(int origin) {
unsliceTemplate(int origin, Vector<Double> w, int part) {
DoubleVector that = (DoubleVector) w;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Double> Iota = iotaShuffle();
VectorMask<Double> BlendMask = Iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Double> iota = iotaShuffle();
VectorMask<Double> BlendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
(broadcast((double)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return ((DoubleVector)w).blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return ((DoubleVector)w).blend(this.rearrange(iota), BlendMask);
}

/*package-private*/
@@ -1985,12 +1985,12 @@ DoubleVector sliceTemplate(int origin) {
@ForceInline
DoubleVector
unsliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Double> Iota = iotaShuffle();
VectorMask<Double> BlendMask = Iota.toVector().compare(VectorOperators.GE,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Double> iota = iotaShuffle();
VectorMask<Double> BlendMask = iota.toVector().compare(VectorOperators.GE,
(broadcast((double)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

private ArrayIndexOutOfBoundsException
@@ -1906,11 +1906,11 @@ public final FloatVector blend(long e,
FloatVector sliceTemplate(int origin, Vector<Float> v1) {
FloatVector that = (FloatVector) v1;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Float> Iota = iotaShuffle();
VectorMask<Float> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((float)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return ((FloatVector)v1).rearrange(Iota).blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Float> iota = iotaShuffle();
VectorMask<Float> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((float)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return ((FloatVector)v1).rearrange(iota).blend(this.rearrange(iota), BlendMask);
}

/**
@@ -1936,11 +1936,11 @@ FloatVector slice(int origin,
final
@ForceInline
FloatVector sliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Float> Iota = iotaShuffle();
VectorMask<Float> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((float)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Float> iota = iotaShuffle();
VectorMask<Float> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((float)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

/**
@@ -1957,12 +1957,12 @@ FloatVector sliceTemplate(int origin) {
unsliceTemplate(int origin, Vector<Float> w, int part) {
FloatVector that = (FloatVector) w;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Float> Iota = iotaShuffle();
VectorMask<Float> BlendMask = Iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Float> iota = iotaShuffle();
VectorMask<Float> BlendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
(broadcast((float)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return ((FloatVector)w).blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return ((FloatVector)w).blend(this.rearrange(iota), BlendMask);
}

/*package-private*/
@@ -1997,12 +1997,12 @@ FloatVector sliceTemplate(int origin) {
@ForceInline
FloatVector
unsliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Float> Iota = iotaShuffle();
VectorMask<Float> BlendMask = Iota.toVector().compare(VectorOperators.GE,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Float> iota = iotaShuffle();
VectorMask<Float> BlendMask = iota.toVector().compare(VectorOperators.GE,
(broadcast((float)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

private ArrayIndexOutOfBoundsException
@@ -1980,11 +1980,11 @@ public final IntVector blend(long e,
IntVector sliceTemplate(int origin, Vector<Integer> v1) {
IntVector that = (IntVector) v1;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Integer> Iota = iotaShuffle();
VectorMask<Integer> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((int)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return ((IntVector)v1).rearrange(Iota).blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Integer> iota = iotaShuffle();
VectorMask<Integer> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((int)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return ((IntVector)v1).rearrange(iota).blend(this.rearrange(iota), BlendMask);
}

/**
@@ -2010,11 +2010,11 @@ IntVector slice(int origin,
final
@ForceInline
IntVector sliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Integer> Iota = iotaShuffle();
VectorMask<Integer> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((int)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Integer> iota = iotaShuffle();
VectorMask<Integer> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((int)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

/**
@@ -2031,12 +2031,12 @@ IntVector sliceTemplate(int origin) {
unsliceTemplate(int origin, Vector<Integer> w, int part) {
IntVector that = (IntVector) w;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Integer> Iota = iotaShuffle();
VectorMask<Integer> BlendMask = Iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Integer> iota = iotaShuffle();
VectorMask<Integer> BlendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
(broadcast((int)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return ((IntVector)w).blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return ((IntVector)w).blend(this.rearrange(iota), BlendMask);
}

/*package-private*/
@@ -2071,12 +2071,12 @@ IntVector sliceTemplate(int origin) {
@ForceInline
IntVector
unsliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Integer> Iota = iotaShuffle();
VectorMask<Integer> BlendMask = Iota.toVector().compare(VectorOperators.GE,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Integer> iota = iotaShuffle();
VectorMask<Integer> BlendMask = iota.toVector().compare(VectorOperators.GE,
(broadcast((int)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

private ArrayIndexOutOfBoundsException
@@ -1851,11 +1851,11 @@ public final LongVector blend(long e,
LongVector sliceTemplate(int origin, Vector<Long> v1) {
LongVector that = (LongVector) v1;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Long> Iota = iotaShuffle();
VectorMask<Long> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((long)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return ((LongVector)v1).rearrange(Iota).blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Long> iota = iotaShuffle();
VectorMask<Long> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((long)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return ((LongVector)v1).rearrange(iota).blend(this.rearrange(iota), BlendMask);
}

/**
@@ -1881,11 +1881,11 @@ LongVector slice(int origin,
final
@ForceInline
LongVector sliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Long> Iota = iotaShuffle();
VectorMask<Long> BlendMask = Iota.toVector().compare(VectorOperators.LT, (broadcast((long)(length() - origin))));
Iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Long> iota = iotaShuffle();
VectorMask<Long> BlendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((long)(length() - origin))));
iota = iotaShuffle(origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

/**
@@ -1902,12 +1902,12 @@ LongVector sliceTemplate(int origin) {
unsliceTemplate(int origin, Vector<Long> w, int part) {
LongVector that = (LongVector) w;
that.check(this);
Objects.checkIndex(origin, length());
VectorShuffle<Long> Iota = iotaShuffle();
VectorMask<Long> BlendMask = Iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Long> iota = iotaShuffle();
VectorMask<Long> BlendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT,
(broadcast((long)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return ((LongVector)w).blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return ((LongVector)w).blend(this.rearrange(iota), BlendMask);
}

/*package-private*/
@@ -1942,12 +1942,12 @@ LongVector sliceTemplate(int origin) {
@ForceInline
LongVector
unsliceTemplate(int origin) {
Objects.checkIndex(origin, length());
VectorShuffle<Long> Iota = iotaShuffle();
VectorMask<Long> BlendMask = Iota.toVector().compare(VectorOperators.GE,
Objects.checkIndex(origin, length() + 1);
VectorShuffle<Long> iota = iotaShuffle();
VectorMask<Long> BlendMask = iota.toVector().compare(VectorOperators.GE,
(broadcast((long)(origin))));
Iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(Iota), BlendMask);
iota = iotaShuffle(-origin, 1, true);
return vspecies().zero().blend(this.rearrange(iota), BlendMask);
}

private ArrayIndexOutOfBoundsException
Loading