RFR: 8282875: AArch64: [vectorapi] Optimize Vector.reduceLane for SVE 64/128 vector size [v2]
Eric Liu
eliu at openjdk.java.net
Tue Apr 19 16:04:06 UTC 2022
> This patch speeds up add/mul/min/max reductions for SVE for 64/128
> vector size.
>
> According to Neoverse N2/V1 software optimization guide[1][2], for
> 128-bit vector size reduction operations, we prefer using NEON
> instructions instead of SVE instructions. This patch adds some rules to
> distinguish 64/128 bits vector size with others, so that for these two
> special cases, they can generate code the same as NEON. E.g., For
> ByteVector.SPECIES_128, "ByteVector.reduceLanes(VectorOperators.ADD)"
> generates code as below:
>
>
> Before:
> uaddv d17, p0, z16.b
> smov x15, v17.b[0]
> add w15, w14, w15, sxtb
>
> After:
> addv b17, v16.16b
> smov x12, v17.b[0]
> add w12, w12, w16, sxtb
>
> No multiply reduction instruction in SVE, this patch generates code for
> MulReductionVL by using scalar insnstructions for 128-bit vector size.
>
> With this patch, all of them have performance gain for specific vector
> micro benchmarks in my SVE testing system.
>
> [1] https://developer.arm.com/documentation/pjdoc466751330-9685/latest/
> [2] https://developer.arm.com/documentation/PJDOC-466751330-18256/0001
>
> Change-Id: I4bef0b3eb6ad1bac582e4236aef19787ccbd9b1c
Eric Liu has updated the pull request incrementally with one additional commit since the last revision:
Generate SVE reduction for MIN/MAX/ADD as before
Change-Id: Ibc6b9c1f46c42cd07f7bb73b81ed38829e9d0975
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/7999/files
- new: https://git.openjdk.java.net/jdk/pull/7999/files/59a857e5..d81fb9c4
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7999&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7999&range=00-01
Stats: 20 lines in 2 files changed: 0 ins; 20 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/7999.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7999/head:pull/7999
PR: https://git.openjdk.java.net/jdk/pull/7999
More information about the hotspot-compiler-dev
mailing list