RFR (M): 8011102: Clear AVX registers after return from JNI call
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Apr 2 11:51:10 PDT 2013
http://cr.openjdk.java.net/~kvn/8011102/webrev/
A native library may use wide 256bit YMM registers and does not clean
them after that causing SSE <-> AVX transition penalty.
Note: penalty exist only in mixing 256bit data avx instructions with SSE
instructions. There is no penalty with mixed 128 bit avx instructions
because they zero upper bits.
Add vzeroupper instruction after return from JNI call to avoid the
penalty.
Add vzeroupper in compiled code which use 256bit vectors, before calls
and return. Also add it in intrinsics which use 256bit vectors:
arraycopy, fillarray, strings and encode_iso.
Note, vzeroupper is fast, one cycle instruction.
Moved Java_To_Runtime() encoding to x86_64.ad from <os>_x86_64.ad
because they are the same.
Tested with compiler jtreg, ctw, jprt.
Thanks,
Vladimir
More information about the hotspot-compiler-dev
mailing list