On Wed, 8 Jun 2022 09:39:04 GMT, Quan Anh Mai <d...@openjdk.java.net> wrote:
>> Hi, >> >> This patch implements intrinsics for `Integer/Long::compareUnsigned` using >> the same approach as the JVM does for long and floating-point comparisons. >> This allows efficient and reliable usage of unsigned comparison in Java, >> which is a basic operation and is important for range checks such as >> discussed in #8620 . >> >> Thank you very much. > > I have added a benchmark for the intrinsic. The result is as follows, thanks > a lot: > > Before After > Benchmark (size) Mode Cnt Score Error Score Error > Units > Integers.compareUnsigned 500 avgt 15 0.527 ± 0.002 0.498 ± 0.011 > us/op > Longs.compareUnsigned 500 avgt 15 0.677 ± 0.014 0.561 ± 0.006 > us/op @merykitty Could you please also add the micro benchmark where compareUnsigned result is stored directly in an integer and show the performance of that? ------------- PR: https://git.openjdk.org/jdk/pull/9068