-
Enhancement
-
Resolution: Fixed
-
P3
-
11, 16
-
b28
From Paul:
We have been investigating range check issues when using the Vector API. The recommended approach for loops is to express the upper bound using the method VectorSpecies.loopBound as in say:
@Benchmark
public float[] vector1() {
int i = 0;
for (; i < SPECIES.loopBound(a.length); i += SPECIES.length()) {
// FloatVector va, vb, vc;
var va = FloatVector.fromArray(SPECIES, a, i);
var vb = FloatVector.fromArray(SPECIES, b, i);
var vc = va.fma(va, vb.mul(vb)).neg();
vc.intoArray(r, i);
}
for (; i < a.length; i++) {
r[i] = Math.fma(a[i], a[i], b[i] * b[i]) * -1.0f;
}
return r;
}
However, this does not result in the removal of bounds checks from within the loop when loading/storing the vectors from/to memory.
We have been investigating range check issues when using the Vector API. The recommended approach for loops is to express the upper bound using the method VectorSpecies.loopBound as in say:
@Benchmark
public float[] vector1() {
int i = 0;
for (; i < SPECIES.loopBound(a.length); i += SPECIES.length()) {
// FloatVector va, vb, vc;
var va = FloatVector.fromArray(SPECIES, a, i);
var vb = FloatVector.fromArray(SPECIES, b, i);
var vc = va.fma(va, vb.mul(vb)).neg();
vc.intoArray(r, i);
}
for (; i < a.length; i++) {
r[i] = Math.fma(a[i], a[i], b[i] * b[i]) * -1.0f;
}
return r;
}
However, this does not result in the removal of bounds checks from within the loop when loading/storing the vectors from/to memory.
- relates to
-
JDK-8263971 C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN
- Resolved
-
JDK-8319372 C2 compilation fails with "Bad immediate dominator info"
- Closed
-
JDK-8280587 C2: assert(inner->is_valid_counted_loop(T_INT) && inner->is_strip_mined()) failed: OuterStripMinedLoop should have been removed
- Closed
-
JDK-8042997 Make intrinsic some or all check index/range methods
- Resolved
(1 links to)