mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-01 14:08:24 +00:00
8282874: Bad performance on gather/scatter API caused by different IntSpecies of indexMap
Reviewed-by: psandoz
This commit is contained in:
parent
374193b6d2
commit
5c408c1410
@ -4336,12 +4336,12 @@ public abstract class ByteVector extends AbstractVector<Byte> {
|
||||
*/
|
||||
static ByteSpecies species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return (ByteSpecies) SPECIES_64;
|
||||
case S_128_BIT: return (ByteSpecies) SPECIES_128;
|
||||
case S_256_BIT: return (ByteSpecies) SPECIES_256;
|
||||
case S_512_BIT: return (ByteSpecies) SPECIES_512;
|
||||
case S_Max_BIT: return (ByteSpecies) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return (ByteSpecies) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return (ByteSpecies) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return (ByteSpecies) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return (ByteSpecies) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return (ByteSpecies) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3963,12 +3963,12 @@ public abstract class DoubleVector extends AbstractVector<Double> {
|
||||
*/
|
||||
static DoubleSpecies species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return (DoubleSpecies) SPECIES_64;
|
||||
case S_128_BIT: return (DoubleSpecies) SPECIES_128;
|
||||
case S_256_BIT: return (DoubleSpecies) SPECIES_256;
|
||||
case S_512_BIT: return (DoubleSpecies) SPECIES_512;
|
||||
case S_Max_BIT: return (DoubleSpecies) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return (DoubleSpecies) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return (DoubleSpecies) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return (DoubleSpecies) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return (DoubleSpecies) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return (DoubleSpecies) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3913,12 +3913,12 @@ public abstract class FloatVector extends AbstractVector<Float> {
|
||||
*/
|
||||
static FloatSpecies species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return (FloatSpecies) SPECIES_64;
|
||||
case S_128_BIT: return (FloatSpecies) SPECIES_128;
|
||||
case S_256_BIT: return (FloatSpecies) SPECIES_256;
|
||||
case S_512_BIT: return (FloatSpecies) SPECIES_512;
|
||||
case S_Max_BIT: return (FloatSpecies) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return (FloatSpecies) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return (FloatSpecies) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return (FloatSpecies) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return (FloatSpecies) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return (FloatSpecies) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4061,12 +4061,12 @@ public abstract class IntVector extends AbstractVector<Integer> {
|
||||
*/
|
||||
static IntSpecies species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return (IntSpecies) SPECIES_64;
|
||||
case S_128_BIT: return (IntSpecies) SPECIES_128;
|
||||
case S_256_BIT: return (IntSpecies) SPECIES_256;
|
||||
case S_512_BIT: return (IntSpecies) SPECIES_512;
|
||||
case S_Max_BIT: return (IntSpecies) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return (IntSpecies) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return (IntSpecies) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return (IntSpecies) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return (IntSpecies) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return (IntSpecies) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3987,12 +3987,12 @@ public abstract class LongVector extends AbstractVector<Long> {
|
||||
*/
|
||||
static LongSpecies species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return (LongSpecies) SPECIES_64;
|
||||
case S_128_BIT: return (LongSpecies) SPECIES_128;
|
||||
case S_256_BIT: return (LongSpecies) SPECIES_256;
|
||||
case S_512_BIT: return (LongSpecies) SPECIES_512;
|
||||
case S_Max_BIT: return (LongSpecies) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return (LongSpecies) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return (LongSpecies) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return (LongSpecies) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return (LongSpecies) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return (LongSpecies) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4330,12 +4330,12 @@ public abstract class ShortVector extends AbstractVector<Short> {
|
||||
*/
|
||||
static ShortSpecies species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return (ShortSpecies) SPECIES_64;
|
||||
case S_128_BIT: return (ShortSpecies) SPECIES_128;
|
||||
case S_256_BIT: return (ShortSpecies) SPECIES_256;
|
||||
case S_512_BIT: return (ShortSpecies) SPECIES_512;
|
||||
case S_Max_BIT: return (ShortSpecies) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return (ShortSpecies) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return (ShortSpecies) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return (ShortSpecies) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return (ShortSpecies) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return (ShortSpecies) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5543,12 +5543,12 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
|
||||
*/
|
||||
static $Type$Species species(VectorShape s) {
|
||||
Objects.requireNonNull(s);
|
||||
switch (s) {
|
||||
case S_64_BIT: return ($Type$Species) SPECIES_64;
|
||||
case S_128_BIT: return ($Type$Species) SPECIES_128;
|
||||
case S_256_BIT: return ($Type$Species) SPECIES_256;
|
||||
case S_512_BIT: return ($Type$Species) SPECIES_512;
|
||||
case S_Max_BIT: return ($Type$Species) SPECIES_MAX;
|
||||
switch (s.switchKey) {
|
||||
case VectorShape.SK_64_BIT: return ($Type$Species) SPECIES_64;
|
||||
case VectorShape.SK_128_BIT: return ($Type$Species) SPECIES_128;
|
||||
case VectorShape.SK_256_BIT: return ($Type$Species) SPECIES_256;
|
||||
case VectorShape.SK_512_BIT: return ($Type$Species) SPECIES_512;
|
||||
case VectorShape.SK_Max_BIT: return ($Type$Species) SPECIES_MAX;
|
||||
default: throw new IllegalArgumentException("Bad shape: " + s);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user