RFR: 8343827: RISC-V: set AlignVector as false if applicable to enable SLP

Hamlin Li mli at openjdk.org
Tue Nov 12 09:56:41 UTC 2024


On Tue, 12 Nov 2024 07:44:34 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:

> hello Hamlin, this could to be wrong. for example: kendryte 230 with c908 core with rv64gcv it has fast misaligned access but only for scalars(rv64gc), not for vectors(rvv) i dont know if it's just a corner case or a possible common practice in future.

Thanks for bring up this test case.
I have the similar question in mind, if a hardware claims to support misaligned fast access, seems it should support both scalar and vector.

> for this particular case, it has kernel 5.10 which has no hwprobe. so avoidUnaligned has to be disabled manually.

Yes, the default behaviour is to use hwprobe to test the CPU features, so for k 230, the default behaviour should be fine, i.e. both `AlignVector` and `AvoidUnalignedAccesses` would be true, nothing changed.

> but there are more boards based on c908 core which needs to be checked with this change. while the c908 isnt the thing we should care much about, right now i think boards with c908 are the main test mule to check jdk rvv performance changes

I'm not quite sure if we should test on each of the potential boards, seems to me we should not. What we need do should be to test CPU features based on hwprobe if unaligned fast access is supported or not, and enable/disable JDK features accordingly. In this way, our tests should be easy and get most of performance gain for common cases, and if there is a cornor case (claim to support but does not actaully), then the user could still disable it manually.

I'll wait for other tests/comments ...

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

PR Comment: https://git.openjdk.org/jdk/pull/21974#issuecomment-2470077713


More information about the hotspot-dev mailing list