123 references to As
System.Numerics.Tensors (91)
System\Numerics\Tensors\netcore\TensorPrimitives.Cbrt.cs (2)
63return ExpOperator<float>.Invoke(LogOperator<float>.Invoke(x.AsSingle()) / Vector512.Create(3f)).As<float, T>(); 68return ExpOperator<double>.Invoke(LogOperator<double>.Invoke(x.AsDouble()) / Vector512.Create(3d)).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Ceiling.cs (2)
61return Vector512.Ceiling(x.AsSingle()).As<float, T>(); 66return Vector512.Ceiling(x.AsDouble()).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertToInteger.cs (4)
78if (typeof(TTo) == typeof(int)) return Vector512.ConvertToInt32(x.AsSingle()).As<int, TTo>(); 79if (typeof(TTo) == typeof(uint)) return Vector512.ConvertToUInt32(x.AsSingle()).As<uint, TTo>(); 84if (typeof(TTo) == typeof(long)) return Vector512.ConvertToInt64(x.AsDouble()).As<long, TTo>(); 85if (typeof(TTo) == typeof(ulong)) return Vector512.ConvertToUInt64(x.AsDouble()).As<ulong, TTo>();
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertToIntegerNative.cs (4)
78if (typeof(TTo) == typeof(int)) return Vector512.ConvertToInt32Native(x.AsSingle()).As<int, TTo>(); 79if (typeof(TTo) == typeof(uint)) return Vector512.ConvertToUInt32Native(x.AsSingle()).As<uint, TTo>(); 84if (typeof(TTo) == typeof(long)) return Vector512.ConvertToInt64Native(x.AsDouble()).As<long, TTo>(); 85if (typeof(TTo) == typeof(ulong)) return Vector512.ConvertToUInt64Native(x.AsDouble()).As<ulong, TTo>();
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (2)
123return Vector512.Cos(x.AsDouble()).As<double, T>(); 128return Vector512.Cos(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (2)
123return (Vector512.Create((float)Single_HALFV) * (z + (Vector512.Create((float)Single_INVV2) / z))).As<float, T>(); 132return (Vector512.Create(Double_HALFV) * (z + (Vector512.Create(Double_INVV2) / z))).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (2)
95return ApplyScalar<CosPiOperator<float>>(x.AsSingle()).As<float, T>(); 103return ApplyScalar<CosPiOperator<double>>(x.AsDouble()).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.DegreesToRadians.cs (2)
71return Vector512.DegreesToRadians(x.AsDouble()).As<double, T>(); 76return Vector512.DegreesToRadians(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (2)
97return Vector512.Exp(x.AsDouble()).As<double, T>(); 102return Vector512.Exp(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (2)
61return Vector512.Floor(x.AsSingle()).As<float, T>(); 66return Vector512.Floor(x.AsDouble()).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (2)
184return Vector512.FusedMultiplyAdd(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>(); 189return Vector512.FusedMultiplyAdd(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Hypot.cs (2)
75return Vector512.Hypot(x.AsDouble(), y.AsDouble()).As<double, T>(); 80return Vector512.Hypot(x.AsSingle(), y.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMax.cs (19)
99Vector512<T> sameSign = Vector512.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As<int, T>(); 154sizeof(T) == sizeof(long) ? Vector512.Create((long)i).As<long, T>() : 155sizeof(T) == sizeof(int) ? Vector512.Create(i).As<int, T>() : 156sizeof(T) == sizeof(short) ? Vector512.Create((short)i).As<short, T>() : 157Vector512.Create((byte)i).As<byte, T>(); 162sizeof(T) == sizeof(long) ? Vector512<long>.Indices.As<long, T>() : 163sizeof(T) == sizeof(int) ? Vector512<int>.Indices.As<int, T>() : 164sizeof(T) == sizeof(short) ? Vector512<short>.Indices.As<short, T>() : 165Vector512<byte>.Indices.As<byte, T>(); 227(int)(long)(object)currentIndex.As<T, long>()[indexInVectorOfFirstMatch] : 228(int)(object)currentIndex.As<T, int>()[indexInVectorOfFirstMatch]; 461sizeof(T) == sizeof(long) ? Vector512.LessThan(indices1.AsInt64(), indices2.AsInt64()).As<long, T>() : 462sizeof(T) == sizeof(int) ? Vector512.LessThan(indices1.AsInt32(), indices2.AsInt32()).As<int, T>() : 463sizeof(T) == sizeof(short) ? Vector512.LessThan(indices1.AsInt16(), indices2.AsInt16()).As<short, T>() : 464Vector512.LessThan(indices1.AsByte(), indices2.AsByte()).As<byte, T>(); 508if (typeof(T) == typeof(float)) return Avx512F.BlendVariable(left.AsSingle(), right.AsSingle(), (~mask).AsSingle()).As<float, T>(); 509if (typeof(T) == typeof(double)) return Avx512F.BlendVariable(left.AsDouble(), right.AsDouble(), (~mask).AsDouble()).As<double, T>(); 511if (sizeof(T) == 4) return Avx512F.BlendVariable(left.AsUInt32(), right.AsUInt32(), (~mask).AsUInt32()).As<uint, T>(); 512if (sizeof(T) == 8) return Avx512F.BlendVariable(left.AsUInt64(), right.AsUInt64(), (~mask).AsUInt64()).As<ulong, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMaxMagnitude.cs (1)
99Vector512<T> sameSign = Vector512.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As<int, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMin.cs (1)
96Vector512<T> sameSign = Vector512.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As<int, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMinMagnitude.cs (1)
99Vector512<T> sameSign = Vector512.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As<int, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (4)
155return Avx512F.And(bit7ZeroMask, Avx512Vbmi.PermuteVar64x8x2(lookupVectorA, x.AsByte(), lookupVectorB)).As<byte, T>(); 168return Avx512F.Or(lz_bot16, lz_top16_shift).AsUInt16().As<ushort, T>(); 173return Avx512CD.LeadingZeroCount(x.AsUInt32()).As<uint, T>(); 178return Avx512CD.LeadingZeroCount(x.AsUInt64()).As<ulong, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Lerp.cs (2)
119return Vector512.Lerp(x.AsDouble(), y.AsDouble(), amount.AsDouble()).As<double, T>(); 124return Vector512.Lerp(x.AsSingle(), y.AsSingle(), amount.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (2)
139return Vector512.Log(x.AsDouble()).As<double, T>(); 144return Vector512.Log(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (2)
99return Vector512.Log2(x.AsDouble()).As<double, T>(); 104return Vector512.Log2(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAddEstimate.cs (2)
185return Vector512.MultiplyAddEstimate(x.AsDouble(), y.AsDouble(), z.AsDouble()).As<double, T>(); 189return Vector512.MultiplyAddEstimate(x.AsSingle(), y.AsSingle(), z.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.PopCount.cs (3)
199return ((tmp + (tmp.AsUInt16() >> 4).AsByte()) & c3).As<byte, T>(); 213return tmp.As<ushort, T>(); 227return tmp.As<uint, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Pow.cs (2)
96return ExpOperator<float>.Invoke(y.AsSingle() * LogOperator<float>.Invoke(x.AsSingle())).As<float, T>(); 101return ExpOperator<double>.Invoke(y.AsDouble() * LogOperator<double>.Invoke(x.AsDouble())).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.RadiansToDegrees.cs (2)
71return Vector512.RadiansToDegrees(x.AsDouble()).As<double, T>(); 76return Vector512.RadiansToDegrees(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Reciprocal.cs (4)
147if (typeof(T) == typeof(float)) return Avx512F.Reciprocal14(x.AsSingle()).As<float, T>(); 148if (typeof(T) == typeof(double)) return Avx512F.Reciprocal14(x.AsDouble()).As<double, T>(); 213if (typeof(T) == typeof(float)) return Avx512F.ReciprocalSqrt14(x.AsSingle()).As<float, T>(); 214if (typeof(T) == typeof(double)) return Avx512F.ReciprocalSqrt14(x.AsDouble()).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Remainder.cs (2)
87typeof(T) == typeof(float) ? x - (TruncateOperator<float>.Invoke((x / y).AsSingle()).As<float, T>() * y) : 88typeof(T) == typeof(double) ? x - (TruncateOperator<double>.Invoke((x / y).AsDouble()).As<double, T>() * y) :
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (4)
222return Vector512.Round(x.AsDouble()).As<double, T>(); 227return Vector512.Round(x.AsSingle()).As<float, T>(); 284return TruncateOperator<float>.Invoke(x.AsSingle() + CopySignOperator<float>.Invoke(Vector512.Create(0.49999997f), x.AsSingle())).As<float, T>(); 289return TruncateOperator<double>.Invoke(x.AsDouble() + CopySignOperator<double>.Invoke(Vector512.Create(0.49999999999999994), x.AsDouble())).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (2)
113return Vector512.Sin(x.AsDouble()).As<double, T>(); 118return Vector512.Sin(x.AsSingle()).As<float, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (2)
115return (sign ^ result.AsUInt32()).As<uint, T>(); 126return (sign ^ result.AsUInt64()).As<ulong, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (2)
95return ApplyScalar<SinPiOperator<float>>(x.AsSingle()).As<float, T>(); 103return ApplyScalar<SinPiOperator<double>>(x.AsDouble()).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (2)
91return TanOperatorSingle.Invoke(x.AsSingle()).As<float, T>(); 96return TanOperatorDouble.Invoke(x.AsDouble()).As<double, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Tanh.cs (2)
116return (sign ^ (-z / (z + Vector512.Create(2f))).AsUInt32()).As<uint, T>(); 125return (sign ^ (-z / (z + Vector512.Create(2d))).AsUInt64()).As<ulong, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (2)
108return Vector512.Truncate(x.AsDouble()).As<double, T>(); 113return Vector512.Truncate(x.AsSingle()).As<float, T>();
System.Private.CoreLib (32)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (30)
175public static Vector512<byte> AsByte<T>(this Vector512<T> vector) => vector.As<T, byte>(); 183public static Vector512<double> AsDouble<T>(this Vector512<T> vector) => vector.As<T, double>(); 191public static Vector512<short> AsInt16<T>(this Vector512<T> vector) => vector.As<T, short>(); 199public static Vector512<int> AsInt32<T>(this Vector512<T> vector) => vector.As<T, int>(); 207public static Vector512<long> AsInt64<T>(this Vector512<T> vector) => vector.As<T, long>(); 215public static Vector512<nint> AsNInt<T>(this Vector512<T> vector) => vector.As<T, nint>(); 224public static Vector512<nuint> AsNUInt<T>(this Vector512<T> vector) => vector.As<T, nuint>(); 233public static Vector512<sbyte> AsSByte<T>(this Vector512<T> vector) => vector.As<T, sbyte>(); 241public static Vector512<float> AsSingle<T>(this Vector512<T> vector) => vector.As<T, float>(); 250public static Vector512<ushort> AsUInt16<T>(this Vector512<T> vector) => vector.As<T, ushort>(); 259public static Vector512<uint> AsUInt32<T>(this Vector512<T> vector) => vector.As<T, uint>(); 268public static Vector512<ulong> AsUInt64<T>(this Vector512<T> vector) => vector.As<T, ulong>(); 1990return VectorMath.IsEvenIntegerSingle<Vector512<float>, Vector512<uint>>(vector.AsSingle()).As<float, T>(); 1994return VectorMath.IsEvenIntegerDouble<Vector512<double>, Vector512<ulong>>(vector.AsDouble()).As<double, T>(); 2006return ~IsZero(AndNot(Create<uint>(float.PositiveInfinityBits), vector.AsUInt32())).As<uint, T>(); 2010return ~IsZero(AndNot(Create<ulong>(double.PositiveInfinityBits), vector.AsUInt64())).As<ulong, T>(); 2066return LessThan(vector.AsInt32(), Vector512<int>.Zero).As<int, T>(); 2070return LessThan(vector.AsInt64(), Vector512<long>.Zero).As<long, T>(); 2085return Equals(vector, Create(float.NegativeInfinity).As<float, T>()); 2089return Equals(vector, Create(double.NegativeInfinity).As<double, T>()); 2101return LessThan(Abs(vector).AsUInt32() - Create<uint>(float.SmallestNormalBits), Create<uint>(float.PositiveInfinityBits - float.SmallestNormalBits)).As<uint, T>(); 2105return LessThan(Abs(vector).AsUInt64() - Create<ulong>(double.SmallestNormalBits), Create<ulong>(double.PositiveInfinityBits - double.SmallestNormalBits)).As<ulong, T>(); 2117return VectorMath.IsOddIntegerSingle<Vector512<float>, Vector512<uint>>(vector.AsSingle()).As<float, T>(); 2121return VectorMath.IsOddIntegerDouble<Vector512<double>, Vector512<ulong>>(vector.AsDouble()).As<double, T>(); 2141return GreaterThanOrEqual(vector.AsInt32(), Vector512<int>.Zero).As<int, T>(); 2145return GreaterThanOrEqual(vector.AsInt64(), Vector512<long>.Zero).As<long, T>(); 2160return Equals(vector, Create(float.PositiveInfinity).As<float, T>()); 2164return Equals(vector, Create(double.PositiveInfinity).As<double, T>()); 2176return LessThan(Abs(vector).AsUInt32() - Vector512<uint>.One, Create<uint>(float.MaxTrailingSignificand)).As<uint, T>(); 2180return LessThan(Abs(vector).AsUInt64() - Vector512<ulong>.One, Create<ulong>(double.MaxTrailingSignificand)).As<ulong, T>();
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512_1.cs (2)
343return vector ^ Vector512.Create(-0.0f).As<float, T>(); 347return vector ^ Vector512.Create(-0.0).As<double, T>();