Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

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

Backport-of: 5c408c1410e15087f735a815b7edc716d514b1b3
  • Loading branch information
TobiHartmann committed Apr 4, 2022
1 parent 617f190 commit 092ad51
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
Expand Up @@ -4343,12 +4343,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 @@ -3948,12 +3948,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 @@ -3898,12 +3898,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 @@ -4068,12 +4068,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 @@ -3994,12 +3994,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 @@ -4337,12 +4337,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 @@ -5528,12 +5528,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 092ad51

@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.