RFR: 8320206: Some intrinsics/stubs missing vzeroupper on x86_64

Vladimir Kozlov kvn at openjdk.org
Fri Nov 17 03:13:29 UTC 2023


On Wed, 15 Nov 2023 21:28:46 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

> The following intrinsics/stubs are missing vzeroupper:
> adler32 (since JDK17)
> count_positives (since JDK 9)
> chacha20 (since JDK 20)
> string indexOfChar (since JDK 9)
> 
> Adding the missing vzeroupper to avoid AVX-SSE transition penalties.

Okay. I think I understand what you said. We need vzeroupper in JITed code (because called from Interpreter) if it or intrinsics it calls use avx512 instructions. We don't generate vzeroupper in JITed code epilog if the code does not uses avx512. But intrinsic stub it calls may use avx512 so we delegate vzeroupper generation to stub.
All this is fine but there is duplication: the code may have avx512 instructions, it may call several intrinsics stubs which have them too. Currently we don't check, I think, such duplication but we may need to do that to improve performance.
Please file new RFE.

Saying that I accept your changes and will test it.

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

PR Comment: https://git.openjdk.org/jdk/pull/16678#issuecomment-1815679868


More information about the hotspot-compiler-dev mailing list