On Fri, 18 Sep 2020 16:31:23 GMT, Andrew Dinn <ad...@openjdk.org> wrote:

> Can you explain where this restricted effect is documented?

Certainly! I’ve found that determining the capability of the CPU and whether to 
enable AVX2 support if the chip
supports it is mostly controlled in: [vm_version_x86.cpp](
https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/vm_version_x86.cpp)
 specifically:
[get_processor_features](https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/vm_version_x86.cpp#L684-L755)
and in [generate_get_cpu_info](
https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/vm_version_x86.cpp#L69-L611).

In order to test the patch comprehensively I had to track down an Intel Core i7 
(I7-9750H) processor which the
aforementioned code permitted AVX2 instructions for (maybe this is an error and 
it should not be enabled for this
processor though) as most of the infrastructure I personally use here at AWS 
runs on Intel Xeon processors - I also
tested on a E5-2680 which the JVM does not enable AVX2 for.

However, this is just the Intel side of things. When it comes to AMD I read 
that the AMD Zen 2 architecture, of which
the current flagship: Threadripper 3990X, is based, is able to support AVX2 
[without the frequency scaling](
https://www.anandtech.com/Show/Index/14525?cPage=7&all=False&sort=0&page=9&slug=amd-zen-2-microarchitecture-analysis-ryzen-3000-and-epyc-rome)
which some/all(?) of the Intel chips incur. I personally don’t have access to 
one of these chips so I cannot confirm
how it is classified in the JVM.

Also, I found when investigating this that there is actually a JVM flag which 
can be used to control what level of AVX
is enabled: `-XX:UseAVX=version.`

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

PR: https://git.openjdk.java.net/jdk/pull/71

Reply via email to