From 4a3b5393e35d4e7b625d65635c20fe9ef62855bb Mon Sep 17 00:00:00 2001 From: Fei Peng Date: Tue, 4 Dec 2018 16:06:39 -0800 Subject: [PATCH] Improve BMI2 MultiplyNoFlags APIs (dotnet/coreclr#21362) Commit migrated from https://github.com/dotnet/coreclr/commit/2217719e39762dc4bb1bb8094b4c4ab86229b004 --- .../Intrinsics/X86/Bmi2.PlatformNotSupported.cs | 21 +++++++++++++++++++-- .../src/System/Runtime/Intrinsics/X86/Bmi2.cs | 21 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs index fd0a2d8..77d3fbf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs @@ -33,9 +33,18 @@ namespace System.Runtime.Intrinsics.X86 /// /// unsigned __int64 _mulx_u64 (unsigned __int64 a, unsigned __int64 b, unsigned __int64* hi) /// MULX r64a, r64b, reg/m64 + /// The above native signature does not directly correspond to the managed signature. /// This intrinisc is only available on 64-bit processes /// - public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* high) { throw new PlatformNotSupportedException(); } + public static ulong MultiplyNoFlags(ulong left, ulong right) { throw new PlatformNotSupportedException(); } + + /// + /// unsigned __int64 _mulx_u64 (unsigned __int64 a, unsigned __int64 b, unsigned __int64* hi) + /// MULX r64a, r64b, reg/m64 + /// The above native signature does not directly correspond to the managed signature. + /// This intrinisc is only available on 64-bit processes + /// + public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) { throw new PlatformNotSupportedException(); } /// /// unsigned __int64 _pdep_u64 (unsigned __int64 a, unsigned __int64 mask) @@ -61,8 +70,16 @@ namespace System.Runtime.Intrinsics.X86 /// /// unsigned int _mulx_u32 (unsigned int a, unsigned int b, unsigned int* hi) /// MULX r32a, r32b, reg/m32 + /// The above native signature does not directly correspond to the managed signature. + /// + public static uint MultiplyNoFlags(uint left, uint right) { throw new PlatformNotSupportedException(); } + + /// + /// unsigned int _mulx_u32 (unsigned int a, unsigned int b, unsigned int* hi) + /// MULX r32a, r32b, reg/m32 + /// The above native signature does not directly correspond to the managed signature. /// - public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* high) { throw new PlatformNotSupportedException(); } + public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* low) { throw new PlatformNotSupportedException(); } /// /// unsigned int _pdep_u32 (unsigned int a, unsigned int mask) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs index f535e0a..b701fd0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs @@ -33,9 +33,18 @@ namespace System.Runtime.Intrinsics.X86 /// /// unsigned __int64 _mulx_u64 (unsigned __int64 a, unsigned __int64 b, unsigned __int64* hi) /// MULX r64a, r64b, reg/m64 + /// The above native signature does not directly correspond to the managed signature. /// This intrinisc is only available on 64-bit processes /// - public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* high) => MultiplyNoFlags(left, right, high); + public static ulong MultiplyNoFlags(ulong left, ulong right) => MultiplyNoFlags(left, right); + + /// + /// unsigned __int64 _mulx_u64 (unsigned __int64 a, unsigned __int64 b, unsigned __int64* hi) + /// MULX r64a, r64b, reg/m64 + /// The above native signature does not directly correspond to the managed signature. + /// This intrinisc is only available on 64-bit processes + /// + public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) => MultiplyNoFlags(left, right, low); /// /// unsigned __int64 _pdep_u64 (unsigned __int64 a, unsigned __int64 mask) @@ -61,8 +70,16 @@ namespace System.Runtime.Intrinsics.X86 /// /// unsigned int _mulx_u32 (unsigned int a, unsigned int b, unsigned int* hi) /// MULX r32a, r32b, reg/m32 + /// The above native signature does not directly correspond to the managed signature. + /// + public static uint MultiplyNoFlags(uint left, uint right) => MultiplyNoFlags(left, right); + + /// + /// unsigned int _mulx_u32 (unsigned int a, unsigned int b, unsigned int* hi) + /// MULX r32a, r32b, reg/m32 + /// The above native signature does not directly correspond to the managed signature. /// - public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* high) => MultiplyNoFlags(left, right, high); + public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* low) => MultiplyNoFlags(left, right, low); /// /// unsigned int _pdep_u32 (unsigned int a, unsigned int mask) -- 2.7.4