Skip to content

Commit

Permalink
8282874: Bad performance on gather/scatter API caused by different In…
Browse files Browse the repository at this point in the history
…tSpecies of indexMap

Backport-of: 5c408c1410e15087f735a815b7edc716d514b1b3
  • Loading branch information
TheRealMDoerr committed Mar 31, 2022
1 parent 3c34eb1 commit d66b6e1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
Expand Up @@ -4029,12 +4029,12 @@ public final VectorMask<Byte> maskAll(boolean bit) {
*/
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);
}
}
Expand Down
Expand Up @@ -3631,12 +3631,12 @@ public final VectorMask<Double> maskAll(boolean bit) {
*/
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);
}
}
Expand Down
Expand Up @@ -3618,12 +3618,12 @@ public final VectorMask<Float> maskAll(boolean bit) {
*/
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);
}
}
Expand Down
Expand Up @@ -3727,12 +3727,12 @@ public final VectorMask<Integer> maskAll(boolean bit) {
*/
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);
}
}
Expand Down
Expand Up @@ -3621,12 +3621,12 @@ public final VectorMask<Long> maskAll(boolean bit) {
*/
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);
}
}
Expand Down
Expand Up @@ -4024,12 +4024,12 @@ public final VectorMask<Short> maskAll(boolean bit) {
*/
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);
}
}
Expand Down
Expand Up @@ -5033,12 +5033,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);
}
}
Expand Down

1 comment on commit d66b6e1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.