[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-compiler-dev
Subject:    RFR: 8275317: AArch64: Support some type conversion vectorization in SLP
From:       Fei Gao <duke () openjdk ! java ! net>
Date:       2021-10-28 3:47:29
Message-ID: KdMB4URGYbgKx5I5iD1vDS7nH0GFN_n-LszunEhOWAk=.5d5f1720-7731-493b-b943-5864d379ffa9 () github ! com
[Download RAW message or body]

Current SLP vectorizer in C2 compiler doesn't support type conversion
operations. But AArch64 has vector type conversion instructions in
both NEON and SVE.

The type conversion involves two kinds of scenarios, conversion between
the same data sizes and conversion between different data sizes. If we
want to support casts between different data sizes, we need to amend
the code part for identifying adjacent memory references and the code
part for justifying if the combination is profitable. I suppose it
would be easier to review if we split the whole task to support type
conversion into two separate patches, one for the same data sizes and
the other one for different data sizes. The goal of this patch is just
to support conversions within the same data size, including:
  int -> float
  float -> int
  long -> double
  double -> long

A typical test case:

for (int i = start; i < limit; i++) {
    b[i] = (float) a[i];
}

To implement it, the patch completed the necessary instructions and
matching rules in the backend and added implementation for SLP in
the middle end.

The percentage of performance uplift on aarch64 system:

benchmark	               Mode     Cnt      percentage change  [(After-Before)/Before]       Metric
VectorLoop.convertD2L	avgt        15            -48.46%	                 ns/op
VectorLoop.convertF2I	avgt        15            -55.67%	                 ns/op
VectorLoop.convertI2F	avgt        15            -55.27%	                 ns/op
VectorLoop.convertL2D	avgt        15            -48.75%	                 ns/op

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

Commit messages:
 - 8275317: AArch64: Support some type conversion vectorization in SLP

Changes: https://git.openjdk.java.net/jdk/pull/6145/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6145&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8275317
  Stats: 229 lines in 5 files changed: 224 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6145.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6145/head:pull/6145

PR: https://git.openjdk.java.net/jdk/pull/6145
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic