RFR: 8334843: RISC-V: Fix wraparound checking for r_array_index in lookup_secondary_supers_table_slow_path
Gui Cao
gcao at openjdk.org
Mon Jun 24 14:20:35 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:
> - [ ] Run tier1-3 tests on SOPHON SG2042 (release)
>
> ### JMH tested on SOPHON SG2042 (has not Zbb)
> without this patch:
>
> Benchmark Mode Cnt Score Error Units
> SecondarySupersLookup.testNegative00 avgt 15 20.649 ± 0.147 ns/op
> SecondarySupersLookup.testNegative01 avgt 15 20.649 ± 0.117 ns/op
> SecondarySupersLookup.testNegative02 avgt 15 20.637 ± 0.116 ns/op
> SecondarySupersLookup.testNegative03 avgt 15 20.638 ± 0.113 ns/op
> SecondarySupersLookup.testNegative04 avgt 15 20.638 ± 0.127 ns/op
> SecondarySupersLookup.testNegative05 avgt 15 20.639 ± 0.115 ns/op
> SecondarySupersLookup.testNegative06 avgt 15 20.638 ± 0.119 ns/op
> SecondarySupersLookup.testNegative07 avgt 15 20.850 ± 0.457 ns/op
> SecondarySupersLookup.testNegative08 avgt 15 20.842 ± 0.459 ns/op
> SecondarySupersLookup.testNegative09 avgt 15 20.650 ± 0.124 ns/op
> SecondarySupersLookup.testNegative10 avgt 15 20.642 ± 0.127 ns/op
> SecondarySupersLookup.testNegative16 avgt 15 20.657 ± 0.157 ns/op
> SecondarySupersLookup.testNegative20 avgt 15 20.669 ± 0.152 ns/op
> SecondarySupersLookup.testNegative30 avgt 15 20.668 ± 0.166 ns/op
> SecondarySupersLookup.testNegative32 avgt 15 20.669 ± 0.168 ns/op
> SecondarySupersLookup.testNegative40 avgt 15 20.668 ± 0.174 ns/op
> SecondarySupersLookup.testNegative50 avgt 15 20.682 ± 0.194 ns/op
> SecondarySupersLookup.testNegative55 avgt 15 113.369 ± 3.792 ns/op
> SecondarySupersLookup.testNegative56 avgt 15 113.888 ± 3.769 ns/op
> SecondarySupersLookup.testNegative57 avgt 15 115.320 ± 4.271 ns/op
> SecondarySupersLookup.testNegative58 avgt 15 115.648 ± 2.985 ns/op
> SecondarySupersLookup.testNegative59 avgt 15 117.730 ± 3.370 ns/op
> SecondarySupersLookup.testNegative60 avgt 15 142.533 ± 3.636 ns/op
> SecondarySupersLookup.testNegative61 avgt 15 144.901 ± 5.267 ns/op
> SecondarySupersLookup.testNegative62 avgt 15 145.926 ± 3.799 ns/op
> SecondarySupersLookup.testNegative63 avgt 15 207.704 ± 5....
@theRealAph Could you please take a look?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19852#issuecomment-2186684595
More information about the hotspot-dev
mailing list