RFR: 8255553: [PPC64] Introduce and use setbc and setnbc P10 instructions

Ziviani github.com+670087+jrziviani at openjdk.java.net
Wed Oct 28 17:35:53 UTC 2020


- setbc RT,BI: sets RT to 1 if CR(BI) is 1, otherwise 0.
- setnbc RT,BI: sets RT to -1 if CR(BI) is 1, otherwise 0.
Ref: PowerISA 3.1, page 129.

These instructions are particularly interesting to improve the following
pattern `(src1<src2)? -1: ((src1>src2)? 1: 0)`, which can be found in
`instruct cmpL3_reg_reg_ExEx()@ppc.ad`, by removing its branches.

Long.toString, that generate such pattern in getChars, has showed a
good performance gain by using these new instructions.

Example:
for (int i = 0; i < 200_000; i++)
  res = Long.toString((long)i);

java -Xcomp -XX:CompileThreshold=1 -XX:-TieredCompilation TestToString

Without setbc (average): 0.1178 seconds
With setbc (average): 0.0396 seconds

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

Commit messages:
 - RFR: 8255553: [PPC64] Introduce and use setbc and setnbc P10 instructions

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

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


More information about the hotspot-compiler-dev mailing list