RFR: 8334843: RISC-V: Fix wraparound checking for r_array_index in lookup_secondary_supers_table_slow_path

duke duke at openjdk.org
Thu Jun 27 17:13:38 UTC 2024


On Mon, 24 Jun 2024 09:25:31 GMT, Gui Cao <gcao at openjdk.org> wrote:

> Branch condition for r_array_index wraparound checking in lookup_secondary_supers_table_slow_path is wrong.
> 
>     // Check for wraparound.
>     Label skip;
>     bge(r_array_length, r_array_index, skip);
>     mv(r_array_index, zr);
>     bind(skip);
> 
> As discussed at https://github.com/openjdk/jdk/pull/19320/files#r1650548279 . If length == index, then we must set index to 0. That is `blt(r_array_index,r_array_length,skip);`.
> 
> ### Correctness testing:
> - [x] Run tier1-3 tests on SOPHON SG2042 (release)
> 
> ### JMH tested on Banana Pi BPI-F3 board (has Zbb) and Enable UseZbb
> without this patch:
> 
> SecondarySupersLookup.testNegative00  avgt   15   13.275 ± 0.223  ns/op
> SecondarySupersLookup.testNegative01  avgt   15   13.264 ± 0.201  ns/op
> SecondarySupersLookup.testNegative02  avgt   15   13.261 ± 0.194  ns/op
> SecondarySupersLookup.testNegative03  avgt   15   13.271 ± 0.210  ns/op
> SecondarySupersLookup.testNegative04  avgt   15   13.265 ± 0.201  ns/op
> SecondarySupersLookup.testNegative05  avgt   15   13.258 ± 0.191  ns/op
> SecondarySupersLookup.testNegative06  avgt   15   13.280 ± 0.225  ns/op
> SecondarySupersLookup.testNegative07  avgt   15   13.268 ± 0.201  ns/op
> SecondarySupersLookup.testNegative08  avgt   15   13.266 ± 0.202  ns/op
> SecondarySupersLookup.testNegative09  avgt   15   13.261 ± 0.196  ns/op
> SecondarySupersLookup.testNegative10  avgt   15   13.268 ± 0.198  ns/op
> SecondarySupersLookup.testNegative16  avgt   15   13.268 ± 0.205  ns/op
> SecondarySupersLookup.testNegative20  avgt   15   13.284 ± 0.231  ns/op
> SecondarySupersLookup.testNegative30  avgt   15   13.281 ± 0.226  ns/op
> SecondarySupersLookup.testNegative32  avgt   15   13.273 ± 0.215  ns/op
> SecondarySupersLookup.testNegative40  avgt   15   13.287 ± 0.233  ns/op
> SecondarySupersLookup.testNegative50  avgt   15   13.292 ± 0.242  ns/op
> SecondarySupersLookup.testNegative55  avgt   15   53.064 ± 0.757  ns/op
> SecondarySupersLookup.testNegative56  avgt   15   53.052 ± 0.767  ns/op
> SecondarySupersLookup.testNegative57  avgt   15   53.068 ± 0.803  ns/op
> SecondarySupersLookup.testNegative58  avgt   15   53.076 ± 0.776  ns/op
> SecondarySupersLookup.testNegative59  avgt   15   53.095 ± 0.846  ns/op
> SecondarySupersLookup.testNegative60  avgt   15   75.106 ± 1.033  ns/op
> SecondarySupersLookup.testNegative61  avgt   15   76.832 ± 4.047  ns/op
> SecondarySupersLookup.testNegative62  avgt   15   75.085 ± 1.010  ns/op
> SecondarySupersLookup.testNegative63  avgt   15  153.709 ± 0.893  ns/op
> SecondarySupersLookup.testNegative64  ...

@zifeihan 
Your change (at version 4780027f9f9e43ebb6e17b6079abb4b993395b8e) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jdk/pull/19852#issuecomment-2194141988


More information about the hotspot-dev mailing list