5 types derived from Avx2
System.Private.CoreLib (5)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Avx10v1.cs (1)
12
public abstract class Avx10v1 :
Avx2
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Avx512F.cs (1)
12
public abstract class Avx512F :
Avx2
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\AvxVnni.cs (1)
11
public abstract class AvxVnni :
Avx2
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\AvxVnniInt16.cs (1)
11
public abstract class AvxVnniInt16 :
Avx2
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\AvxVnniInt8.cs (1)
12
public abstract class AvxVnniInt8 :
Avx2
183 references to Avx2
GenerateDocumentationAndConfigFiles (2)
src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
682
Vector256<ulong> product =
Avx2
.IsSupported ?
683
Avx2
.Multiply(sourceKey, sourceKeyLow) :
Microsoft.CodeAnalysis (2)
Hashing\XxHashShared.cs (2)
682
Vector256<ulong> product =
Avx2
.IsSupported ?
683
Avx2
.Multiply(sourceKey, sourceKeyLow) :
Microsoft.CodeAnalysis.Workspaces (2)
src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
682
Vector256<ulong> product =
Avx2
.IsSupported ?
683
Avx2
.Multiply(sourceKey, sourceKeyLow) :
Microsoft.ML.CpuMath (2)
AvxIntrinsics.cs (2)
78
if (
Avx2
.IsSupported)
81
return
Avx2
.GatherVector256(src, idx256, 4);
System.IO.Hashing (2)
System\IO\Hashing\XxHashShared.cs (2)
673
Vector256<ulong> product =
Avx2
.IsSupported ?
674
Avx2
.Multiply(sourceKey, sourceKeyLow) :
System.Numerics.Tensors (15)
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMax.cs (7)
489
if (
Avx2
.IsSupported)
491
if (typeof(T) == typeof(float)) return
Avx2
.BlendVariable(left.AsSingle(), right.AsSingle(), (~mask).AsSingle()).As<float, T>();
492
if (typeof(T) == typeof(double)) return
Avx2
.BlendVariable(left.AsDouble(), right.AsDouble(), (~mask).AsDouble()).As<double, T>();
494
if (sizeof(T) == 1) return
Avx2
.BlendVariable(left.AsByte(), right.AsByte(), (~mask).AsByte()).As<byte, T>();
495
if (sizeof(T) == 2) return
Avx2
.BlendVariable(left.AsUInt16(), right.AsUInt16(), (~mask).AsUInt16()).As<ushort, T>();
496
if (sizeof(T) == 4) return
Avx2
.BlendVariable(left.AsUInt32(), right.AsUInt32(), (~mask).AsUInt32()).As<uint, T>();
497
if (sizeof(T) == 8) return
Avx2
.BlendVariable(left.AsUInt64(), right.AsUInt64(), (~mask).AsUInt64()).As<ulong, T>();
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (8)
100
Vector256<byte> highNibble =
Avx2
.ShiftRightLogical(x.AsInt32(), 4).AsByte() & nibbleMask;
101
Vector256<byte> nibbleSelectMask =
Avx2
.CompareEqual(highNibble, Vector256<byte>.Zero);
102
Vector256<byte> indexVector =
Avx2
.BlendVariable(highNibble, lowNibble, nibbleSelectMask) +
112
Vector256<uint> x_bot16 =
Avx2
.Or(
Avx2
.ShiftLeftLogical(x.AsUInt32(), 16), lowHalf);
113
Vector256<uint> x_top16 =
Avx2
.Or(x.AsUInt32(), lowHalf);
116
Vector256<uint> lz_top16_shift =
Avx2
.ShiftLeftLogical(lz_top16, 16);
117
return
Avx2
.Or(lz_bot16, lz_top16_shift).AsUInt16().As<ushort, T>();
System.Private.CoreLib (155)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (17)
64
if (
Avx2
.IsSupported && (end >= src))
717
[CompExactlyDependsOn(typeof(
Avx2
))]
774
Vector256<sbyte> hiNibbles =
Avx2
.And(
Avx2
.ShiftRightLogical(str.AsInt32(), 4).AsSByte(), maskSlashOrUnderscore);
787
Vector256<short> merge_ab_and_bc =
Avx2
.MultiplyAddAdjacent(str.AsByte(), mergeConstant0);
793
Vector256<int> output =
Avx2
.MultiplyAddAdjacent(merge_ab_and_bc, mergeConstant1);
800
output =
Avx2
.Shuffle(output.AsSByte(), packBytesInLaneMask).AsInt32();
807
str =
Avx2
.PermuteVar8x32(output, packLanesControl).AsSByte();
1316
[CompExactlyDependsOn(typeof(
Avx2
))]
1328
Vector256<sbyte> loNibbles =
Avx2
.And(str, maskSlashOrUnderscore);
1329
Vector256<sbyte> hi =
Avx2
.Shuffle(lutHigh, hiNibbles);
1330
Vector256<sbyte> lo =
Avx2
.Shuffle(lutLow, loNibbles);
1338
Vector256<sbyte> eq2F =
Avx2
.CompareEqual(str, maskSlashOrUnderscore);
1339
Vector256<sbyte> shift =
Avx2
.Shuffle(lutShift,
Avx2
.Add(eq2F, hiNibbles));
1341
result =
Avx2
.Add(str, shift);
1356
[CompExactlyDependsOn(typeof(
Avx2
))]
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64EncoderHelper.cs (15)
53
if (
Avx2
.IsSupported && (end >= src))
213
[CompExactlyDependsOn(typeof(
Avx2
))]
267
str =
Avx2
.PermuteVar8x32(str.AsInt32(), Vector256.Create(
283
str =
Avx2
.Shuffle(str, shuffleVec);
294
Vector256<sbyte> t0 =
Avx2
.And(str, maskAC);
305
Vector256<sbyte> t2 =
Avx2
.And(str, maskBB);
315
Vector256<ushort> t1 =
Avx2
.MultiplyHigh(t0.AsUInt16(), shiftAC);
325
Vector256<short> t3 =
Avx2
.MultiplyLow(t2.AsInt16(), shiftBB);
335
str =
Avx2
.Or(t1.AsSByte(), t3.AsSByte());
357
Vector256<byte> indices =
Avx2
.SubtractSaturate(str.AsByte(), const51);
360
Vector256<sbyte> mask =
Avx2
.CompareGreaterThan(str, const25);
363
Vector256<sbyte> tmp =
Avx2
.Subtract(indices.AsSByte(), mask);
366
str =
Avx2
.Add(str,
Avx2
.Shuffle(lut, tmp));
738
[CompExactlyDependsOn(typeof(
Avx2
))]
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (7)
534
[CompExactlyDependsOn(typeof(
Avx2
))]
546
Vector256<sbyte> lowerBound =
Avx2
.Shuffle(lutLow, hiNibbles);
547
Vector256<sbyte> upperBound =
Avx2
.Shuffle(lutHigh, hiNibbles);
562
Vector256<sbyte> shift =
Avx2
.Shuffle(lutShift, hiNibbles);
575
[CompExactlyDependsOn(typeof(
Avx2
))]
656
[CompExactlyDependsOn(typeof(
Avx2
))]
688
[CompExactlyDependsOn(typeof(
Avx2
))]
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (1)
293
[CompExactlyDependsOn(typeof(
Avx2
))]
src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (4)
765
else if (
Avx2
.IsSupported && (uint)_bitLength >= Vector256<byte>.Count)
777
Vector256<byte> shuffled =
Avx2
.Shuffle(scalar.AsByte(), shuffleMask);
778
Vector256<byte> extracted =
Avx2
.And(shuffled, bitMask);
782
Vector256<byte> normalized =
Avx2
.Min(extracted, ones);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (4)
387
if (
Avx2
.IsSupported)
390
lowerBits =
Avx2
.Blend(lowerBits, Create(0x43300000_00000000).AsInt32(), 0b1010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52)
428
if (
Avx2
.IsSupported)
431
lowerBits =
Avx2
.Blend(lowerBits, Create(0x43300000_00000000UL).AsUInt32(), 0b1010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (11)
422
if (
Avx2
.IsSupported)
430
lowerBits =
Avx2
.Blend(lowerBits, Create(0x43300000_00000000).AsInt32(), 0b10101010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52)
432
Vector256<long> upperBits =
Avx2
.ShiftRightLogical(vector, 32); // Extract the 32 most significant bits of vector
433
upperBits =
Avx2
.Xor(upperBits, Create(0x45300000_80000000)); // Flip the msb of upperBits and blend with the bit representation of double(2^84 + 2^63)
455
if (
Avx2
.IsSupported)
463
lowerBits =
Avx2
.Blend(lowerBits, Create(0x43300000_00000000UL).AsUInt32(), 0b10101010); // Blend the 32 lowest significant bits of vector with the bit representation of double(2^52) */
465
Vector256<ulong> upperBits =
Avx2
.ShiftRightLogical(vector, 32); // Extract the 32 most significant bits of vector
466
upperBits =
Avx2
.Xor(upperBits, Create(0x45300000_00000000UL)); // Blend upperBits with the bit representation of double(2^84)
553
if (
Avx2
.IsSupported)
560
Vector256<int> lowerBits =
Avx2
.And(vector, Create(0x0000FFFFU)).AsInt32();
561
Vector256<int> upperBits =
Avx2
.ShiftRightLogical(vector, 16).AsInt32();
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Avx10v1.cs (1)
3852
public new abstract class X64 :
Avx2
.X64
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\Avx512F.cs (1)
2247
public new abstract class X64 :
Avx2
.X64
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\AvxVnni.cs (1)
22
public new abstract class X64 :
Avx2
.X64
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\AvxVnniInt16.cs (1)
22
public new abstract class X64 :
Avx2
.X64
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\AvxVnniInt8.cs (1)
23
public new abstract class X64 :
Avx2
.X64
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (29)
312
if (
Avx2
.IsSupported && searchSpaceLength > 2 * Vector128<short>.Count)
369
if (!
Avx2
.IsSupported && searchSpaceLength > 2 * Vector128<short>.Count)
444
if (
Avx2
.IsSupported && searchSpaceLength > 2 * Vector128<short>.Count)
500
if (!
Avx2
.IsSupported && searchSpaceLength > 2 * Vector128<short>.Count)
597
if (
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
651
if (!
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
722
if (
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
776
if (!
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
868
if (
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
925
if (!
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
996
if (
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
1053
if (!
Avx2
.IsSupported && searchSpaceLength > Vector128<byte>.Count)
1170
[CompExactlyDependsOn(typeof(
Avx2
))]
1184
[CompExactlyDependsOn(typeof(
Avx2
))]
1191
Vector256<byte> values =
Avx2
.Shuffle(bitmapLookup, source);
1197
Vector256<byte> bitMask =
Avx2
.Shuffle(bitmapLookup, source);
1198
Vector256<byte> bitPositions =
Avx2
.Shuffle(Vector256.Create(0x8040201008040201).AsByte(), highNibbles);
1229
[CompExactlyDependsOn(typeof(
Avx2
))]
1238
Vector256<byte> row0 =
Avx2
.Shuffle(bitmapLookup0, lowNibbles);
1239
Vector256<byte> row1 =
Avx2
.Shuffle(bitmapLookup1, lowNibbles);
1241
Vector256<byte> bitmask =
Avx2
.Shuffle(Vector256.Create(0x8040201008040201).AsByte(), highNibbles);
1276
[CompExactlyDependsOn(typeof(
Avx2
))]
1292
[CompExactlyDependsOn(typeof(
Avx2
))]
1388
[CompExactlyDependsOn(typeof(
Avx2
))]
1392
return
Avx2
.PackUnsignedSaturate(
1426
[CompExactlyDependsOn(typeof(
Avx2
))]
1430
return
Avx2
.PackUnsignedSaturate(lower.AsInt16(), upper.AsInt16());
1476
[CompExactlyDependsOn(typeof(
Avx2
))]
1505
[CompExactlyDependsOn(typeof(
Avx2
))]
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (9)
183
[CompExactlyDependsOn(typeof(
Avx2
))]
189
Vector256<byte> sourceLower =
Avx2
.PackUnsignedSaturate(
193
Vector256<byte> sourceUpper =
Avx2
.PackUnsignedSaturate(
204
[CompExactlyDependsOn(typeof(
Avx2
))]
209
Vector256<byte> bitPositions =
Avx2
.Shuffle(Vector256.Create(0x8040201008040201).AsByte(), shifted);
212
Vector256<byte> bitMaskLower =
Avx2
.Shuffle(charMapLower, index);
213
Vector256<byte> bitMaskUpper =
Avx2
.Shuffle(charMapUpper, index - Vector256.Create((byte)16));
517
if (
Avx2
.IsSupported && searchSpaceLength >= 32)
694
if (
Avx2
.IsSupported && searchSpaceLength >= 32)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (4)
162
if (
Avx2
.IsSupported && span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN2)
182
if (
Avx2
.IsSupported && span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN3)
247
[CompExactlyDependsOn(typeof(
Avx2
))]
424
[CompExactlyDependsOn(typeof(
Avx2
))]
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyHelper.cs (13)
47
[CompExactlyDependsOn(typeof(
Avx2
))]
161
[CompExactlyDependsOn(typeof(
Avx2
))]
239
[CompExactlyDependsOn(typeof(
Avx2
))]
245
Vector256<byte> packed =
Avx2
.PackUnsignedSaturate(source0.AsInt16(), source1.AsInt16());
313
[CompExactlyDependsOn(typeof(
Avx2
))]
316
return
Avx2
.Shuffle(maskLow, low) &
Avx2
.Shuffle(maskHigh, high);
381
[CompExactlyDependsOn(typeof(
Avx2
))]
403
Vector256<byte> leftShifted =
Avx2
.Permute2x128(left, right, (1 << 0) + (2 << 4));
404
return
Avx2
.AlignRight(right, leftShifted, 15);
408
[CompExactlyDependsOn(typeof(
Avx2
))]
412
Vector256<byte> leftShifted =
Avx2
.Permute2x128(left, right, (1 << 0) + (2 << 4));
413
return
Avx2
.AlignRight(right, leftShifted, 14);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (5)
1344
else if (
Avx2
.IsSupported && remainder >= (nint)(Vector256<byte>.Count * 1.5))
1376
tempFirst =
Avx2
.Shuffle(tempFirst, reverseMask);
1377
tempFirst =
Avx2
.Permute2x128(tempFirst, tempFirst, 0b00_01);
1378
tempLast =
Avx2
.Shuffle(tempLast, reverseMask);
1379
tempLast =
Avx2
.Permute2x128(tempLast, tempLast, 0b00_01);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (5)
929
else if (
Avx2
.IsSupported && remainder >= (nint)(Vector256<ushort>.Count * 1.5))
957
tempFirst =
Avx2
.Shuffle(tempFirst, reverseMask);
958
tempFirst =
Avx2
.Permute2x128(tempFirst, tempFirst, 0b00_01);
959
tempLast =
Avx2
.Shuffle(tempLast, reverseMask);
960
tempLast =
Avx2
.Permute2x128(tempLast, tempLast, 0b00_01);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (6)
125
else if (
Avx2
.IsSupported && remainder >= Vector256<int>.Count * 2)
142
tempFirst =
Avx2
.PermuteVar8x32(tempFirst, Vector256.Create(7, 6, 5, 4, 3, 2, 1, 0));
143
tempLast =
Avx2
.PermuteVar8x32(tempLast, Vector256.Create(7, 6, 5, 4, 3, 2, 1, 0));
230
else if (
Avx2
.IsSupported && remainder >= Vector256<long>.Count * 2)
247
tempFirst =
Avx2
.Permute4x64(tempFirst, 0b00_01_10_11);
248
tempLast =
Avx2
.Permute4x64(tempLast, 0b00_01_10_11);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (18)
198
else if (
Avx2
.IsSupported && length > Vector256<short>.Count)
259
if (!
Avx2
.IsSupported && length > 2 * Vector128<short>.Count)
397
else if (
Avx2
.IsSupported && length > Vector256<short>.Count)
460
if (!
Avx2
.IsSupported && length > 2 * Vector128<short>.Count)
609
else if (
Avx2
.IsSupported && length > Vector256<short>.Count)
674
if (!
Avx2
.IsSupported && length > 2 * Vector128<short>.Count)
825
else if (
Avx2
.IsSupported && length > Vector256<short>.Count)
892
if (!
Avx2
.IsSupported && length > 2 * Vector128<short>.Count)
1022
else if (
Avx2
.IsSupported && length > Vector256<short>.Count)
1087
if (!
Avx2
.IsSupported && length > 2 * Vector128<short>.Count)
1154
[CompExactlyDependsOn(typeof(
Avx2
))]
1157
Debug.Assert(
Avx2
.IsSupported);
1162
return
Avx2
.PackUnsignedSaturate(source0, source1).AsByte();
1238
[CompExactlyDependsOn(typeof(
Avx2
))]
1270
[CompExactlyDependsOn(typeof(
Avx2
))]
1300
[CompExactlyDependsOn(typeof(
Avx2
))]
1303
Debug.Assert(
Avx2
.IsSupported);
1308
return
Avx2
.Permute4x64(result.AsInt64(), 0b_11_01_10_00).AsByte();
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (2)
1693
return
Avx2
.IsSupported
1694
? PackedSpanHelpers.FixUpPackedVector256Result(
Avx2
.PackUnsignedSaturate(vectorFirst.AsInt16(), vectorSecond.AsInt16()))
System.Runtime.Intrinsics (1)
artifacts\obj\System.Runtime.Intrinsics\Debug\net10.0\System.Runtime.Intrinsics.Forwards.cs (1)
28
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Intrinsics.X86.
Avx2
))]
Test.Utilities (2)
src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
682
Vector256<ulong> product =
Avx2
.IsSupported ?
683
Avx2
.Multiply(sourceKey, sourceKeyLow) :