RFR: 8268363: AArch64: Implement string_indexof_char intrinsic in SVE

Andrew Haley aph at openjdk.java.net
Mon Jun 28 11:39:07 UTC 2021


On Wed, 23 Jun 2021 04:19:11 GMT, TatWai Chong <github.com+78814694+tatwaichong at openjdk.org> wrote:

> This patch implements string_indexof_char intrinsic in SVE for both
> UTF-16 and Latin-8 variants. In the current underneath implementation,
> there is only 4 and 8 characters are compared at a time in UTF-16 and
> Latin-8 respectively. In this patch, we adopt SVE to vectorize this
> intrinsic so that a wider comparison can be performed each time.
> 
> I've run [1] with this patch on an SVE machine, and the performance of
> StringIndexOfChar.latin1_mixed_char (length=65) and
> StringIndexOfChar.utf16_mixed_char (length=65) are improved significantly,
> while no visible regression for other cases with shorter strings.
> (length=7, 8, 15, 16 and 32)
> 
> [1] https://github.com/openjdk/jdk/blob/master/test/micro/org/openjdk/bench/java/lang/StringIndexOfChar.java

src/hotspot/cpu/aarch64/assembler_aarch64.hpp line 3248:

> 3246:   }
> 3247: 
> 3248: // SVE integer compare vector (wide-element variants are not included)

The correct title for this section is "Integer comparisons (SVE)", as in the Arm ® Architecture Reference Manual Supplement, The Scalable Vector Extension," Chapter 8. Please make sure all of these sections in the assembler have the same names as those in the manual.

src/hotspot/cpu/aarch64/assembler_aarch64.hpp line 3264:

> 3262: 
> 3263: // SVE 64-bit while[cond] (32-bit variants are not included)
> 3264: #define INSN(NAME, decode)                                                \

And here it should be "Predicate counted loop (SVE)".

src/hotspot/cpu/aarch64/assembler_aarch64.hpp line 3286:

> 3284: 
> 3285: // SVE cnt[b|h|w|d]
> 3286: #define INSN(NAME, TYPE)                                                             \

"Element count and increment scalar (SVE)"

-------------

PR: https://git.openjdk.java.net/jdk/pull/4567


More information about the hotspot-compiler-dev mailing list