Pulling in CoreFX changes and fixing up Sse2.StoreLow to be Sse2.StoreScalar (#24123)
authorTanner Gooding <tagoo@outlook.com>
Sat, 20 Apr 2019 03:33:46 +0000 (20:33 -0700)
committerGitHub <noreply@github.com>
Sat, 20 Apr 2019 03:33:46 +0000 (20:33 -0700)
* Update dependencies from https://github.com/dotnet/corefx build 20190419.5

    - Microsoft.NETCore.Platforms - 3.0.0-preview5.19219.5
    - Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19219.5

* Removing the Sse2.StoreLow(long/ulong*, ...) methods that have been replaced

* Moving the Sse2.StoreLow(long/ulong*, ...) tests to be Sse2.StoreScalar tests

* Fixing some existing usages of Sse2.StoreLow(long/ulong*, ...)

eng/Version.Details.xml
eng/Versions.props
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.cs
src/System.Private.CoreLib/shared/System/Text/ASCIIUtility.cs
src/jit/hwintrinsiclistxarch.h
tests/src/JIT/HardwareIntrinsics/X86/Sse2/StoreLow.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse2/StoreScalar.cs

index 557bb50..75b4702 100644 (file)
       <Uri>https://github.com/dotnet/arcade</Uri>
       <Sha>517bf671ea342965d007aa48f5bfd4926e58d582</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="4.6.0-preview5.19218.11">
+    <Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="4.6.0-preview5.19219.5">
       <Uri>https://github.com/dotnet/corefx</Uri>
-      <Sha>0a9a366e290aded3e9bf5d082d6beee5ff560177</Sha>
+      <Sha>069f540c174aab3d2c0501d339ab49c14a2b3c19</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview5.19218.11">
+    <Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview5.19219.5">
       <Uri>https://github.com/dotnet/corefx</Uri>
-      <Sha>0a9a366e290aded3e9bf5d082d6beee5ff560177</Sha>
+      <Sha>069f540c174aab3d2c0501d339ab49c14a2b3c19</Sha>
     </Dependency>
     <Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview5-27618-16">
       <Uri>https://github.com/dotnet/core-setup</Uri>
index 11412f2..5f8b13d 100644 (file)
@@ -9,8 +9,8 @@
     <UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
     <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.19179.4</MicrosoftDotNetXUnitConsoleRunnerVersion>
     <MicrosoftNetFrameworkReferenceAssembliesVersion>1.0.0-alpha-004</MicrosoftNetFrameworkReferenceAssembliesVersion>
-    <MicrosoftPrivateCoreFxNETCoreAppVersion>4.6.0-preview5.19218.11</MicrosoftPrivateCoreFxNETCoreAppVersion>
-    <MicrosoftNETCorePlatformsVersion>3.0.0-preview5.19218.11</MicrosoftNETCorePlatformsVersion>
+    <MicrosoftPrivateCoreFxNETCoreAppVersion>4.6.0-preview5.19219.5</MicrosoftPrivateCoreFxNETCoreAppVersion>
+    <MicrosoftNETCorePlatformsVersion>3.0.0-preview5.19219.5</MicrosoftNETCorePlatformsVersion>
     <MicrosoftNETCoreAppVersion>3.0.0-preview5-27618-16</MicrosoftNETCoreAppVersion>
     <optimizationIBCCoreCLRVersion>99.99.99-master-20190313.3</optimizationIBCCoreCLRVersion>
     <optimizationPGOCoreCLRVersion>99.99.99-master-20190313.3</optimizationPGOCoreCLRVersion>
index b787cc9..57b3195 100644 (file)
@@ -1451,16 +1451,6 @@ namespace System.Runtime.Intrinsics.X86
         public static unsafe void StoreHigh(double* address, Vector128<double> source) { throw new PlatformNotSupportedException(); }
 
         /// <summary>
-        /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a)
-        ///   MOVQ m64, xmm
-        /// </summary>
-        public static unsafe void StoreLow(long* address, Vector128<long> source) { throw new PlatformNotSupportedException(); }
-        /// <summary>
-        /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a)
-        ///   MOVQ m64, xmm
-        /// </summary>
-        public static unsafe void StoreLow(ulong* address, Vector128<ulong> source) { throw new PlatformNotSupportedException(); }
-        /// <summary>
         /// void _mm_storel_pd (double* mem_addr, __m128d a)
         ///   MOVLPD m64, xmm
         /// </summary>
index ad67445..3aff2b4 100644 (file)
@@ -1457,16 +1457,6 @@ namespace System.Runtime.Intrinsics.X86
         public static unsafe void StoreHigh(double* address, Vector128<double> source) => StoreHigh(address, source);
 
         /// <summary>
-        /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a)
-        ///   MOVQ m64, xmm
-        /// </summary>
-        public static unsafe void StoreLow(long* address, Vector128<long> source) => StoreLow(address, source);
-        /// <summary>
-        /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a)
-        ///   MOVQ m64, xmm
-        /// </summary>
-        public static unsafe void StoreLow(ulong* address, Vector128<ulong> source) => StoreLow(address, source);
-        /// <summary>
         /// void _mm_storel_pd (double* mem_addr, __m128d a)
         ///   MOVLPD m64, xmm
         /// </summary>
index 87b742f..31e8ac1 100644 (file)
@@ -1347,7 +1347,7 @@ namespace System.Text
             // Turn the 8 ASCII chars we just read into 8 ASCII bytes, then copy it to the destination.
 
             Vector128<byte> asciiVector = Sse2.PackUnsignedSaturate(utf16VectorFirst, utf16VectorFirst);
-            Sse2.StoreLow((ulong*)pAsciiBuffer, asciiVector.AsUInt64()); // ulong* calculated here is UNALIGNED
+            Sse2.StoreScalar((ulong*)pAsciiBuffer, asciiVector.AsUInt64()); // ulong* calculated here is UNALIGNED
 
             nuint currentOffsetInElements = SizeOfVector128 / 2; // we processed 8 elements so far
 
@@ -1386,7 +1386,7 @@ namespace System.Text
 
                 // Turn the 8 ASCII chars we just read into 8 ASCII bytes, then copy it to the destination.
                 asciiVector = Sse2.PackUnsignedSaturate(utf16VectorFirst, utf16VectorFirst);
-                Sse2.StoreLow((ulong*)(pAsciiBuffer + currentOffsetInElements), asciiVector.AsUInt64()); // ulong* calculated here is UNALIGNED
+                Sse2.StoreScalar((ulong*)(pAsciiBuffer + currentOffsetInElements), asciiVector.AsUInt64()); // ulong* calculated here is UNALIGNED
             }
 
             // Calculate how many elements we wrote in order to get pAsciiBuffer to its next alignment
@@ -1462,7 +1462,7 @@ namespace System.Text
 
             Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned.");
 
-            Sse2.StoreLow((ulong*)(pAsciiBuffer + currentOffsetInElements), asciiVector.AsUInt64()); // ulong* calculated here is aligned
+            Sse2.StoreScalar((ulong*)(pAsciiBuffer + currentOffsetInElements), asciiVector.AsUInt64()); // ulong* calculated here is aligned
             currentOffsetInElements += SizeOfVector128 / 2;
 
             goto Finish;
index 433744c..41ddfc8 100644 (file)
@@ -267,7 +267,7 @@ HARDWARE_INTRINSIC(SSE2_Store,                                      "Store",
 HARDWARE_INTRINSIC(SSE2_StoreAligned,                               "StoreAligned",                                 SSE2,         -1,              16,           2,     {INS_movdqa,            INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_invalid,        INS_movapd},            HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE2_StoreAlignedNonTemporal,                    "StoreAlignedNonTemporal",                      SSE2,         -1,              16,           2,     {INS_movntdq,           INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_invalid,        INS_movntpd},           HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE2_StoreHigh,                                  "StoreHigh",                                    SSE2,         -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movhpd},            HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics)
-HARDWARE_INTRINSIC(SSE2_StoreLow,                                   "StoreLow",                                     SSE2,         -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movq,           INS_movq,           INS_invalid,        INS_movlpd},            HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics)
+HARDWARE_INTRINSIC(SSE2_StoreLow,                                   "StoreLow",                                     SSE2,         -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movlpd},            HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE2_StoreNonTemporal,                           "StoreNonTemporal",                             SSE2,         -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_movnti,         INS_movnti,         INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid},           HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics|HW_Flag_SpecialCodeGen)
 HARDWARE_INTRINSIC(SSE2_StoreScalar,                                "StoreScalar",                                  SSE2,         -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movq,           INS_movq,           INS_invalid,        INS_movsdsse2},         HW_Category_MemoryStore,            HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE2_Subtract,                                   "Subtract",                                     SSE2,         -1,              16,           2,     {INS_psubb,             INS_psubb,          INS_psubw,          INS_psubw,          INS_psubd,          INS_psubd,          INS_psubq,          INS_psubq,          INS_invalid,        INS_subpd},             HW_Category_SimpleSIMD,             HW_Flag_NoFlag)
index df156d7..5bca688 100644 (file)
@@ -39,40 +39,6 @@ namespace IntelHardwareIntrinsicTest
                         testResult = Fail;
                     }
                 }
-
-                using (TestTable<long> intTable = new TestTable<long>(new long[2] { 1, -5 }, new long[2]))
-                {
-                    var vf = Unsafe.Read<Vector128<long>>(intTable.inArrayPtr);
-                    Sse2.StoreLow((long*)(intTable.outArrayPtr), vf);
-
-                    if (!intTable.CheckResult((x, y) => y[0] == x[0] && y[1] == 0))
-                    {
-                        Console.WriteLine("Sse2 StoreLow failed on long:");
-                        foreach (var item in intTable.outArray)
-                        {
-                            Console.Write(item + ", ");
-                        }
-                        Console.WriteLine();
-                        testResult = Fail;
-                    }
-                }
-
-                using (TestTable<ulong> intTable = new TestTable<ulong>(new ulong[2] { 1, 5 }, new ulong[2]))
-                {
-                    var vf = Unsafe.Read<Vector128<ulong>>(intTable.inArrayPtr);
-                    Sse2.StoreLow((ulong*)(intTable.outArrayPtr), vf);
-
-                    if (!intTable.CheckResult((x, y) => y[0] == x[0] && y[1] == 0))
-                    {
-                        Console.WriteLine("Sse2 StoreLow failed on ulong:");
-                        foreach (var item in intTable.outArray)
-                        {
-                            Console.Write(item + ", ");
-                        }
-                        Console.WriteLine();
-                        testResult = Fail;
-                    }
-                }
             }
 
             return testResult;
index 51d29a1..9b8f2b4 100644 (file)
@@ -39,6 +39,40 @@ namespace IntelHardwareIntrinsicTest
                         testResult = Fail;
                     }
                 }
+
+                using (TestTable<long> intTable = new TestTable<long>(new long[2] { 1, -5 }, new long[2]))
+                {
+                    var vf = Unsafe.Read<Vector128<long>>(intTable.inArrayPtr);
+                    Sse2.StoreScalar((long*)(intTable.outArrayPtr), vf);
+
+                    if (!intTable.CheckResult((x, y) => y[0] == x[0] && y[1] == 0))
+                    {
+                        Console.WriteLine("Sse2 StoreScalar failed on long:");
+                        foreach (var item in intTable.outArray)
+                        {
+                            Console.Write(item + ", ");
+                        }
+                        Console.WriteLine();
+                        testResult = Fail;
+                    }
+                }
+
+                using (TestTable<ulong> intTable = new TestTable<ulong>(new ulong[2] { 1, 5 }, new ulong[2]))
+                {
+                    var vf = Unsafe.Read<Vector128<ulong>>(intTable.inArrayPtr);
+                    Sse2.StoreScalar((ulong*)(intTable.outArrayPtr), vf);
+
+                    if (!intTable.CheckResult((x, y) => y[0] == x[0] && y[1] == 0))
+                    {
+                        Console.WriteLine("Sse2 StoreScalar failed on ulong:");
+                        foreach (var item in intTable.outArray)
+                        {
+                            Console.Write(item + ", ");
+                        }
+                        Console.WriteLine();
+                        testResult = Fail;
+                    }
+                }
             }
 
             return testResult;