diff --git a/src/tests/JIT/HardwareIntrinsics/X86/X86Base/CpuId.cs b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/CpuId.cs index 5fd971feb9670..7f33e710c8da9 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/X86Base/CpuId.cs +++ b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/CpuId.cs @@ -373,7 +373,7 @@ public unsafe static void CpuId() static bool IsBitIncorrect(int register, int bitNumber, Type isa, bool isSupported, string name, ref bool isHierarchyDisabled) { bool isSupportedByHardware = (register & (1 << bitNumber)) != 0; - isHierarchyDisabled |= !GetDotnetEnable(name); + isHierarchyDisabled |= (!isSupported || !GetDotnetEnable(name)); if (isSupported) { diff --git a/src/tests/readytorun/HardwareIntrinsics/X86/CpuId.cs b/src/tests/readytorun/HardwareIntrinsics/X86/CpuId.cs index 40ba2d9a1f22e..eb50665684f6f 100644 --- a/src/tests/readytorun/HardwareIntrinsics/X86/CpuId.cs +++ b/src/tests/readytorun/HardwareIntrinsics/X86/CpuId.cs @@ -366,7 +366,7 @@ public unsafe static int Main() static bool IsBitIncorrect(int register, int bitNumber, Type isa, bool isSupported, string name, ref bool isHierarchyDisabled) { bool isSupportedByHardware = (register & (1 << bitNumber)) != 0; - isHierarchyDisabled |= !GetDotnetEnable(name); + isHierarchyDisabled |= (!isSupported || !GetDotnetEnable(name)); if (isSupported) {