#23244 identified that when AMX registers are used on windows additional stack space is needed for the increased size of the XSAVE buffer.
#23472 unconditionally increases the stack size on windows to account for this.
It is possible to detect the usage of AMX at JVM startup time by doing the following:
- Check CPU support for AMX with
__cpuidex
- Check if the OS supports AMX with
_xgetbv
- Check if AMX is enabled with
GetEnabledXStateFeatures
The third check may be a superset of the prior ones.
In order to save stack space we should add this check to conditionally increase the stack size on windows.
#23244 identified that when AMX registers are used on windows additional stack space is needed for the increased size of the XSAVE buffer.
#23472 unconditionally increases the stack size on windows to account for this.
It is possible to detect the usage of AMX at JVM startup time by doing the following:
__cpuidex_xgetbvGetEnabledXStateFeaturesThe third check may be a superset of the prior ones.
In order to save stack space we should add this check to conditionally increase the stack size on windows.