Nullable: System.Runtime.Intrinsics
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / Runtime / Intrinsics / X86 / Sse3.cs
blobf7a710b4fc6fe8e6615257ff0be18ff1da24d551
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 #nullable enable
6 using System;
7 using System.Runtime.CompilerServices;
8 using System.Runtime.Intrinsics;
10 namespace System.Runtime.Intrinsics.X86
12 /// <summary>
13 /// This class provides access to Intel SSE3 hardware instructions via intrinsics
14 /// </summary>
15 [Intrinsic]
16 [CLSCompliant(false)]
17 public abstract class Sse3 : Sse2
19 internal Sse3() { }
21 public new static bool IsSupported { get => IsSupported; }
23 /// <summary>
24 /// __m128 _mm_addsub_ps (__m128 a, __m128 b)
25 /// ADDSUBPS xmm, xmm/m128
26 /// </summary>
27 public static Vector128<float> AddSubtract(Vector128<float> left, Vector128<float> right) => AddSubtract(left, right);
28 /// <summary>
29 /// __m128d _mm_addsub_pd (__m128d a, __m128d b)
30 /// ADDSUBPD xmm, xmm/m128
31 /// </summary>
32 public static Vector128<double> AddSubtract(Vector128<double> left, Vector128<double> right) => AddSubtract(left, right);
34 /// <summary>
35 /// __m128 _mm_hadd_ps (__m128 a, __m128 b)
36 /// HADDPS xmm, xmm/m128
37 /// </summary>
38 public static Vector128<float> HorizontalAdd(Vector128<float> left, Vector128<float> right) => HorizontalAdd(left, right);
39 /// <summary>
40 /// __m128d _mm_hadd_pd (__m128d a, __m128d b)
41 /// HADDPD xmm, xmm/m128
42 /// </summary>
43 public static Vector128<double> HorizontalAdd(Vector128<double> left, Vector128<double> right) => HorizontalAdd(left, right);
45 /// <summary>
46 /// __m128 _mm_hsub_ps (__m128 a, __m128 b)
47 /// HSUBPS xmm, xmm/m128
48 /// </summary>
49 public static Vector128<float> HorizontalSubtract(Vector128<float> left, Vector128<float> right) => HorizontalSubtract(left, right);
50 /// <summary>
51 /// __m128d _mm_hsub_pd (__m128d a, __m128d b)
52 /// HSUBPD xmm, xmm/m128
53 /// </summary>
54 public static Vector128<double> HorizontalSubtract(Vector128<double> left, Vector128<double> right) => HorizontalSubtract(left, right);
56 /// <summary>
57 /// __m128d _mm_loaddup_pd (double const* mem_addr)
58 /// MOVDDUP xmm, m64
59 /// </summary>
60 public static unsafe Vector128<double> LoadAndDuplicateToVector128(double* address) => LoadAndDuplicateToVector128(address);
62 /// <summary>
63 /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr)
64 /// LDDQU xmm, m128
65 /// </summary>
66 public static unsafe Vector128<sbyte> LoadDquVector128(sbyte* address) => LoadDquVector128(address);
67 public static unsafe Vector128<byte> LoadDquVector128(byte* address) => LoadDquVector128(address);
68 public static unsafe Vector128<short> LoadDquVector128(short* address) => LoadDquVector128(address);
69 public static unsafe Vector128<ushort> LoadDquVector128(ushort* address) => LoadDquVector128(address);
70 public static unsafe Vector128<int> LoadDquVector128(int* address) => LoadDquVector128(address);
71 public static unsafe Vector128<uint> LoadDquVector128(uint* address) => LoadDquVector128(address);
72 public static unsafe Vector128<long> LoadDquVector128(long* address) => LoadDquVector128(address);
73 public static unsafe Vector128<ulong> LoadDquVector128(ulong* address) => LoadDquVector128(address);
75 /// <summary>
76 /// __m128d _mm_movedup_pd (__m128d a)
77 /// MOVDDUP xmm, xmm/m64
78 /// </summary>
79 public static Vector128<double> MoveAndDuplicate(Vector128<double> source) => MoveAndDuplicate(source);
81 /// <summary>
82 /// __m128 _mm_movehdup_ps (__m128 a)
83 /// MOVSHDUP xmm, xmm/m128
84 /// </summary>
85 public static Vector128<float> MoveHighAndDuplicate(Vector128<float> source) => MoveHighAndDuplicate(source);
87 /// <summary>
88 /// __m128 _mm_moveldup_ps (__m128 a)
89 /// MOVSLDUP xmm, xmm/m128
90 /// </summary>
91 public static Vector128<float> MoveLowAndDuplicate(Vector128<float> source) => MoveLowAndDuplicate(source);