/
Sse42.cs
57 lines (49 loc) · 2.03 KB
/
Sse42.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.CompilerServices;
namespace System.Runtime.Intrinsics.X86
{
/// <summary>
/// This class provides access to Intel SSE4.2 hardware instructions via intrinsics
/// </summary>
[Intrinsic]
[CLSCompliant(false)]
public abstract class Sse42 : Sse41
{
internal Sse42() { }
public static new bool IsSupported { get => IsSupported; }
[Intrinsic]
public new abstract class X64 : Sse41.X64
{
internal X64() { }
public static new bool IsSupported { get => IsSupported; }
/// <summary>
/// unsigned __int64 _mm_crc32_u64 (unsigned __int64 crc, unsigned __int64 v)
/// CRC32 r64, r/m64
/// This intrinsic is only available on 64-bit processes
/// </summary>
public static ulong Crc32(ulong crc, ulong data) => Crc32(crc, data);
}
/// <summary>
/// __m128i _mm_cmpgt_epi64 (__m128i a, __m128i b)
/// PCMPGTQ xmm1, xmm2/m128
/// VPCMPGTQ xmm1, xmm2, xmm3/m128
/// </summary>
public static Vector128<long> CompareGreaterThan(Vector128<long> left, Vector128<long> right) => CompareGreaterThan(left, right);
/// <summary>
/// unsigned int _mm_crc32_u8 (unsigned int crc, unsigned char v)
/// CRC32 r32, r/m8
/// </summary>
public static uint Crc32(uint crc, byte data) => Crc32(crc, data);
/// <summary>
/// unsigned int _mm_crc32_u16 (unsigned int crc, unsigned short v)
/// CRC32 r32, r/m16
/// </summary>
public static uint Crc32(uint crc, ushort data) => Crc32(crc, data);
/// <summary>
/// unsigned int _mm_crc32_u32 (unsigned int crc, unsigned int v)
/// CRC32 r32, r/m32
/// </summary>
public static uint Crc32(uint crc, uint data) => Crc32(crc, data);
}
}