Ensure that IsSupported being false disables the tracked hierachy in our tests (...
authorTanner Gooding <tagoo@outlook.com>
Fri, 14 Jul 2023 18:10:53 +0000 (11:10 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Jul 2023 18:10:53 +0000 (11:10 -0700)
src/tests/JIT/HardwareIntrinsics/X86/X86Base/CpuId.cs
src/tests/readytorun/HardwareIntrinsics/X86/CpuId.cs

index 5fd971f..7f33e71 100644 (file)
@@ -373,7 +373,7 @@ namespace XarchHardwareIntrinsicTest._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)
             {
index 40ba2d9..eb50665 100644 (file)
@@ -366,7 +366,7 @@ namespace XarchHardwareIntrinsicTest._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)
             {