RFR: 8276162: Optimise unsigned comparison pattern [v4]

Mai Đặng Quân Anh duke at openjdk.java.net
Sat Nov 13 05:22:07 UTC 2021


> This patch changes operations in the form `x +- Integer.MIN_VALUE <=> y +- Integer.MIN_VALUE`, which is a pattern used to do unsigned comparisons, into `x u<=> y`.
> 
> In addition to being basic operations, they may be utilised to implement range checks such as the methods in `jdk.internal.util.Preconditions`, or in places where the compiler cannot deduce the non-negativeness of the bound as in `java.util.ArrayList`.
> 
> Thank you very much.

Mai Đặng Quân Anh has updated the pull request incrementally with two additional commits since the last revision:

 - add tests cover constant comparison and calling library
 - add eq/ne, add correction test, refine micro

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6101/files
  - new: https://git.openjdk.java.net/jdk/pull/6101/files/4dada5fc..92e92cfe

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6101&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6101&range=02-03

  Stats: 452 lines in 3 files changed: 427 ins; 2 del; 23 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6101.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6101/head:pull/6101

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


More information about the hotspot-compiler-dev mailing list