Skip to content

Commit

Permalink
Merge pull request #21160 from BradleyWood/xgetbv
Browse files Browse the repository at this point in the history
Guard xgetbv call to x86 in ProcessorDetection
  • Loading branch information
pshipton authored Feb 20, 2025
2 parents 5626ff4 + 3d3fd1a commit 14b5608
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/compiler/env/ProcessorDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ TR_J9VM::initializeProcessorType()
bool disableAVX = true;
bool disableAVX512 = true;

#if defined(TR_TARGET_X86)
// Check XCRO register for OS support of xmm/ymm/zmm
if (TRUE == omrsysinfo_processor_has_feature(&processorDescription, OMR_FEATURE_X86_OSXSAVE))
{
Expand All @@ -356,6 +357,7 @@ TR_J9VM::initializeProcessorType()
// 'e6' = (mask for XCR0[7:5]='111b' (Opmask, ZMM_Hi256, Hi16_ZMM) + XCR0[2:1]='11b' (XMM/YMM))
disableAVX512 = ((0xe6 & _xgetbv(0)) != 0xe6);
}
#endif

if (disableAVX)
{
Expand Down

0 comments on commit 14b5608

Please sign in to comment.