551 references to BitCast
Microsoft.DiaSymReader (1)
Writer\SymUnmanagedWriterImpl.cs (1)
361
variant = Unsafe.
BitCast
<ComVariant, VariantStructure>(tmp);
System.Linq (2)
System\Linq\Sum.cs (2)
62
return (TResult)(object)SumSignedIntegersVectorized(Unsafe.
BitCast
<ReadOnlySpan<T>, ReadOnlySpan<long>>(span));
66
return (TResult)(object)SumSignedIntegersVectorized(Unsafe.
BitCast
<ReadOnlySpan<T>, ReadOnlySpan<int>>(span));
System.Numerics.Tensors (4)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertHelpers.cs (2)
390
public static float Invoke(short x) => (float)Unsafe.
BitCast
<short, Half>(x);
571
public static ushort Invoke(float x) => Unsafe.
BitCast
<Half, ushort>((Half)x);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
52
return Unsafe.
BitCast
<Span<TFrom>, Span<TTo>>(span);
68
return Unsafe.
BitCast
<ReadOnlySpan<TFrom>, ReadOnlySpan<TTo>>(span);
System.Private.CoreLib (515)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (4)
211
EncodeTo_Vector128(source, Unsafe.
BitCast
<Span<char>, Span<ushort>>(destination), casing);
294
return TryDecodeFrom_Vector128(Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<ushort>>(source), destination, out charsProcessed);
443
fallbackResult = TryDecodeFromUtf8_Scalar(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(source.Slice((int)offset)), destination.Slice((int)(offset / 2)), out elementsProcessed);
448
fallbackResult = TryDecodeFromUtf16_Scalar(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(source.Slice((int)offset)), destination.Slice((int)(offset / 2)), out elementsProcessed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (8)
1920
Unsafe.
BitCast
<T, byte>(value),
1928
Unsafe.
BitCast
<T, short>(value),
1936
Unsafe.
BitCast
<T, int>(value),
1944
Unsafe.
BitCast
<T, long>(value),
2165
Unsafe.
BitCast
<T, byte>(value),
2175
Unsafe.
BitCast
<T, short>(value),
2185
Unsafe.
BitCast
<T, int>(value),
2195
Unsafe.
BitCast
<T, long>(value),
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (8)
962
public static long DoubleToInt64Bits(double value) => Unsafe.
BitCast
<double, long>(value);
970
public static double Int64BitsToDouble(long value) => Unsafe.
BitCast
<long, double>(value);
978
public static int SingleToInt32Bits(float value) => Unsafe.
BitCast
<float, int>(value);
986
public static float Int32BitsToSingle(int value) => Unsafe.
BitCast
<int, float>(value);
1027
public static ulong DoubleToUInt64Bits(double value) => Unsafe.
BitCast
<double, ulong>(value);
1036
public static double UInt64BitsToDouble(ulong value) => Unsafe.
BitCast
<ulong, double>(value);
1045
public static uint SingleToUInt32Bits(float value) => Unsafe.
BitCast
<float, uint>(value);
1054
public static float UInt32BitsToSingle(uint value) => Unsafe.
BitCast
<uint, float>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (5)
1477
return result ?? Unsafe.
BitCast
<TStorage, TUnderlying>(value).ToString()!;
1515
result = Unsafe.
BitCast
<TStorage, TUnderlying>(value).ToString()!;
1867
if (GetNameInlined(enumInfo, Unsafe.
BitCast
<TUnderlying, TStorage>(value)) is string enumName)
1882
if (TryFormatFlagNames(enumInfo, Unsafe.
BitCast
<TUnderlying, TStorage>(value), destination, out charsWritten, ref destinationIsTooSmall) || destinationIsTooSmall)
1915
if (TryFormatFlagNames(GetEnumInfo<TStorage>(enumType), Unsafe.
BitCast
<TUnderlying, TStorage>(value), destination, out charsWritten, ref destinationIsTooSmall) ||
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (4)
766
result.Append(Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(s));
771
Encoding.UTF8.GetBytes(s, Unsafe.
BitCast
<Span<TChar>, Span<byte>>(result.AppendSpan(Encoding.UTF8.GetByteCount(s))));
780
fraction.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(chars), out charCount, fractionFormat, CultureInfo.InvariantCulture) :
781
fraction.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(chars), out charCount, fractionFormat, CultureInfo.InvariantCulture);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (10)
366
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(AMDesignator) :
367
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(amDesignatorUtf8 ??= Encoding.UTF8.GetBytes(AMDesignator));
615
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(DateSeparator) :
616
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(dateSeparatorUtf8 ??= Encoding.UTF8.GetBytes(DateSeparator));
818
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(PMDesignator) :
819
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(pmDesignatorUtf8 ??= Encoding.UTF8.GetBytes(PMDesignator));
1000
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(TimeSeparator) :
1001
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(timeSeparatorUtf8 ??= Encoding.UTF8.GetBytes(TimeSeparator));
1700
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(DecimalSeparator) :
1701
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_decimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(DecimalSeparator));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (28)
289
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencyDecimalSeparator) :
290
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _currencyDecimalSeparatorUtf8, _currencyDecimalSeparator));
381
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencyGroupSeparator) :
382
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _currencyGroupSeparatorUtf8, _currencyGroupSeparator));
403
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencySymbol) :
404
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _currencySymbolUtf8, _currencySymbol));
447
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_nanSymbol) :
448
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _nanSymbolUtf8, _nanSymbol));
532
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_negativeInfinitySymbol) :
533
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _negativeInfinitySymbolUtf8, _negativeInfinitySymbol));
555
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_negativeSign) :
556
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _negativeSignUtf8, _negativeSign));
591
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_numberDecimalSeparator) :
592
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _numberDecimalSeparatorUtf8, _numberDecimalSeparator));
612
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_numberGroupSeparator) :
613
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _numberGroupSeparatorUtf8, _numberGroupSeparator));
649
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_positiveInfinitySymbol) :
650
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _positiveInfinitySymbolUtf8, _positiveInfinitySymbol));
672
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_positiveSign) :
673
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _positiveSignUtf8, _positiveSign));
708
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentDecimalSeparator) :
709
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _percentDecimalSeparatorUtf8, _percentDecimalSeparator));
729
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentGroupSeparator) :
730
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _percentGroupSeparatorUtf8, _percentGroupSeparator));
750
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentSymbol) :
751
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _percentSymbolUtf8, _percentSymbol));
772
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_perMilleSymbol) :
773
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(GetUtf8Span(ref _perMilleSymbolUtf8, _perMilleSymbol));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (7)
902
ReadOnlySpan<char> charSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(str);
930
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(new ReadOnlySpan<char>(chArr, 0, newLength));
936
ReadOnlySpan<byte> srcUtf8Span = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(str);
989
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(destUtf8Span.Slice(0, newLength));
1093
return Unsafe.
BitCast
<Guid, Vector128<byte>>(left) == Unsafe.
BitCast
<Guid, Vector128<byte>>(right);
1530
Vector128<byte> srcVec = Unsafe.
BitCast
<Guid, Vector128<byte>>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (204)
336
Unsafe.
BitCast
<T, byte>(value),
343
Unsafe.
BitCast
<T, short>(value),
350
Unsafe.
BitCast
<T, int>(value),
357
Unsafe.
BitCast
<T, long>(value),
819
Unsafe.
BitCast
<T, byte>(value),
826
Unsafe.
BitCast
<T, short>(value),
833
Unsafe.
BitCast
<T, int>(value),
840
Unsafe.
BitCast
<T, long>(value),
868
Unsafe.
BitCast
<T, byte>(value),
875
Unsafe.
BitCast
<T, short>(value),
882
Unsafe.
BitCast
<T, int>(value),
889
Unsafe.
BitCast
<T, long>(value),
946
Unsafe.
BitCast
<T, byte>(value0),
947
Unsafe.
BitCast
<T, byte>(value1),
954
Unsafe.
BitCast
<T, short>(value0),
955
Unsafe.
BitCast
<T, short>(value1),
984
Unsafe.
BitCast
<T, byte>(value0),
985
Unsafe.
BitCast
<T, byte>(value1),
992
Unsafe.
BitCast
<T, short>(value0),
993
Unsafe.
BitCast
<T, short>(value1),
1053
Unsafe.
BitCast
<T, byte>(value0),
1054
Unsafe.
BitCast
<T, byte>(value1),
1055
Unsafe.
BitCast
<T, byte>(value2),
1062
Unsafe.
BitCast
<T, short>(value0),
1063
Unsafe.
BitCast
<T, short>(value1),
1064
Unsafe.
BitCast
<T, short>(value2),
1094
Unsafe.
BitCast
<T, byte>(value0),
1095
Unsafe.
BitCast
<T, byte>(value1),
1096
Unsafe.
BitCast
<T, byte>(value2),
1103
Unsafe.
BitCast
<T, short>(value0),
1104
Unsafe.
BitCast
<T, short>(value1),
1105
Unsafe.
BitCast
<T, short>(value2),
1156
Unsafe.
BitCast
<T, byte>(value0),
1157
Unsafe.
BitCast
<T, byte>(value1),
1158
Unsafe.
BitCast
<T, byte>(value2),
1159
Unsafe.
BitCast
<T, byte>(value3),
1166
Unsafe.
BitCast
<T, short>(value0),
1167
Unsafe.
BitCast
<T, short>(value1),
1168
Unsafe.
BitCast
<T, short>(value2),
1169
Unsafe.
BitCast
<T, short>(value3),
1397
Unsafe.
BitCast
<T, byte>(value),
1404
Unsafe.
BitCast
<T, short>(value),
1411
Unsafe.
BitCast
<T, int>(value),
1418
Unsafe.
BitCast
<T, long>(value),
1446
Unsafe.
BitCast
<T, byte>(value),
1453
Unsafe.
BitCast
<T, short>(value),
1460
Unsafe.
BitCast
<T, int>(value),
1467
Unsafe.
BitCast
<T, long>(value),
1524
Unsafe.
BitCast
<T, byte>(value0),
1525
Unsafe.
BitCast
<T, byte>(value1),
1532
Unsafe.
BitCast
<T, short>(value0),
1533
Unsafe.
BitCast
<T, short>(value1),
1562
Unsafe.
BitCast
<T, byte>(value0),
1563
Unsafe.
BitCast
<T, byte>(value1),
1570
Unsafe.
BitCast
<T, short>(value0),
1571
Unsafe.
BitCast
<T, short>(value1),
1631
Unsafe.
BitCast
<T, byte>(value0),
1632
Unsafe.
BitCast
<T, byte>(value1),
1633
Unsafe.
BitCast
<T, byte>(value2),
1640
Unsafe.
BitCast
<T, short>(value0),
1641
Unsafe.
BitCast
<T, short>(value1),
1642
Unsafe.
BitCast
<T, short>(value2),
1672
Unsafe.
BitCast
<T, byte>(value0),
1673
Unsafe.
BitCast
<T, byte>(value1),
1674
Unsafe.
BitCast
<T, byte>(value2),
1681
Unsafe.
BitCast
<T, short>(value0),
1682
Unsafe.
BitCast
<T, short>(value1),
1683
Unsafe.
BitCast
<T, short>(value2),
1735
Unsafe.
BitCast
<T, byte>(value0),
1736
Unsafe.
BitCast
<T, byte>(value1),
1737
Unsafe.
BitCast
<T, byte>(value2),
1738
Unsafe.
BitCast
<T, byte>(value3),
1745
Unsafe.
BitCast
<T, short>(value0),
1746
Unsafe.
BitCast
<T, short>(value1),
1747
Unsafe.
BitCast
<T, short>(value2),
1748
Unsafe.
BitCast
<T, short>(value3),
1931
Unsafe.
BitCast
<T, byte>(lowInclusive),
1932
Unsafe.
BitCast
<T, byte>(highInclusive),
1940
Unsafe.
BitCast
<T, ushort>(lowInclusive),
1941
Unsafe.
BitCast
<T, ushort>(highInclusive),
1949
Unsafe.
BitCast
<T, uint>(lowInclusive),
1950
Unsafe.
BitCast
<T, uint>(highInclusive),
1958
Unsafe.
BitCast
<T, ulong>(lowInclusive),
1959
Unsafe.
BitCast
<T, ulong>(highInclusive),
2002
Unsafe.
BitCast
<T, byte>(lowInclusive),
2003
Unsafe.
BitCast
<T, byte>(highInclusive),
2011
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2012
Unsafe.
BitCast
<T, ushort>(highInclusive),
2020
Unsafe.
BitCast
<T, uint>(lowInclusive),
2021
Unsafe.
BitCast
<T, uint>(highInclusive),
2029
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2030
Unsafe.
BitCast
<T, ulong>(highInclusive),
2073
Unsafe.
BitCast
<T, byte>(lowInclusive),
2074
Unsafe.
BitCast
<T, byte>(highInclusive),
2082
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2083
Unsafe.
BitCast
<T, ushort>(highInclusive),
2091
Unsafe.
BitCast
<T, uint>(lowInclusive),
2092
Unsafe.
BitCast
<T, uint>(highInclusive),
2100
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2101
Unsafe.
BitCast
<T, ulong>(highInclusive),
2144
Unsafe.
BitCast
<T, byte>(lowInclusive),
2145
Unsafe.
BitCast
<T, byte>(highInclusive),
2153
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2154
Unsafe.
BitCast
<T, ushort>(highInclusive),
2162
Unsafe.
BitCast
<T, uint>(lowInclusive),
2163
Unsafe.
BitCast
<T, uint>(highInclusive),
2171
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2172
Unsafe.
BitCast
<T, ulong>(highInclusive),
2217
Unsafe.
BitCast
<T, byte>(value),
2223
Unsafe.
BitCast
<T, short>(value),
2229
Unsafe.
BitCast
<T, int>(value),
2235
Unsafe.
BitCast
<T, long>(value),
2258
Unsafe.
BitCast
<T, byte>(value),
2264
Unsafe.
BitCast
<T, short>(value),
2270
Unsafe.
BitCast
<T, int>(value),
2276
Unsafe.
BitCast
<T, long>(value),
2413
Unsafe.
BitCast
<T, byte>(value),
2420
Unsafe.
BitCast
<T, short>(value),
2427
Unsafe.
BitCast
<T, int>(value),
2434
Unsafe.
BitCast
<T, long>(value),
2459
Unsafe.
BitCast
<T, byte>(value),
2466
Unsafe.
BitCast
<T, short>(value),
2473
Unsafe.
BitCast
<T, int>(value),
2480
Unsafe.
BitCast
<T, long>(value),
2676
Unsafe.
BitCast
<T, byte>(value0),
2677
Unsafe.
BitCast
<T, byte>(value1),
2684
Unsafe.
BitCast
<T, short>(value0),
2685
Unsafe.
BitCast
<T, short>(value1),
2711
Unsafe.
BitCast
<T, byte>(value0),
2712
Unsafe.
BitCast
<T, byte>(value1),
2719
Unsafe.
BitCast
<T, short>(value0),
2720
Unsafe.
BitCast
<T, short>(value1),
2776
Unsafe.
BitCast
<T, byte>(value0),
2777
Unsafe.
BitCast
<T, byte>(value1),
2778
Unsafe.
BitCast
<T, byte>(value2),
2785
Unsafe.
BitCast
<T, short>(value0),
2786
Unsafe.
BitCast
<T, short>(value1),
2787
Unsafe.
BitCast
<T, short>(value2),
2814
Unsafe.
BitCast
<T, byte>(value0),
2815
Unsafe.
BitCast
<T, byte>(value1),
2816
Unsafe.
BitCast
<T, byte>(value2),
2823
Unsafe.
BitCast
<T, short>(value0),
2824
Unsafe.
BitCast
<T, short>(value1),
2825
Unsafe.
BitCast
<T, short>(value2),
3096
Unsafe.
BitCast
<T, byte>(value0),
3097
Unsafe.
BitCast
<T, byte>(value1),
3104
Unsafe.
BitCast
<T, short>(value0),
3105
Unsafe.
BitCast
<T, short>(value1),
3131
Unsafe.
BitCast
<T, byte>(value0),
3132
Unsafe.
BitCast
<T, byte>(value1),
3139
Unsafe.
BitCast
<T, short>(value0),
3140
Unsafe.
BitCast
<T, short>(value1),
3197
Unsafe.
BitCast
<T, byte>(value0),
3198
Unsafe.
BitCast
<T, byte>(value1),
3199
Unsafe.
BitCast
<T, byte>(value2),
3206
Unsafe.
BitCast
<T, short>(value0),
3207
Unsafe.
BitCast
<T, short>(value1),
3208
Unsafe.
BitCast
<T, short>(value2),
3235
Unsafe.
BitCast
<T, byte>(value0),
3236
Unsafe.
BitCast
<T, byte>(value1),
3237
Unsafe.
BitCast
<T, byte>(value2),
3244
Unsafe.
BitCast
<T, short>(value0),
3245
Unsafe.
BitCast
<T, short>(value1),
3246
Unsafe.
BitCast
<T, short>(value2),
4483
Unsafe.
BitCast
<T, byte>(oldValue),
4484
Unsafe.
BitCast
<T, byte>(newValue),
4495
Unsafe.
BitCast
<T, ushort>(oldValue),
4496
Unsafe.
BitCast
<T, ushort>(newValue),
4506
Unsafe.
BitCast
<T, int>(oldValue),
4507
Unsafe.
BitCast
<T, int>(newValue),
4517
Unsafe.
BitCast
<T, long>(oldValue),
4518
Unsafe.
BitCast
<T, long>(newValue),
4549
Unsafe.
BitCast
<T, byte>(oldValue),
4550
Unsafe.
BitCast
<T, byte>(newValue),
4561
Unsafe.
BitCast
<T, ushort>(oldValue),
4562
Unsafe.
BitCast
<T, ushort>(newValue),
4572
Unsafe.
BitCast
<T, int>(oldValue),
4573
Unsafe.
BitCast
<T, int>(newValue),
4583
Unsafe.
BitCast
<T, long>(oldValue),
4584
Unsafe.
BitCast
<T, long>(newValue),
4661
Unsafe.
BitCast
<T, byte>(oldValue),
4662
Unsafe.
BitCast
<T, byte>(newValue),
4672
Unsafe.
BitCast
<T, ushort>(oldValue),
4673
Unsafe.
BitCast
<T, ushort>(newValue),
4682
Unsafe.
BitCast
<T, int>(oldValue),
4683
Unsafe.
BitCast
<T, int>(newValue),
4692
Unsafe.
BitCast
<T, long>(oldValue),
4693
Unsafe.
BitCast
<T, long>(newValue),
4747
Unsafe.
BitCast
<T, byte>(oldValue),
4748
Unsafe.
BitCast
<T, byte>(newValue),
4758
Unsafe.
BitCast
<T, ushort>(oldValue),
4759
Unsafe.
BitCast
<T, ushort>(newValue),
4768
Unsafe.
BitCast
<T, int>(oldValue),
4769
Unsafe.
BitCast
<T, int>(newValue),
4778
Unsafe.
BitCast
<T, long>(oldValue),
4779
Unsafe.
BitCast
<T, long>(newValue),
5434
Unsafe.
BitCast
<T, byte>(value),
5441
Unsafe.
BitCast
<T, short>(value),
5448
Unsafe.
BitCast
<T, int>(value),
5455
Unsafe.
BitCast
<T, long>(value),
5483
Unsafe.
BitCast
<T, byte>(value),
5490
Unsafe.
BitCast
<T, short>(value),
5497
Unsafe.
BitCast
<T, int>(value),
5504
Unsafe.
BitCast
<T, long>(value),
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.MinMax.cs (2)
227
Unsafe.
BitCast
<TInner, TOuter>(MinMaxInteger<TInner, TMinMax>(Unsafe.
BitCast
<ReadOnlySpan<TOuter>, ReadOnlySpan<TInner>>(span)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (2)
1103
if (source.TryCopyTo(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination)))
1114
return Encoding.UTF8.TryGetBytes(source, Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination), out charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (17)
1107
ReadOnlySpan<char> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span);
1108
ReadOnlySpan<char> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(value);
1115
ReadOnlySpan<byte> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span);
1116
ReadOnlySpan<byte> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
1126
ReadOnlySpan<char> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span);
1127
ReadOnlySpan<char> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(value);
1134
ReadOnlySpan<byte> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span);
1135
ReadOnlySpan<byte> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
1146
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span).Trim());
1152
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span).TrimUtf8());
1162
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span).TrimStart());
1168
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span).TrimStartUtf8());
1720
ReadOnlySpan<byte> bytes = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Colors\Argb.cs (4)
28
return Unsafe.
BitCast
<uint, Argb<byte>>(color);
46
return Unsafe.
BitCast
<uint, Argb<byte>>(color);
59
uint bits = Unsafe.
BitCast
<Argb<byte>, uint>(color);
74
uint bits = Unsafe.
BitCast
<Argb<byte>, uint>(color);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Colors\Rgba.cs (4)
28
return Unsafe.
BitCast
<uint, Rgba<byte>>(color);
46
return Unsafe.
BitCast
<uint, Rgba<byte>>(color);
59
uint bits = Unsafe.
BitCast
<Rgba<byte>, uint>(color);
74
uint bits = Unsafe.
BitCast
<Rgba<byte>, uint>(color);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Plane.Extensions.cs (1)
14
public static Vector4 AsVector4(this Plane value) => Unsafe.
BitCast
<Plane, Vector4>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.Extensions.cs (1)
14
public static Vector4 AsVector4(this Quaternion value) => Unsafe.
BitCast
<Quaternion, Vector4>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (4)
68
return CompareIntegerSemantic(Unsafe.
BitCast
<BFloat16, short>((BFloat16)(object)x!), Unsafe.
BitCast
<BFloat16, short>((BFloat16)(object)y!));
72
return CompareIntegerSemantic(Unsafe.
BitCast
<NFloat, nint>((NFloat)(object)x!), Unsafe.
BitCast
<NFloat, nint>((NFloat)(object)y!));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (1)
235
return Unsafe.
BitCast
<Vector<TFrom>, Vector<TTo>>(vector);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.Extensions.cs (2)
16
public static Plane AsPlane(this Vector4 value) => Unsafe.
BitCast
<Vector4, Plane>(value);
21
public static Quaternion AsQuaternion(this Vector4 value) => Unsafe.
BitCast
<Vector4, Quaternion>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (1)
273
return Unsafe.
BitCast
<Vector128<TFrom>, Vector128<TTo>>(vector);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (6)
56
public static Plane AsPlane(this Vector128<float> value) => Unsafe.
BitCast
<Vector128<float>, Plane>(value);
62
public static Quaternion AsQuaternion(this Vector128<float> value) => Unsafe.
BitCast
<Vector128<float>, Quaternion>(value);
68
public static Vector128<float> AsVector128(this Plane value) => Unsafe.
BitCast
<Plane, Vector128<float>>(value);
74
public static Vector128<float> AsVector128(this Quaternion value) => Unsafe.
BitCast
<Quaternion, Vector128<float>>(value);
92
public static Vector128<float> AsVector128(this Vector4 value) => Unsafe.
BitCast
<Vector4, Vector128<float>>(value);
164
public static Vector4 AsVector4(this Vector128<float> value) => Unsafe.
BitCast
<Vector128<float>, Vector4>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (1)
257
return Unsafe.
BitCast
<Vector256<TFrom>, Vector256<TTo>>(vector);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (1)
257
return Unsafe.
BitCast
<Vector512<TFrom>, Vector512<TTo>>(vector);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (1)
257
return Unsafe.
BitCast
<Vector64<TFrom>, Vector64<TTo>>(vector);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (109)
79
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
114
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
120
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
131
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
217
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
274
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
288
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
294
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
360
resolved = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Equals(result, product + (sum + bound)));
383
TVectorDouble valueHi = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(
384
Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(value) & TVectorUInt64.Create(double.ConversionSplitMask)
407
TVectorUInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(degrees))
523
if (TVectorUInt64.LessThanOrEqualAll(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(x)), TVectorUInt64.Create(V_ARG_MAX)))
529
TVectorUInt64 n = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(dn);
566
return poly * Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>((n + TVectorUInt64.Create(V_DP64_BIAS)) << 52);
654
if (TVectorUInt32.GreaterThanAny(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(x)), TVectorUInt32.Create(V_ARG_MAX)))
681
TVectorUInt64 n = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(dn);
700
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(poly) + (n << 52));
720
TVectorUInt64 xBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ax);
721
TVectorUInt64 yBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ay);
730
TVectorDouble insignificanMask = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(
739
TVectorDouble expFix = TVectorDouble.ConditionalSelect(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(scaleDownMask), TVectorDouble.Create(4.149515568880993E+180), TVectorDouble.One);
745
expFix = TVectorDouble.ConditionalSelect(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(scaleUpMask), TVectorDouble.Create(2.409919865102884E-181), expFix);
760
ax = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xBits);
761
ax -= subnormalFix & Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xSubnormalMask);
765
ay = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(yBits);
766
ay -= subnormalFix & Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(ySubnormalMask);
768
xBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ax);
769
yBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ay);
779
xBits = TVectorUInt64.ConditionalSelect(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(lessThanMask), yBits, xBits);
780
yBits = TVectorUInt64.ConditionalSelect(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(lessThanMask), tmpBits, yBits);
787
TVectorDouble xHead = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xBits & headMask);
788
TVectorDouble yHead = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(yBits & headMask);
810
TVectorDouble equalExponentsMask = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(TVectorUInt64.IsZero(expDiff));
888
TVectorUInt32 bits = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(vector));
905
return Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(result);
913
TVectorUInt64 bits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(vector));
930
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(result);
938
TVectorUInt32 bits = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(vector));
951
return Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(result);
959
TVectorUInt64 bits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(vector));
972
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(result);
1045
TVectorUInt64 specialMask = TVectorUInt64.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_MIN), TVectorUInt64.Create(V_MAX - V_MIN));
1074
TVectorDouble subnormalMask = TVectorDouble.AndNot(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask), temp);
1079
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x * 4503599627370496.0) - TVectorUInt64.Create(52ul << 52)),
1083
specialMask = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(temp);
1087
TVectorUInt64 vx = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_OFF);
1088
TVectorDouble n = ConvertToDouble<TVectorInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorUInt64, TVectorInt64>(vx) >> 52);
1092
TVectorDouble r = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(vx) - TVectorDouble.One;
1139
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask),
1226
TVectorUInt32 specialMask = TVectorUInt32.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_MIN), TVectorUInt32.Create(V_MAX - V_MIN));
1255
TVectorSingle subnormalMask = TVectorSingle.AndNot(Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask), temp);
1259
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x * 8388608.0f) - TVectorUInt32.Create(23u << 23)),
1263
specialMask = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(temp);
1266
TVectorUInt32 vx = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_OFF);
1267
TVectorSingle n = ConvertToSingle<TVectorInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorUInt32, TVectorInt32>(vx) >> 23);
1271
TVectorSingle r = Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(vx) - TVectorSingle.Create(1.0f);
1298
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask),
1365
TVectorUInt64 specialMask = TVectorUInt64.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_MIN), TVectorUInt64.Create(V_MAX - V_MIN));
1394
TVectorDouble subnormalMask = TVectorDouble.AndNot(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask), temp);
1399
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x * 4503599627370496.0) - TVectorUInt64.Create(52ul << 52)),
1403
specialMask = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(temp);
1407
TVectorUInt64 vx = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_OFF);
1408
TVectorDouble n = ConvertToDouble<TVectorInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorUInt64, TVectorInt64>(vx) >> 52);
1412
TVectorDouble r = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(vx) - TVectorDouble.One;
1459
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask),
1542
TVectorUInt32 specialMask = TVectorUInt32.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_MIN), TVectorUInt32.Create(V_MAX - V_MIN));
1571
TVectorSingle subnormalMask = TVectorSingle.AndNot(Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask), temp);
1576
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x * 8388608.0f) - TVectorUInt32.Create(23u << 23)),
1580
specialMask = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(temp);
1584
TVectorUInt32 vx = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_OFF);
1585
TVectorSingle n = ConvertToSingle<TVectorInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorUInt32, TVectorInt32>(vx) >> 23);
1589
TVectorSingle r = Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(vx) - TVectorSingle.One;
1616
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask),
1801
TVectorUInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(radians))
1967
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
2006
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2012
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2017
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2020
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2026
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
2037
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
2043
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
2086
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
2161
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2167
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2183
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2189
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2194
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2197
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2203
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
2287
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
2317
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2322
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2325
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2336
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
2417
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
2474
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2489
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2494
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2497
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
3082
TVectorInt64 region = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(npi2);
3324
TVectorDouble s1 = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(s) & TVectorUInt64.Create(0xFFFFFFFF00000000));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (1)
28
return Unsafe.
BitCast
<T, ushort>(value) - 1u < 254u;
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (23)
50
vector = new Vector<byte>(Unsafe.
BitCast
<T, byte>(value));
54
vector = (Vector<byte>)new Vector<ushort>(Unsafe.
BitCast
<T, ushort>(value));
60
? (Vector<byte>)new Vector<float>(Unsafe.
BitCast
<T, float>(value))
61
: (Vector<byte>)new Vector<uint>(Unsafe.
BitCast
<T, uint>(value));
67
? (Vector<byte>)new Vector<double>(Unsafe.
BitCast
<T, double>(value))
68
: (Vector<byte>)new Vector<ulong>(Unsafe.
BitCast
<T, ulong>(value));
72
vector = Unsafe.
BitCast
<T, Vector<byte>>(value);
78
vector = Vector256.Create(Unsafe.
BitCast
<T, Vector128<byte>>(value)).AsVector();
82
vector = Vector512.Create(Unsafe.
BitCast
<T, Vector128<byte>>(value)).AsVector();
94
vector = Vector512.Create(Unsafe.
BitCast
<T, Vector256<byte>>(value)).AsVector();
1466
return PackedSpanHelpers.Contains(ref Unsafe.As<T, short>(ref searchSpace), Unsafe.
BitCast
<T, short>(value), length);
1650
? PackedSpanHelpers.IndexOf(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value), length)
1651
: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value), length);
1864
char char0 = Unsafe.
BitCast
<TValue, char>(value0);
1865
char char1 = Unsafe.
BitCast
<TValue, char>(value1);
2125
? PackedSpanHelpers.IndexOfAny(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value0), Unsafe.
BitCast
<TValue, char>(value1), Unsafe.
BitCast
<TValue, char>(value2), length)
2126
: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value0), Unsafe.
BitCast
<TValue, char>(value1), Unsafe.
BitCast
<TValue, char>(value2), length);
3872
char charLowInclusive = Unsafe.
BitCast
<T, char>(lowInclusive);
3873
char charRange = (char)(Unsafe.
BitCast
<T, char>(highInclusive) - charLowInclusive);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.cs (2)
70
? (Unsafe.
BitCast
<T, byte>(Unsafe.Add(ref searchSpace, j)) > 127)
71
: (Unsafe.
BitCast
<T, char>(Unsafe.Add(ref searchSpace, j)) > 127))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (50)
182
=> Unsafe.
BitCast
<int, float>(Exchange(ref Unsafe.As<float, int>(ref location1), Unsafe.
BitCast
<float, int>(value)));
191
=> Unsafe.
BitCast
<long, double>(Exchange(ref Unsafe.As<double, long>(ref location1), Unsafe.
BitCast
<double, long>(value)));
257
return Unsafe.
BitCast
<byte, T>(
260
Unsafe.
BitCast
<T, byte>(value)));
265
return Unsafe.
BitCast
<ushort, T>(
268
Unsafe.
BitCast
<T, ushort>(value)));
273
return Unsafe.
BitCast
<int, T>(
276
Unsafe.
BitCast
<T, int>(value)));
280
return Unsafe.
BitCast
<long, T>(
283
Unsafe.
BitCast
<T, long>(value)));
428
=> Unsafe.
BitCast
<int, float>(CompareExchange(ref Unsafe.As<float, int>(ref location1), Unsafe.
BitCast
<float, int>(value), Unsafe.
BitCast
<float, int>(comparand)));
438
=> Unsafe.
BitCast
<long, double>(CompareExchange(ref Unsafe.As<double, long>(ref location1), Unsafe.
BitCast
<double, long>(value), Unsafe.
BitCast
<double, long>(comparand)));
507
return Unsafe.
BitCast
<byte, T>(
510
Unsafe.
BitCast
<T, byte>(value),
511
Unsafe.
BitCast
<T, byte>(comparand)));
516
return Unsafe.
BitCast
<ushort, T>(
519
Unsafe.
BitCast
<T, ushort>(value),
520
Unsafe.
BitCast
<T, ushort>(comparand)));
525
return Unsafe.
BitCast
<int, T>(
528
Unsafe.
BitCast
<T, int>(value),
529
Unsafe.
BitCast
<T, int>(comparand)));
533
return Unsafe.
BitCast
<long, T>(
536
Unsafe.
BitCast
<T, long>(value),
537
Unsafe.
BitCast
<T, long>(comparand)));
666
byte current = Unsafe.
BitCast
<T, byte>(location1);
669
byte newValue = (byte)(current & Unsafe.
BitCast
<T, byte>(value));
676
return Unsafe.
BitCast
<byte, T>(oldValue);
684
ushort current = Unsafe.
BitCast
<T, ushort>(location1);
687
ushort newValue = (ushort)(current & Unsafe.
BitCast
<T, ushort>(value));
694
return Unsafe.
BitCast
<ushort, T>(oldValue);
702
return Unsafe.
BitCast
<int, T>(
705
Unsafe.
BitCast
<T, int>(value)));
709
return Unsafe.
BitCast
<long, T>(
712
Unsafe.
BitCast
<T, long>(value)));
809
byte current = Unsafe.
BitCast
<T, byte>(location1);
812
byte newValue = (byte)(current | Unsafe.
BitCast
<T, byte>(value));
819
return Unsafe.
BitCast
<byte, T>(oldValue);
827
ushort current = Unsafe.
BitCast
<T, ushort>(location1);
830
ushort newValue = (ushort)(current | Unsafe.
BitCast
<T, ushort>(value));
837
return Unsafe.
BitCast
<ushort, T>(oldValue);
845
return Unsafe.
BitCast
<int, T>(
848
Unsafe.
BitCast
<T, int>(value)));
852
return Unsafe.
BitCast
<long, T>(
855
Unsafe.
BitCast
<T, long>(value)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (4)
253
((uint)value).TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination), out valueCharsWritten) :
254
((uint)value).TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination), out valueCharsWritten, default, CultureInfo.InvariantCulture);
458
Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(originalInput).ToString() :
459
Encoding.UTF8.GetString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(originalInput));
System.Runtime.Numerics (27)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (2)
106
return Encoding.UTF8.GetString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(slice));
111
return Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(slice).ToString();
System\Number.BigInteger.cs (9)
848
spanSuccess = value._sign.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination), out charsWritten, formatSpan, info);
853
spanSuccess = value._sign.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination), out charsWritten, formatSpan, info);
935
sNegative = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(sNegative),
987
strResult = Encoding.UTF8.GetString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(vlb.AsSpan()));
992
strResult = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(vlb.AsSpan()).ToString();
1589
return nuint.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(input), TParser.BlockNumberStyle, null, out result);
1594
return nuint.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(input), TParser.BlockNumberStyle, null, out result);
1636
? (Convert.FromHexString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(input), MemoryMarshal.AsBytes(destination), out _, out _) != OperationStatus.Done)
1637
: (Convert.FromHexString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(input), MemoryMarshal.AsBytes(destination), out _, out _) != OperationStatus.Done))
System\Number.Polyfill.cs (4)
115
? Rune.DecodeFromUtf8(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span), out result, out elemsConsumed)
116
: Rune.DecodeFromUtf16(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span), out result, out elemsConsumed);
125
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(Encoding.UTF8.GetBytes(value));
130
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(value);
System\Numerics\Complex.cs (4)
882
? m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(1)), out int realChars, format, provider)
883
: m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider))
892
? m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(2)), out int imaginaryChars, format, provider)
893
: m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(2)), out imaginaryChars, format, provider))
System\Numerics\Complex.Generic.cs (8)
1962
? !T.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(slice), componentStyle, provider, out T? real)
1963
: !T.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(slice), componentStyle, provider, out real))
1983
? !T.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(slice), componentStyle, provider, out T? imaginary)
1984
: !T.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(slice), componentStyle, provider, out imaginary))
2088
? m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(1)), out int realChars, format, provider)
2089
: m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider))
2098
? m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(2)), out int imaginaryChars, format, provider)
2099
: m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(2)), out imaginaryChars, format, provider))
System.Threading.Tasks.Parallel (2)
System\Threading\Tasks\ParallelLoopState.cs (2)
362
return Unsafe.
BitCast
<int, TInt>(Volatile.Read(ref Unsafe.As<TInt, int>(ref _lowestBreakIteration)));
366
return Unsafe.
BitCast
<long, TInt>(Volatile.Read(ref Unsafe.As<TInt, long>(ref _lowestBreakIteration)));