RFR: 8336860: x86: Change integer src operand for CMoveL of 0 and 1 to long

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Mon Jul 22 03:37:52 UTC 2024


Hi all,
This patch fixes `cmovL_imm_01*` instructions matching against an integer immediate 1 instead of a long immediate 1. I noticed while looking at the backend implementation of CMove that the rules specify `immI_1` instead of `immL1`, which means that the instructions can't be matched and instead falls through to the base case. I added a small benchmark and got these results (time unit changed from us to ns for clarity):

                                              Baseline                     Patch           Improvement
Benchmark             (size)  Mode  Cnt    Score    Error  Units     Score   Error  Units
Longs.cmovConstant01     500  avgt   15  133.254 ± 14.804  ns/op    97.845 ± 2.486  ns/op  (+ 30.64%)

Thoughts and reviews would be appreciated!

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

Commit messages:
 - x86: Fix integer operand for CMoveL of 0 and 1

Changes: https://git.openjdk.org/jdk/pull/20275/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20275&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8336860
  Stats: 12 lines in 2 files changed: 8 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20275.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20275/head:pull/20275

PR: https://git.openjdk.org/jdk/pull/20275


More information about the core-libs-dev mailing list