RFR: 8358592: Assert in Assembler::ptest due to missing SSE42 support [v3]

Guanqiang Han duke at openjdk.org
Mon Jul 14 04:08:42 UTC 2025


On Fri, 11 Jul 2025 15:42:36 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> hi @TobiHartmann , Thanks a lot for the detailed review, i already update PR and please taking another look when you have time .
>> Also, since you mentioned you're not an expert in this area, would it make sense to ping someone more familiar?
>
> Thank you, @hgqxjj, for finding this.  Looking through other flags setting I see some have the same issue, for example, `UseUnalignedLoadStores`.  Which could be set on command line and not switched off even if Cpu does not support the feature.
> 
> May be we should rework how all such flags are handled instead of fixing only one of them.

hi @vnkozlov ,Thank you very much for your feedback. I looked into the issue you mentioned regarding flags like UseUnalignedLoadStores. I tested it with the command "java -XX:+UseUnalignedLoadStores -XX:UseSSE=1 -version" and found that no exception occurred. This is likely because supports_sse3 is a sufficient but not a necessary condition for enabling this flag, whereas for this issue [JDK-8358592] , supports_sse3 is both a necessary and sufficient condition for enabling UseSSE42Intrinsics. The bug was caused by the omission of handling when supports_sse3 is false and UseSSE42Intrinsics is enabled, which led to the error.
As for your suggestion to "rework how all such flags are handled," I think it’s an excellent idea because the logic here is indeed a bit convoluted. However, given that this code was contributed by multiple people and determining which conditions are sufficient or necessary can be quite complex, large-scale changes may introduce instability. Therefore, I would suggest we hold off on making such extensive modifications at this point, as such changes could be risky and require a broader understanding of the relationship between all flags.
That said, I really appreciate your feedback and would be glad to hear any further thoughts you may have — These are very helpful!

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

PR Comment: https://git.openjdk.org/jdk/pull/26151#issuecomment-3067764119


More information about the hotspot-dev mailing list