Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Equals() [3/3]

bool System.Runtime.Intrinsics.Vector256< T >.Equals ( Vector256< T > other)
inline

Definition at line 1063 of file Vector256.cs.

1064 {
1065 if (Avx.IsSupported)
1066 {
1067 if (typeof(T) == typeof(float))
1068 {
1069 Vector256<float> value = Avx.Compare(this.AsSingle(), other.AsSingle(), FloatComparisonMode.OrderedEqualNonSignaling);
1070 return Avx.MoveMask(value) == 255;
1071 }
1072 if (typeof(T) == typeof(double))
1073 {
1074 Vector256<double> value2 = Avx.Compare(this.AsDouble(), other.AsDouble(), FloatComparisonMode.OrderedEqualNonSignaling);
1075 return Avx.MoveMask(value2) == 15;
1076 }
1077 }
1078 if (Avx2.IsSupported)
1079 {
1080 Vector256<byte> value3 = Avx2.CompareEqual(this.AsByte(), other.AsByte());
1081 return Avx2.MoveMask(value3) == -1;
1082 }
1083 return SoftwareFallback(in this, other);
1084 static bool SoftwareFallback(in Vector256<T> vector, Vector256<T> other)
1085 {
1086 for (int i = 0; i < Count; i++)
1087 {
1088 if (!((IEquatable<T>)(object)vector.GetElement(i)).Equals(other.GetElement(i)))
1089 {
1090 return false;
1091 }
1092 }
1093 return true;
1094 }
1095 }
static int MoveMask(Vector256< sbyte > value)
Definition Avx2.cs:1578
static Vector256< sbyte > CompareEqual(Vector256< sbyte > left, Vector256< sbyte > right)
Definition Avx2.cs:512
static new bool IsSupported
Definition Avx2.cs:15
static new bool IsSupported
Definition Avx.cs:15
static int MoveMask(Vector256< float > value)
Definition Avx.cs:662
static Vector128< float > Compare(Vector128< float > left, Vector128< float > right, FloatComparisonMode mode)
Definition Avx.cs:112

References System.Runtime.Intrinsics.X86.Avx.Compare(), System.Runtime.Intrinsics.X86.Avx2.CompareEqual(), System.Runtime.Intrinsics.Vector256< T >.Count, System.Runtime.Intrinsics.X86.Avx.IsSupported, System.Runtime.Intrinsics.X86.Avx2.IsSupported, System.Runtime.Intrinsics.X86.Avx.MoveMask(), System.Runtime.Intrinsics.X86.Avx2.MoveMask(), System.other, and System.value.

Referenced by System.Runtime.Intrinsics.Vector256< T >.Equals().