Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Improve Intel hardware intrinsic APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
FeiPengIntel committed Jun 14, 2018
1 parent e6ebea2 commit 0157aab
Show file tree
Hide file tree
Showing 40 changed files with 18 additions and 7,175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ public static class Avx
/// </summary>
public static Vector256<float> DuplicateOddIndexed(Vector256<float> value) { throw new PlatformNotSupportedException(); }

/// <summary>
/// __int8 _mm256_extract_epi8 (__m256i a, const int index)
/// HELPER
/// </summary>
public static sbyte Extract(Vector256<sbyte> value, byte index) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __int8 _mm256_extract_epi8 (__m256i a, const int index)
/// HELPER
Expand All @@ -248,11 +243,6 @@ public static class Avx
/// __int16 _mm256_extract_epi16 (__m256i a, const int index)
/// HELPER
/// </summary>
public static short Extract(Vector256<short> value, byte index) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __int16 _mm256_extract_epi16 (__m256i a, const int index)
/// HELPER
/// </summary>
public static ushort Extract(Vector256<ushort> value, byte index) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __int32 _mm256_extract_epi32 (__m256i a, const int index)
Expand Down Expand Up @@ -638,45 +628,45 @@ public static class Avx
/// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask)
/// VMASKMOVPS xmm, xmm, m128
/// </summary>
public static unsafe Vector128<float> MaskLoad(float* address, Vector128<uint> mask) { throw new PlatformNotSupportedException(); }
public static unsafe Vector128<float> MaskLoad(float* address, Vector128<float> mask) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask)
/// VMASKMOVPD xmm, xmm, m128
/// </summary>
public static unsafe Vector128<double> MaskLoad(double* address, Vector128<ulong> mask) { throw new PlatformNotSupportedException(); }
public static unsafe Vector128<double> MaskLoad(double* address, Vector128<double> mask) { throw new PlatformNotSupportedException(); }

/// <summary>
/// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask)
/// VMASKMOVPS ymm, ymm, m256
/// </summary>
public static unsafe Vector256<float> MaskLoad(float* address, Vector256<uint> mask) { throw new PlatformNotSupportedException(); }
public static unsafe Vector256<float> MaskLoad(float* address, Vector256<float> mask) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask)
/// VMASKMOVPD ymm, ymm, m256
/// </summary>
public static unsafe Vector256<double> MaskLoad(double* address, Vector256<ulong> mask) { throw new PlatformNotSupportedException(); }
public static unsafe Vector256<double> MaskLoad(double* address, Vector256<double> mask) { throw new PlatformNotSupportedException(); }

/// <summary>
/// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a)
/// VMASKMOVPS m128, xmm, xmm
/// </summary>
public static unsafe void MaskStore(float* address, Vector128<float> mask, Vector128<uint> source) { throw new PlatformNotSupportedException(); }
public static unsafe void MaskStore(float* address, Vector128<float> mask, Vector128<float> source) { throw new PlatformNotSupportedException(); }
/// <summary>
/// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a)
/// VMASKMOVPD m128, xmm, xmm
/// </summary>
public static unsafe void MaskStore(double* address, Vector128<double> mask, Vector128<ulong> source) { throw new PlatformNotSupportedException(); }
public static unsafe void MaskStore(double* address, Vector128<double> mask, Vector128<double> source) { throw new PlatformNotSupportedException(); }

/// <summary>
/// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a)
/// VMASKMOVPS m256, ymm, ymm
/// </summary>
public static unsafe void MaskStore(float* address, Vector256<float> mask, Vector256<uint> source) { throw new PlatformNotSupportedException(); }
public static unsafe void MaskStore(float* address, Vector256<float> mask, Vector256<float> source) { throw new PlatformNotSupportedException(); }
/// <summary>
/// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a)
/// VMASKMOVPD m256, ymm, ymm
/// </summary>
public static unsafe void MaskStore(double* address, Vector256<double> mask, Vector256<ulong> source) { throw new PlatformNotSupportedException(); }
public static unsafe void MaskStore(double* address, Vector256<double> mask, Vector256<double> source) { throw new PlatformNotSupportedException(); }

/// <summary>
/// __m256 _mm256_max_ps (__m256 a, __m256 b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,21 +235,6 @@ public static class Avx
/// </summary>
public static Vector256<float> DuplicateOddIndexed(Vector256<float> value) => DuplicateOddIndexed(value);

/// <summary>
/// __int8 _mm256_extract_epi8 (__m256i a, const int index)
/// HELPER
/// </summary>
public static sbyte Extract(Vector256<sbyte> value, byte index)
{
unsafe
{
index &= 0x1F;
sbyte* buffer = stackalloc sbyte[32];
Store(buffer, value);
return buffer[index];
}
}

/// <summary>
/// __int8 _mm256_extract_epi8 (__m256i a, const int index)
/// HELPER
Expand All @@ -265,20 +250,6 @@ public static byte Extract(Vector256<byte> value, byte index)
}
}

/// <summary>
/// __int16 _mm256_extract_epi16 (__m256i a, const int index)
/// HELPER
/// </summary>
public static short Extract(Vector256<short> value, byte index)
{
unsafe
{
index &= 0xF;
short* buffer = stackalloc short[16];
Store(buffer, value);
return buffer[index];
}
}

/// <summary>
/// __int16 _mm256_extract_epi16 (__m256i a, const int index)
Expand Down Expand Up @@ -825,45 +796,45 @@ public static Vector256<T> InsertVector128<T>(Vector256<T> value, Vector128<T> d
/// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask)
/// VMASKMOVPS xmm, xmm, m128
/// </summary>
public static unsafe Vector128<float> MaskLoad(float* address, Vector128<uint> mask) => MaskLoad(address, mask);
public static unsafe Vector128<float> MaskLoad(float* address, Vector128<float> mask) => MaskLoad(address, mask);
/// <summary>
/// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask)
/// VMASKMOVPD xmm, xmm, m128
/// </summary>
public static unsafe Vector128<double> MaskLoad(double* address, Vector128<ulong> mask) => MaskLoad(address, mask);
public static unsafe Vector128<double> MaskLoad(double* address, Vector128<double> mask) => MaskLoad(address, mask);

/// <summary>
/// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask)
/// VMASKMOVPS ymm, ymm, m256
/// </summary>
public static unsafe Vector256<float> MaskLoad(float* address, Vector256<uint> mask) => MaskLoad(address, mask);
public static unsafe Vector256<float> MaskLoad(float* address, Vector256<float> mask) => MaskLoad(address, mask);
/// <summary>
/// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask)
/// VMASKMOVPD ymm, ymm, m256
/// </summary>
public static unsafe Vector256<double> MaskLoad(double* address, Vector256<ulong> mask) => MaskLoad(address, mask);
public static unsafe Vector256<double> MaskLoad(double* address, Vector256<double> mask) => MaskLoad(address, mask);

/// <summary>
/// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a)
/// VMASKMOVPS m128, xmm, xmm
/// </summary>
public static unsafe void MaskStore(float* address, Vector128<float> mask, Vector128<uint> source) => MaskStore(address, mask, source);
public static unsafe void MaskStore(float* address, Vector128<float> mask, Vector128<float> source) => MaskStore(address, mask, source);
/// <summary>
/// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a)
/// VMASKMOVPD m128, xmm, xmm
/// </summary>
public static unsafe void MaskStore(double* address, Vector128<double> mask, Vector128<ulong> source) => MaskStore(address, mask, source);
public static unsafe void MaskStore(double* address, Vector128<double> mask, Vector128<double> source) => MaskStore(address, mask, source);

/// <summary>
/// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a)
/// VMASKMOVPS m256, ymm, ymm
/// </summary>
public static unsafe void MaskStore(float* address, Vector256<float> mask, Vector256<uint> source) => MaskStore(address, mask, source);
public static unsafe void MaskStore(float* address, Vector256<float> mask, Vector256<float> source) => MaskStore(address, mask, source);
/// <summary>
/// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a)
/// VMASKMOVPD m256, ymm, ymm
/// </summary>
public static unsafe void MaskStore(double* address, Vector256<double> mask, Vector256<ulong> source) => MaskStore(address, mask, source);
public static unsafe void MaskStore(double* address, Vector256<double> mask, Vector256<double> source) => MaskStore(address, mask, source);

/// <summary>
/// __m256 _mm256_max_ps (__m256 a, __m256 b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,6 @@ public static class Sse2
/// </summary>
public static Vector128<double> DivideScalar(Vector128<double> left, Vector128<double> right) { throw new PlatformNotSupportedException(); }

/// <summary>
/// int _mm_extract_epi16 (__m128i a, int immediate)
/// PEXTRW reg, xmm, imm8
/// </summary>
public static short Extract(Vector128<short> value, byte index) { throw new PlatformNotSupportedException(); }
/// <summary>
/// int _mm_extract_epi16 (__m128i a, int immediate)
/// PEXTRW reg, xmm, imm8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,6 @@ public static class Sse2
/// </summary>
public static Vector128<double> DivideScalar(Vector128<double> left, Vector128<double> right) => DivideScalar(left, right);

/// <summary>
/// int _mm_extract_epi16 (__m128i a, int immediate)
/// PEXTRW reg, xmm, imm8
/// </summary>
public static short Extract(Vector128<short> value, byte index) => Extract(value, index);
/// <summary>
/// int _mm_extract_epi16 (__m128i a, int immediate)
/// PEXTRW reg, xmm, imm8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ public static class Sse41
/// </summary>
public static Vector128<double> DotProduct(Vector128<double> left, Vector128<double> right, byte control) { throw new PlatformNotSupportedException(); }

/// <summary>
/// int _mm_extract_epi8 (__m128i a, const int imm8)
/// PEXTRB reg/m8, xmm, imm8
/// </summary>
public static sbyte Extract(Vector128<sbyte> value, byte index) { throw new PlatformNotSupportedException(); }
/// <summary>
/// int _mm_extract_epi8 (__m128i a, const int imm8)
/// PEXTRB reg/m8, xmm, imm8
Expand Down Expand Up @@ -283,7 +278,7 @@ public static class Sse41
/// __m128 _mm_insert_ps (__m128 a, __m128 b, const int imm8)
/// INSERTPS xmm, xmm/m32, imm8
/// </summary>
public static Vector128<float> Insert(Vector128<float> value, float data, byte index) { throw new PlatformNotSupportedException(); }
public static Vector128<float> Insert(Vector128<float> value, Vector128<float> data, byte index) { throw new PlatformNotSupportedException(); }

/// <summary>
/// __m128i _mm_max_epi8 (__m128i a, __m128i b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ public static class Sse41
/// </summary>
public static Vector128<double> DotProduct(Vector128<double> left, Vector128<double> right, byte control) => DotProduct(left, right, control);

/// <summary>
/// int _mm_extract_epi8 (__m128i a, const int imm8)
/// PEXTRB reg/m8, xmm, imm8
/// </summary>
public static sbyte Extract(Vector128<sbyte> value, byte index) => Extract(value, index);
/// <summary>
/// int _mm_extract_epi8 (__m128i a, const int imm8)
/// PEXTRB reg/m8, xmm, imm8
Expand Down Expand Up @@ -283,7 +278,7 @@ public static class Sse41
/// __m128 _mm_insert_ps (__m128 a, __m128 b, const int imm8)
/// INSERTPS xmm, xmm/m32, imm8
/// </summary>
public static Vector128<float> Insert(Vector128<float> value, float data, byte index) => Insert(value, data, index);
public static Vector128<float> Insert(Vector128<float> value, Vector128<float> data, byte index) => Insert(value, data, index);

/// <summary>
/// __m128i _mm_max_epi8 (__m128i a, __m128i b)
Expand Down
6 changes: 0 additions & 6 deletions tests/src/JIT/HardwareIntrinsics/X86/Avx/Avx_r.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@
<Compile Include="DuplicateEvenIndexed.Single.cs" />
<Compile Include="DuplicateOddIndexed.Single.cs" />
<Compile Include="Extract.Byte.1.cs" />
<Compile Include="Extract.SByte.1.cs" />
<Compile Include="Extract.Byte.20.cs" />
<Compile Include="Extract.SByte.20.cs" />
<Compile Include="Extract.Int16.1.cs" />
<Compile Include="Extract.UInt16.1.cs" />
<Compile Include="Extract.Int16.11.cs" />
<Compile Include="Extract.UInt16.11.cs" />
<Compile Include="Extract.Int32.1.cs" />
<Compile Include="Extract.UInt32.1.cs" />
Expand All @@ -61,8 +57,6 @@
<Compile Include="Extract.Int64.3.cs" />
<Compile Include="Extract.UInt64.3.cs" />
<Compile Include="Extract.Byte.52.cs" />
<Compile Include="Extract.SByte.52.cs" />
<Compile Include="Extract.Int16.27.cs" />
<Compile Include="Extract.UInt16.27.cs" />
<Compile Include="Extract.Int32.22.cs" />
<Compile Include="Extract.UInt32.22.cs" />
Expand Down
6 changes: 0 additions & 6 deletions tests/src/JIT/HardwareIntrinsics/X86/Avx/Avx_ro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@
<Compile Include="DuplicateEvenIndexed.Single.cs" />
<Compile Include="DuplicateOddIndexed.Single.cs" />
<Compile Include="Extract.Byte.1.cs" />
<Compile Include="Extract.SByte.1.cs" />
<Compile Include="Extract.Byte.20.cs" />
<Compile Include="Extract.SByte.20.cs" />
<Compile Include="Extract.Int16.1.cs" />
<Compile Include="Extract.UInt16.1.cs" />
<Compile Include="Extract.Int16.11.cs" />
<Compile Include="Extract.UInt16.11.cs" />
<Compile Include="Extract.Int32.1.cs" />
<Compile Include="Extract.UInt32.1.cs" />
Expand All @@ -61,8 +57,6 @@
<Compile Include="Extract.Int64.3.cs" />
<Compile Include="Extract.UInt64.3.cs" />
<Compile Include="Extract.Byte.52.cs" />
<Compile Include="Extract.SByte.52.cs" />
<Compile Include="Extract.Int16.27.cs" />
<Compile Include="Extract.UInt16.27.cs" />
<Compile Include="Extract.Int32.22.cs" />
<Compile Include="Extract.UInt32.22.cs" />
Expand Down
Loading

0 comments on commit 0157aab

Please sign in to comment.