RFR: 8345110: RISC-V: Optimize and and clean up byte reverse assembler routines [v2]

Fei Yang fyang at openjdk.org
Thu Nov 28 15:24:58 UTC 2024


On Thu, 28 Nov 2024 14:36:45 GMT, Hamlin Li <mli at openjdk.org> wrote:

> > > Thanks for cleanup! Not sure if I understand correctly, just have some questions, in upstream code at [1] [2], seems they both not expect a signed-extending?
> > 
> > 
> > Sorry, I should have explained that in the PR description. For these two cases, we are are loading the 32-bit `npairs` of bytecode `lookupswitch` which are specified to be greater than or equal to 0 by the JVMS [1]. So there is no difference whether we use sign-extension or zero-extension. Hope that answers the question :-)
> > [1] https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.lookupswitch
> 
> I see, I guessed that might be the answer. It might be helpful to add some comment in these places to state clearly what we expect, because `revb_w` now has the comment `reverse bytes in lower word, sign-extend`.

Make sense. I have just added some code comments to help clarify. Thanks for the suggestions.

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

PR Comment: https://git.openjdk.org/jdk/pull/22410#issuecomment-2506356180


More information about the hotspot-dev mailing list