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

Reviewed-by: psandoz
  • Loading branch information
Joshua Zhu authored and DamonFool committed Mar 12, 2022
1 parent 374193b commit 5c408c1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
Expand Up @@ -4336,12 +4336,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 @@ -3963,12 +3963,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 @@ -3913,12 +3913,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 @@ -4061,12 +4061,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 @@ -3987,12 +3987,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 @@ -4330,12 +4330,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 @@ -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);
}
}
Expand Down

3 comments on commit 5c408c1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@TheRealMDoerr
Copy link
Contributor

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 5c408c1 Mar 30, 2022

Choose a reason for hiding this comment

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

@TheRealMDoerr the backport was successfully created on the branch TheRealMDoerr-backport-5c408c14 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 5c408c14 from the openjdk/jdk repository.

The commit being backported was authored by Joshua Zhu on 12 Mar 2022 and was reviewed by Paul Sandoz.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev TheRealMDoerr-backport-5c408c14:TheRealMDoerr-backport-5c408c14
$ git checkout TheRealMDoerr-backport-5c408c14
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev TheRealMDoerr-backport-5c408c14

Please sign in to comment.