2 types derived from Avx
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Avx2.cs (1)
12public abstract class Avx2 : Avx
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Fma.cs (1)
11public abstract class Fma : Avx
212 references to Avx
Microsoft.ML.CpuMath (177)
AvxIntrinsics.cs (131)
73=> Avx.ExtractVector128(x, 1); 80Vector256<int> idx256 = Avx.LoadVector256(idx); 113Vector256<float> partialSum = Avx.HorizontalAdd(vector, vector); 114return Avx.HorizontalAdd(partialSum, partialSum); 121Vector256<float> x1 = Avx.Shuffle(vector, vector, 0xB1); 125Vector256<float> partialMax = Avx.Max(vector, x1); 128x1 = Avx.Shuffle(partialMax, partialMax, 0x02); 133return Avx.Max(partialMax, x1); 140Vector256<float> xSign = Avx.And(xDst1, signMask); // result = 0x8000 0000 if xDst1 is negative or 0x0000 0000 otherwise 141Vector256<float> xDst1Abs = Avx.Xor(xDst1, xSign); 142Vector256<float> xCond = Avx.Compare(xDst1Abs, xThreshold, FloatComparisonMode.OrderedGreaterThanNonSignaling); // result = 0xFFFF FFFF if true 143Vector256<float> x2 = Avx.Xor(xSign, xThreshold); // -xThreshold if xDst1 is negative and +xThreshold otherwise 144return Avx.And(Avx.Subtract(xDst1, x2), xCond); 152return Fma.MultiplyAdd(Avx.LoadVector256(psrc1), src2, src3); 156Vector256<float> product = Avx.Multiply(src2, Avx.LoadVector256(psrc1)); 157return Avx.Add(product, src3); 170Vector256<float> product = Avx.Multiply(src1, src2); 171return Avx.Add(product, src3); 215Vector256<float> x01 = Avx.LoadVector256(pMatTemp); 216Vector256<float> x11 = Avx.LoadVector256(pMatTemp += ccol); 217Vector256<float> x21 = Avx.LoadVector256(pMatTemp += ccol); 218Vector256<float> x31 = Avx.LoadVector256(pMatTemp += ccol); 219Vector256<float> x02 = Avx.LoadVector256(pSrcCurrent); 231res0 = Avx.HorizontalAdd(res0, res1); 232res2 = Avx.HorizontalAdd(res2, res3); 233res0 = Avx.HorizontalAdd(res0, res2); 286x2 = Avx.Multiply(x2, x1); 287result = Avx.Add(result, x2); 292Avx.StoreAligned(pDstCurrent, result); 345Vector256<float> x02 = Avx.LoadVector256(pMatTemp); 346Vector256<float> x12 = Avx.LoadVector256(pMatTemp += crow); 347Vector256<float> x22 = Avx.LoadVector256(pMatTemp += crow); 348Vector256<float> x32 = Avx.LoadVector256(pMatTemp += crow); 350x02 = Avx.Multiply(x01, x02); 353x22 = Avx.Multiply(x21, x22); 356x02 = Avx.Add(x02, x22); 357Avx.StoreAligned(pDstCurrent, x02); 393Vector256<float> x02 = Avx.LoadVector256(pMatTemp); 394Vector256<float> x12 = Avx.LoadVector256(pMatTemp += crow); 395Vector256<float> x22 = Avx.LoadVector256(pMatTemp += crow); 396Vector256<float> x32 = Avx.LoadVector256(pMatTemp += crow); 397Vector256<float> x3 = Avx.LoadVector256(pDstCurrent); 399x02 = Avx.Multiply(x01, x02); 402x22 = Avx.Multiply(x21, x22); 405x02 = Avx.Add(x02, x22); 406x3 = Avx.Add(x02, x3); 407Avx.StoreAligned(pDstCurrent, x3); 432Vector256<float> dstVector = Avx.LoadVector256(pDstCurrent); 433dstVector = Avx.Add(dstVector, scalarVector256); 434Avx.Store(pDstCurrent, dstVector); 482Vector256<float> temp = Avx.LoadVector256(pDstCurrent); 483temp = Avx.Multiply(scaleVector256, temp); 484Avx.Store(pDstCurrent, temp); 497Vector256<float> result = Avx.LoadVector256(pDstCurrent); 499Vector256<float> leadingMask = Avx.LoadVector256(((float*)(pLeadingAlignmentMask)) + (misalignment * 8)); 500Vector256<float> trailingMask = Avx.LoadVector256(((float*)(pTrailingAlignmentMask)) + ((8 - misalignment) * 8)); 502Vector256<float> temp = Avx.And(result, trailingMask); 503result = Avx.Multiply(scaleVector256, result); 506result = Avx.And(result, leadingMask); 507result = Avx.Or(result, temp); 509Avx.Store(pDstCurrent, result); 530Vector256<float> temp = Avx.LoadVector256(pDstCurrent); 531temp = Avx.Multiply(scaleVector256, temp); 532Avx.Store(pDstCurrent, temp); 551Vector256<float> result = Avx.LoadVector256(pDstCurrent); 553Vector256<float> trailingMask = Avx.LoadVector256(((float*)(pTrailingAlignmentMask)) + (remainder * 8)); 554Vector256<float> leadingMask = Avx.LoadVector256(((float*)(pLeadingAlignmentMask)) + ((8 - remainder) * 8)); 556Vector256<float> temp = Avx.And(result, leadingMask); 557result = Avx.Multiply(scaleVector256, result); 560result = Avx.And(result, trailingMask); 561result = Avx.Or(result, temp); 563Avx.Store(pDstCurrent, result); 584Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 585srcVector = Avx.Multiply(srcVector, scaleVector256); 586Avx.Store(pDstCurrent, srcVector); 630Vector256<float> dstVector = Avx.LoadVector256(pDstCurrent); 631dstVector = Avx.Add(dstVector, b256); 632dstVector = Avx.Multiply(dstVector, a256); 633Avx.Store(pDstCurrent, dstVector); 678Vector256<float> dstVector = Avx.LoadVector256(pDstCurrent); 681Avx.Store(pDstCurrent, dstVector); 735Vector256<float> dstVector = Avx.LoadVector256(pDstCurrent); 737Avx.Store(pResCurrent, dstVector); 838Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 839Vector256<float> dstVector = Avx.LoadVector256(pDstCurrent); 841Vector256<float> result = Avx.Add(srcVector, dstVector); 842Avx.Store(pDstCurrent, result); 891Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 893dstVector = Avx.Add(dstVector, srcVector); 938Vector256<float> src1Vector = Avx.LoadVector256(pSrc1Current); 939Vector256<float> src2Vector = Avx.LoadVector256(pSrc2Current); 940src2Vector = Avx.Multiply(src1Vector, src2Vector); 941Avx.Store(pDstCurrent, src2Vector); 996result = Avx.Add(result, Avx.LoadVector256(pValues)); 1009Vector256<float> mask = Avx.LoadVector256(((float*)(pLeadingAlignmentMask)) + (misalignment * 8)); 1010Vector256<float> temp = Avx.And(mask, Avx.LoadVector256(pValues)); 1011result = Avx.Add(result, temp); 1032result = Avx.Add(result, Avx.LoadVector256(pValues)); 1051Vector256<float> mask = Avx.LoadVector256(((float*)(pTrailingAlignmentMask)) + (remainder * 8)); 1052Vector256<float> temp = Avx.And(mask, Avx.LoadVector256(pValues)); 1053result = Avx.Add(result, temp); 1073Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 1118Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 1119srcVector = Avx.Subtract(srcVector, meanVector256); 1165Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 1166result256 = Avx.Add(result256, Avx.And(srcVector, _absMask256)); 1210Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 1211srcVector = Avx.Subtract(srcVector, meanVector256); 1212result256 = Avx.Add(result256, Avx.And(srcVector, _absMask256)); 1258Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 1259result256 = Avx.Max(result256, Avx.And(srcVector, _absMask256)); 1303Vector256<float> srcVector = Avx.LoadVector256(pSrcCurrent); 1304srcVector = Avx.Subtract(srcVector, meanVector256); 1305result256 = Avx.Max(result256, Avx.And(srcVector, _absMask256)); 1355Vector256<float> dstVector = Avx.LoadVector256(pDstCurrent); 1466Vector256<float> distanceVector = Avx.Subtract(Avx.LoadVector256(pSrcCurrent), 1467Avx.LoadVector256(pDstCurrent)); 1521Vector256<float> xDst1 = Avx.LoadVector256(pDst1Current); 1525Avx.Store(pDst1Current, xDst1); 1526Avx.Store(pDst2Current, xDst2);
CpuMathUtils.netcoreapp.cs (13)
29=> Avx.IsSupported ? Vector256Alignment : (Sse.IsSupported ? Vector128Alignment : FloatAlignment); 44if (Avx.IsSupported) 131if (Avx.IsSupported) 178else if (Avx.IsSupported) 215else if (Avx.IsSupported) 251else if (Avx.IsSupported) 281else if (Avx.IsSupported) 311else if (Avx.IsSupported) 344else if (Avx.IsSupported) 378else if (Avx.IsSupported) 417else if (Avx.IsSupported) 548else if (Avx.IsSupported) 591else if (Avx.IsSupported)
FactorizationMachine\AvxIntrinsics.cs (31)
26Vector256<float> product = Avx.Multiply(src1, src2); 27return Avx.Add(product, src3); 40Vector256<float> product = Avx.Multiply(src1, src2); 41return Avx.Subtract(src3, product); 52Contracts.Assert(Avx.IsSupported); 78Vector256<float> x = Avx.BroadcastScalarToVector256(px + i); 79Vector256<float> xx = Avx.Multiply(x, x); 89Vector256<float> vjfBuffer = Avx.LoadVector256(vjf + k); 90tmp = MultiplyAddNegated(Avx.Multiply(vjfBuffer, vjfBuffer), xx, tmp); 103Vector256<float> vjfprimeBuffer = Avx.LoadVector256(vjfprime + k); 104Vector256<float> q = Avx.LoadVector256(qffprime + k); 106Avx.Store(qffprime + k, q); 117Vector256<float> qffBuffer = Avx.LoadVector256(qff + k); 132Vector256<float> qffprimeBuffer = Avx.LoadVector256(qffprime + k); 133Vector256<float> qfprimefBuffer = Avx.LoadVector256(qfprimef + k); 140tmp = Avx.Add(y, Avx.Permute2x128(y, y, 1)); 141tmp = Avx.HorizontalAdd(tmp, tmp); 142y = Avx.HorizontalAdd(tmp, tmp); 153Contracts.Assert(Avx.IsSupported); 187Vector256<float> x = Avx.BroadcastScalarToVector256(px + i); 194Vector256<float> sx = Avx.Multiply(s, x); 198Vector256<float> v = Avx.LoadVector256(vjfprime + k); 199Vector256<float> q = Avx.LoadVector256(qfprimef + k); 202Vector256<float> gLatent = Avx.Multiply(lambdav, v); 210gLatent = Avx.Multiply(wei, gLatent); 213Vector256<float> h = MultiplyAdd(gLatent, gLatent, Avx.LoadVector256(hvjfprime + k)); 216v = MultiplyAddNegated(lr, Avx.Multiply(Avx.ReciprocalSqrt(h), gLatent), v); 217Avx.Store(vjfprime + k, v); 218Avx.Store(hvjfprime + k, h);
FactorizationMachine\FactorizationMachineInterface.netcoreapp.cs (2)
33if (Avx.IsSupported) 65if (Avx.IsSupported)
System.Numerics.Tensors (4)
System\Numerics\Tensors\netcore\TensorPrimitives.Reciprocal.cs (4)
162if (Avx.IsSupported) 164if (typeof(T) == typeof(float)) return Avx.Reciprocal(x.AsSingle()).As<float, T>(); 228if (Avx.IsSupported) 230if (typeof(T) == typeof(float)) return Avx.ReciprocalSqrt(x.AsSingle()).As<float, T>();
System.Private.CoreLib (30)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (2)
810Avx.Store(dest, str.AsByte()); 1361str = Avx.LoadVector256(src).AsSByte();
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64EncoderHelper.cs (3)
264Vector256<sbyte> str = Avx.LoadVector256(src).AsSByte(); 378str = Avx.LoadVector256(src).AsSByte(); 743Avx.Store(dest, str.AsByte());
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (2)
693Vector256<ushort> utf16VectorLower = Avx.LoadVector256(src); 694Vector256<ushort> utf16VectorUpper = Avx.LoadVector256(src + 16);
src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (1)
783Avx.Store((byte*)destination + i, normalized);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (9)
435Vector256<double> result = Avx.Subtract(upperBits.AsDouble(), Create(0x45300000_80100000).AsDouble()); // Compute in double precision: (upper - (2^84 + 2^63 + 2^52)) + lower 436return Avx.Add(result, lowerBits.AsDouble()); 468Vector256<double> result = Avx.Subtract(upperBits.AsDouble(), Create(0x45300000_00100000UL).AsDouble()); // Compute in double precision: (upper - (2^84 + 2^52)) + lower 469return Avx.Add(result, lowerBits.AsDouble()); 563Vector256<float> lower = Avx.ConvertToVector256Single(lowerBits); 564Vector256<float> upper = Avx.ConvertToVector256Single(upperBits); 579Vector256<float> result = Avx.Multiply(upper, Create(65536.0f)); 580return Avx.Add(result, lower); 1253if (Avx.IsSupported)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (4)
2606if (Avx.IsSupported) 2608result = (TVectorSingle)(object)Avx.ConvertToVector128Single((Vector256<double>)(object)vector); 2923if (Avx.IsSupported) 2925result = (TVectorDouble)(object)Avx.ConvertToVector256Double((Vector128<float>)(object)vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Avx2.cs (1)
23public new abstract class X64 : Avx.X64
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Fma.cs (1)
22public new abstract class X64 : Avx.X64
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.cs (1)
116if (Avx.IsSupported)
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (4)
95else if (Avx.IsSupported && length >= (uint)Vector256<TLeft>.Count) 306else if (Avx.IsSupported && length >= (uint)Vector256<TRight>.Count) 479[CompExactlyDependsOn(typeof(Avx))] 552[CompExactlyDependsOn(typeof(Avx))]
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (2)
1631[CompExactlyDependsOn(typeof(Avx))] 1640Avx.IsSupported ? (vector.AsByte() & Vector256.Create((byte)0x80)) == Vector256<byte>.Zero:
System.Runtime.Intrinsics (1)
artifacts\obj\System.Runtime.Intrinsics\Debug\net10.0\System.Runtime.Intrinsics.Forwards.cs (1)
25[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Intrinsics.X86.Avx))]