On Fri, 18 Sep 2020 23:11:46 GMT, Jason Tatton <github.com+70893615+jasontatton-...@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 specifically: > get_processor_features and in > generate_get_cpu_info. Yes, I can see what the code does. I was asking where the cpu behaviour is documented independent of the code. > 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. 'maybe'? The documentation Andrew provided mentioned Xeon E5 v3 which I believe is a Skylake design. However, the code I pointed you at in vm_version_x86 which claims to detect 'early Skylake' designs is only disabling AVX512 support. It still enables AVX2. Similarly, the code generates machine code to check the processor capabilities has a special check if use_evex is set (i.e. AVX3 is requested) for Skylake which disables AVX512 but does nto disable AVX2 support. 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 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