Updating the x86 HWIntrinsics program to print out the list of supported ISAs
authorTanner Gooding <tagoo@outlook.com>
Fri, 3 Aug 2018 20:20:38 +0000 (13:20 -0700)
committerTanner Gooding <tagoo@outlook.com>
Fri, 3 Aug 2018 22:19:11 +0000 (15:19 -0700)
tests/src/JIT/HardwareIntrinsics/X86/Shared/Program.cs

index 99ff4f529b50b8ad8c683fbf76040bf5c491a84c..610035f06fea6f25044fb306f1fde08e2ee30c82 100644 (file)
@@ -5,6 +5,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.Intrinsics.X86;
 
 namespace JIT.HardwareIntrinsics.X86
 {
@@ -19,6 +20,8 @@ namespace JIT.HardwareIntrinsics.X86
         {
             var isPassing = true;
 
+            PrintSupportedIsa();
+
             foreach (string testToRun in GetTestsToRun(args))
             {
                 TestLibrary.TestFramework.BeginTestCase(testToRun);
@@ -64,6 +67,27 @@ namespace JIT.HardwareIntrinsics.X86
             return (testsToRun.Count == 0) ? TestList.Keys : testsToRun;
         }
 
+        private static void PrintSupportedIsa()
+        {
+            TestLibrary.TestFramework.LogInformation("Supported ISAs:");
+            TestLibrary.TestFramework.LogInformation($"  AES:       {Aes.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  AVX:       {Avx.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  AVX2:      {Avx2.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  BMI1:      {Bmi1.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  BMI2:      {Bmi2.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  FMA:       {Fma.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  LZCNT:     {Lzcnt.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  PCLMULQDQ: {Pclmulqdq.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  POPCNT:    {Popcnt.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  SSE:       {Sse.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  SSE2:      {Sse2.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  SSE3:      {Sse3.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  SSE4.1:    {Sse41.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  SSE4.2:    {Sse42.IsSupported}");
+            TestLibrary.TestFramework.LogInformation($"  SSSE3:     {Ssse3.IsSupported}");
+            TestLibrary.TestFramework.LogInformation(string.Empty);
+        }
+
         private static void PrintUsage()
         {
             TestLibrary.TestFramework.LogInformation($@"Usage: