476 references to BitCast
System.Linq (2)
System\Linq\Sum.cs (2)
63
return (TResult)(object)SumSignedIntegersVectorized(Unsafe.
BitCast
<ReadOnlySpan<T>, ReadOnlySpan<long>>(span));
67
return (TResult)(object)SumSignedIntegersVectorized(Unsafe.
BitCast
<ReadOnlySpan<T>, ReadOnlySpan<int>>(span));
System.Numerics.Tensors (4)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertHelpers.cs (2)
392
public static float Invoke(short x) => (float)Unsafe.
BitCast
<short, Half>(x);
573
public static ushort Invoke(float x) => Unsafe.
BitCast
<Half, ushort>((Half)x);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
53
return Unsafe.
BitCast
<Span<TFrom>, Span<TTo>>(span);
69
return Unsafe.
BitCast
<ReadOnlySpan<TFrom>, ReadOnlySpan<TTo>>(span);
System.Private.CoreLib (464)
src\libraries\System.Private.CoreLib\src\System\Array.cs (8)
1903
Unsafe.
BitCast
<T, byte>(value),
1911
Unsafe.
BitCast
<T, short>(value),
1919
Unsafe.
BitCast
<T, int>(value),
1927
Unsafe.
BitCast
<T, long>(value),
2148
Unsafe.
BitCast
<T, byte>(value),
2158
Unsafe.
BitCast
<T, short>(value),
2168
Unsafe.
BitCast
<T, int>(value),
2178
Unsafe.
BitCast
<T, long>(value),
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (8)
908
public static long DoubleToInt64Bits(double value) => Unsafe.
BitCast
<double, long>(value);
916
public static double Int64BitsToDouble(long value) => Unsafe.
BitCast
<long, double>(value);
924
public static int SingleToInt32Bits(float value) => Unsafe.
BitCast
<float, int>(value);
932
public static float Int32BitsToSingle(int value) => Unsafe.
BitCast
<int, float>(value);
957
public static ulong DoubleToUInt64Bits(double value) => Unsafe.
BitCast
<double, ulong>(value);
966
public static double UInt64BitsToDouble(ulong value) => Unsafe.
BitCast
<ulong, double>(value);
975
public static uint SingleToUInt32Bits(float value) => Unsafe.
BitCast
<float, uint>(value);
984
public static float UInt32BitsToSingle(uint value) => Unsafe.
BitCast
<uint, float>(value);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (5)
1476
return result ?? Unsafe.
BitCast
<TStorage, TUnderlying>(value).ToString()!;
1514
result = Unsafe.
BitCast
<TStorage, TUnderlying>(value).ToString()!;
1866
if (GetNameInlined(enumInfo, Unsafe.
BitCast
<TUnderlying, TStorage>(value)) is string enumName)
1881
if (TryFormatFlagNames(enumInfo, Unsafe.
BitCast
<TUnderlying, TStorage>(value), destination, out charsWritten, ref destinationIsTooSmall) || destinationIsTooSmall)
1914
if (TryFormatFlagNames(GetEnumInfo<TStorage>(enumType), Unsafe.
BitCast
<TUnderlying, TStorage>(value), destination, out charsWritten, ref destinationIsTooSmall) ||
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\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (10)
372
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(AMDesignator) :
373
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(amDesignatorUtf8 ??= Encoding.UTF8.GetBytes(AMDesignator));
621
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(DateSeparator) :
622
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(dateSeparatorUtf8 ??= Encoding.UTF8.GetBytes(DateSeparator));
824
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(PMDesignator) :
825
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(pmDesignatorUtf8 ??= Encoding.UTF8.GetBytes(PMDesignator));
1006
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(TimeSeparator) :
1007
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(timeSeparatorUtf8 ??= Encoding.UTF8.GetBytes(TimeSeparator));
1706
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(DecimalSeparator) :
1707
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_decimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(DecimalSeparator));
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (28)
272
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencyDecimalSeparator) :
273
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencyDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_currencyDecimalSeparator));
364
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencyGroupSeparator) :
365
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencyGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_currencyGroupSeparator));
386
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencySymbol) :
387
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencySymbolUtf8 ??= Encoding.UTF8.GetBytes(_currencySymbol));
432
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_nanSymbol) :
433
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_nanSymbolUtf8 ??= Encoding.UTF8.GetBytes(_nanSymbol));
517
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_negativeInfinitySymbol) :
518
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_negativeInfinitySymbolUtf8 ??= Encoding.UTF8.GetBytes(_negativeInfinitySymbol));
540
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_negativeSign) :
541
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_negativeSignUtf8 ??= Encoding.UTF8.GetBytes(_negativeSign));
576
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_numberDecimalSeparator) :
577
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_numberDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_numberDecimalSeparator));
597
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_numberGroupSeparator) :
598
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_numberGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_numberGroupSeparator));
634
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_positiveInfinitySymbol) :
635
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_positiveInfinitySymbolUtf8 ??= Encoding.UTF8.GetBytes(_positiveInfinitySymbol));
657
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_positiveSign) :
658
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_positiveSignUtf8 ??= Encoding.UTF8.GetBytes(_positiveSign));
693
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentDecimalSeparator) :
694
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_percentDecimalSeparator));
714
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentGroupSeparator) :
715
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_percentGroupSeparator));
735
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentSymbol) :
736
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentSymbolUtf8 ??= Encoding.UTF8.GetBytes(_percentSymbol));
757
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_perMilleSymbol) :
758
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_perMilleSymbolUtf8 ??= Encoding.UTF8.GetBytes(_perMilleSymbol));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (7)
889
ReadOnlySpan<char> charSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(str);
918
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(new ReadOnlySpan<char>(chArr, 0, newLength));
924
ReadOnlySpan<byte> srcUtf8Span = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(str);
977
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(destUtf8Span.Slice(0, newLength));
1081
return Unsafe.
BitCast
<Guid, Vector128<byte>>(left) == Unsafe.
BitCast
<Guid, Vector128<byte>>(right);
1517
Vector128<byte> srcVec = Unsafe.
BitCast
<Guid, Vector128<byte>>(value);
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),
815
Unsafe.
BitCast
<T, byte>(value),
822
Unsafe.
BitCast
<T, short>(value),
829
Unsafe.
BitCast
<T, int>(value),
836
Unsafe.
BitCast
<T, long>(value),
864
Unsafe.
BitCast
<T, byte>(value),
871
Unsafe.
BitCast
<T, short>(value),
878
Unsafe.
BitCast
<T, int>(value),
885
Unsafe.
BitCast
<T, long>(value),
942
Unsafe.
BitCast
<T, byte>(value0),
943
Unsafe.
BitCast
<T, byte>(value1),
950
Unsafe.
BitCast
<T, short>(value0),
951
Unsafe.
BitCast
<T, short>(value1),
980
Unsafe.
BitCast
<T, byte>(value0),
981
Unsafe.
BitCast
<T, byte>(value1),
988
Unsafe.
BitCast
<T, short>(value0),
989
Unsafe.
BitCast
<T, short>(value1),
1049
Unsafe.
BitCast
<T, byte>(value0),
1050
Unsafe.
BitCast
<T, byte>(value1),
1051
Unsafe.
BitCast
<T, byte>(value2),
1058
Unsafe.
BitCast
<T, short>(value0),
1059
Unsafe.
BitCast
<T, short>(value1),
1060
Unsafe.
BitCast
<T, short>(value2),
1090
Unsafe.
BitCast
<T, byte>(value0),
1091
Unsafe.
BitCast
<T, byte>(value1),
1092
Unsafe.
BitCast
<T, byte>(value2),
1099
Unsafe.
BitCast
<T, short>(value0),
1100
Unsafe.
BitCast
<T, short>(value1),
1101
Unsafe.
BitCast
<T, short>(value2),
1152
Unsafe.
BitCast
<T, byte>(value0),
1153
Unsafe.
BitCast
<T, byte>(value1),
1154
Unsafe.
BitCast
<T, byte>(value2),
1155
Unsafe.
BitCast
<T, byte>(value3),
1162
Unsafe.
BitCast
<T, short>(value0),
1163
Unsafe.
BitCast
<T, short>(value1),
1164
Unsafe.
BitCast
<T, short>(value2),
1165
Unsafe.
BitCast
<T, short>(value3),
1393
Unsafe.
BitCast
<T, byte>(value),
1400
Unsafe.
BitCast
<T, short>(value),
1407
Unsafe.
BitCast
<T, int>(value),
1414
Unsafe.
BitCast
<T, long>(value),
1442
Unsafe.
BitCast
<T, byte>(value),
1449
Unsafe.
BitCast
<T, short>(value),
1456
Unsafe.
BitCast
<T, int>(value),
1463
Unsafe.
BitCast
<T, long>(value),
1520
Unsafe.
BitCast
<T, byte>(value0),
1521
Unsafe.
BitCast
<T, byte>(value1),
1528
Unsafe.
BitCast
<T, short>(value0),
1529
Unsafe.
BitCast
<T, short>(value1),
1558
Unsafe.
BitCast
<T, byte>(value0),
1559
Unsafe.
BitCast
<T, byte>(value1),
1566
Unsafe.
BitCast
<T, short>(value0),
1567
Unsafe.
BitCast
<T, short>(value1),
1627
Unsafe.
BitCast
<T, byte>(value0),
1628
Unsafe.
BitCast
<T, byte>(value1),
1629
Unsafe.
BitCast
<T, byte>(value2),
1636
Unsafe.
BitCast
<T, short>(value0),
1637
Unsafe.
BitCast
<T, short>(value1),
1638
Unsafe.
BitCast
<T, short>(value2),
1668
Unsafe.
BitCast
<T, byte>(value0),
1669
Unsafe.
BitCast
<T, byte>(value1),
1670
Unsafe.
BitCast
<T, byte>(value2),
1677
Unsafe.
BitCast
<T, short>(value0),
1678
Unsafe.
BitCast
<T, short>(value1),
1679
Unsafe.
BitCast
<T, short>(value2),
1731
Unsafe.
BitCast
<T, byte>(value0),
1732
Unsafe.
BitCast
<T, byte>(value1),
1733
Unsafe.
BitCast
<T, byte>(value2),
1734
Unsafe.
BitCast
<T, byte>(value3),
1741
Unsafe.
BitCast
<T, short>(value0),
1742
Unsafe.
BitCast
<T, short>(value1),
1743
Unsafe.
BitCast
<T, short>(value2),
1744
Unsafe.
BitCast
<T, short>(value3),
1921
Unsafe.
BitCast
<T, byte>(lowInclusive),
1922
Unsafe.
BitCast
<T, byte>(highInclusive),
1930
Unsafe.
BitCast
<T, ushort>(lowInclusive),
1931
Unsafe.
BitCast
<T, ushort>(highInclusive),
1939
Unsafe.
BitCast
<T, uint>(lowInclusive),
1940
Unsafe.
BitCast
<T, uint>(highInclusive),
1948
Unsafe.
BitCast
<T, ulong>(lowInclusive),
1949
Unsafe.
BitCast
<T, ulong>(highInclusive),
1986
Unsafe.
BitCast
<T, byte>(lowInclusive),
1987
Unsafe.
BitCast
<T, byte>(highInclusive),
1995
Unsafe.
BitCast
<T, ushort>(lowInclusive),
1996
Unsafe.
BitCast
<T, ushort>(highInclusive),
2004
Unsafe.
BitCast
<T, uint>(lowInclusive),
2005
Unsafe.
BitCast
<T, uint>(highInclusive),
2013
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2014
Unsafe.
BitCast
<T, ulong>(highInclusive),
2051
Unsafe.
BitCast
<T, byte>(lowInclusive),
2052
Unsafe.
BitCast
<T, byte>(highInclusive),
2060
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2061
Unsafe.
BitCast
<T, ushort>(highInclusive),
2069
Unsafe.
BitCast
<T, uint>(lowInclusive),
2070
Unsafe.
BitCast
<T, uint>(highInclusive),
2078
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2079
Unsafe.
BitCast
<T, ulong>(highInclusive),
2116
Unsafe.
BitCast
<T, byte>(lowInclusive),
2117
Unsafe.
BitCast
<T, byte>(highInclusive),
2125
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2126
Unsafe.
BitCast
<T, ushort>(highInclusive),
2134
Unsafe.
BitCast
<T, uint>(lowInclusive),
2135
Unsafe.
BitCast
<T, uint>(highInclusive),
2143
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2144
Unsafe.
BitCast
<T, ulong>(highInclusive),
2189
Unsafe.
BitCast
<T, byte>(value),
2195
Unsafe.
BitCast
<T, short>(value),
2201
Unsafe.
BitCast
<T, int>(value),
2207
Unsafe.
BitCast
<T, long>(value),
2230
Unsafe.
BitCast
<T, byte>(value),
2236
Unsafe.
BitCast
<T, short>(value),
2242
Unsafe.
BitCast
<T, int>(value),
2248
Unsafe.
BitCast
<T, long>(value),
2385
Unsafe.
BitCast
<T, byte>(value),
2392
Unsafe.
BitCast
<T, short>(value),
2399
Unsafe.
BitCast
<T, int>(value),
2406
Unsafe.
BitCast
<T, long>(value),
2431
Unsafe.
BitCast
<T, byte>(value),
2438
Unsafe.
BitCast
<T, short>(value),
2445
Unsafe.
BitCast
<T, int>(value),
2452
Unsafe.
BitCast
<T, long>(value),
2648
Unsafe.
BitCast
<T, byte>(value0),
2649
Unsafe.
BitCast
<T, byte>(value1),
2656
Unsafe.
BitCast
<T, short>(value0),
2657
Unsafe.
BitCast
<T, short>(value1),
2683
Unsafe.
BitCast
<T, byte>(value0),
2684
Unsafe.
BitCast
<T, byte>(value1),
2691
Unsafe.
BitCast
<T, short>(value0),
2692
Unsafe.
BitCast
<T, short>(value1),
2748
Unsafe.
BitCast
<T, byte>(value0),
2749
Unsafe.
BitCast
<T, byte>(value1),
2750
Unsafe.
BitCast
<T, byte>(value2),
2757
Unsafe.
BitCast
<T, short>(value0),
2758
Unsafe.
BitCast
<T, short>(value1),
2759
Unsafe.
BitCast
<T, short>(value2),
2786
Unsafe.
BitCast
<T, byte>(value0),
2787
Unsafe.
BitCast
<T, byte>(value1),
2788
Unsafe.
BitCast
<T, byte>(value2),
2795
Unsafe.
BitCast
<T, short>(value0),
2796
Unsafe.
BitCast
<T, short>(value1),
2797
Unsafe.
BitCast
<T, short>(value2),
3068
Unsafe.
BitCast
<T, byte>(value0),
3069
Unsafe.
BitCast
<T, byte>(value1),
3076
Unsafe.
BitCast
<T, short>(value0),
3077
Unsafe.
BitCast
<T, short>(value1),
3103
Unsafe.
BitCast
<T, byte>(value0),
3104
Unsafe.
BitCast
<T, byte>(value1),
3111
Unsafe.
BitCast
<T, short>(value0),
3112
Unsafe.
BitCast
<T, short>(value1),
3169
Unsafe.
BitCast
<T, byte>(value0),
3170
Unsafe.
BitCast
<T, byte>(value1),
3171
Unsafe.
BitCast
<T, byte>(value2),
3178
Unsafe.
BitCast
<T, short>(value0),
3179
Unsafe.
BitCast
<T, short>(value1),
3180
Unsafe.
BitCast
<T, short>(value2),
3207
Unsafe.
BitCast
<T, byte>(value0),
3208
Unsafe.
BitCast
<T, byte>(value1),
3209
Unsafe.
BitCast
<T, byte>(value2),
3216
Unsafe.
BitCast
<T, short>(value0),
3217
Unsafe.
BitCast
<T, short>(value1),
3218
Unsafe.
BitCast
<T, short>(value2),
4433
Unsafe.
BitCast
<T, byte>(oldValue),
4434
Unsafe.
BitCast
<T, byte>(newValue),
4445
Unsafe.
BitCast
<T, ushort>(oldValue),
4446
Unsafe.
BitCast
<T, ushort>(newValue),
4456
Unsafe.
BitCast
<T, int>(oldValue),
4457
Unsafe.
BitCast
<T, int>(newValue),
4467
Unsafe.
BitCast
<T, long>(oldValue),
4468
Unsafe.
BitCast
<T, long>(newValue),
4499
Unsafe.
BitCast
<T, byte>(oldValue),
4500
Unsafe.
BitCast
<T, byte>(newValue),
4511
Unsafe.
BitCast
<T, ushort>(oldValue),
4512
Unsafe.
BitCast
<T, ushort>(newValue),
4522
Unsafe.
BitCast
<T, int>(oldValue),
4523
Unsafe.
BitCast
<T, int>(newValue),
4533
Unsafe.
BitCast
<T, long>(oldValue),
4534
Unsafe.
BitCast
<T, long>(newValue),
4611
Unsafe.
BitCast
<T, byte>(oldValue),
4612
Unsafe.
BitCast
<T, byte>(newValue),
4622
Unsafe.
BitCast
<T, ushort>(oldValue),
4623
Unsafe.
BitCast
<T, ushort>(newValue),
4632
Unsafe.
BitCast
<T, int>(oldValue),
4633
Unsafe.
BitCast
<T, int>(newValue),
4642
Unsafe.
BitCast
<T, long>(oldValue),
4643
Unsafe.
BitCast
<T, long>(newValue),
4697
Unsafe.
BitCast
<T, byte>(oldValue),
4698
Unsafe.
BitCast
<T, byte>(newValue),
4708
Unsafe.
BitCast
<T, ushort>(oldValue),
4709
Unsafe.
BitCast
<T, ushort>(newValue),
4718
Unsafe.
BitCast
<T, int>(oldValue),
4719
Unsafe.
BitCast
<T, int>(newValue),
4728
Unsafe.
BitCast
<T, long>(oldValue),
4729
Unsafe.
BitCast
<T, long>(newValue),
5383
Unsafe.
BitCast
<T, byte>(value),
5390
Unsafe.
BitCast
<T, short>(value),
5397
Unsafe.
BitCast
<T, int>(value),
5404
Unsafe.
BitCast
<T, long>(value),
5432
Unsafe.
BitCast
<T, byte>(value),
5439
Unsafe.
BitCast
<T, short>(value),
5446
Unsafe.
BitCast
<T, int>(value),
5453
Unsafe.
BitCast
<T, long>(value),
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (2)
617
if (source.TryCopyTo(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination)))
628
return Encoding.UTF8.TryGetBytes(source, Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination), out charsWritten);
src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (13)
898
ReadOnlySpan<char> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span);
899
ReadOnlySpan<char> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(value);
906
ReadOnlySpan<byte> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span);
907
ReadOnlySpan<byte> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
918
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span).Trim());
924
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span).TrimUtf8());
934
ReadOnlySpan<char> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span);
935
ReadOnlySpan<char> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(value);
942
ReadOnlySpan<byte> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span);
943
ReadOnlySpan<byte> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
1056
ReadOnlySpan<byte> bytes = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
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\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\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (1)
152
return Unsafe.
BitCast
<Vector<TFrom>, Vector<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.Extensions.cs (2)
15
public static Plane AsPlane(this Vector4 value) => Unsafe.
BitCast
<Vector4, Plane>(value);
20
public static Quaternion AsQuaternion(this Vector4 value) => Unsafe.
BitCast
<Vector4, Quaternion>(value);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (1)
180
return Unsafe.
BitCast
<Vector128<TFrom>, Vector128<TTo>>(vector);
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\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (1)
174
return Unsafe.
BitCast
<Vector256<TFrom>, Vector256<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (1)
173
return Unsafe.
BitCast
<Vector512<TFrom>, Vector512<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (1)
173
return Unsafe.
BitCast
<Vector64<TFrom>, Vector64<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (102)
78
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
113
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
119
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
130
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
216
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
273
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
287
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
293
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
411
if (TVectorUInt64.LessThanOrEqualAll(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(x)), TVectorUInt64.Create(V_ARG_MAX)))
417
TVectorUInt64 n = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(dn);
454
return poly * Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>((n + TVectorUInt64.Create(V_DP64_BIAS)) << 52);
542
if (TVectorUInt32.GreaterThanAny(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(x)), TVectorUInt32.Create(V_ARG_MAX)))
569
TVectorUInt64 n = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(dn);
588
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(poly) + (n << 52));
608
TVectorUInt64 xBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ax);
609
TVectorUInt64 yBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ay);
618
TVectorDouble insignificanMask = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(
627
TVectorDouble expFix = TVectorDouble.ConditionalSelect(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(scaleDownMask), TVectorDouble.Create(4.149515568880993E+180), TVectorDouble.One);
633
expFix = TVectorDouble.ConditionalSelect(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(scaleUpMask), TVectorDouble.Create(2.409919865102884E-181), expFix);
648
ax = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xBits);
649
ax -= subnormalFix & Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xSubnormalMask);
653
ay = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(yBits);
654
ay -= subnormalFix & Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(ySubnormalMask);
656
xBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ax);
657
yBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ay);
667
xBits = TVectorUInt64.ConditionalSelect(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(lessThanMask), yBits, xBits);
668
yBits = TVectorUInt64.ConditionalSelect(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(lessThanMask), tmpBits, yBits);
675
TVectorDouble xHead = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xBits & headMask);
676
TVectorDouble yHead = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(yBits & headMask);
698
TVectorDouble equalExponentsMask = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(TVectorUInt64.IsZero(expDiff));
776
TVectorUInt32 bits = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(vector));
793
return Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(result);
801
TVectorUInt64 bits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(vector));
818
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(result);
826
TVectorUInt32 bits = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(vector));
839
return Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(result);
847
TVectorUInt64 bits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(vector));
860
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(result);
933
TVectorUInt64 specialMask = TVectorUInt64.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_MIN), TVectorUInt64.Create(V_MAX - V_MIN));
962
TVectorDouble subnormalMask = TVectorDouble.AndNot(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask), temp);
967
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x * 4503599627370496.0) - TVectorUInt64.Create(52ul << 52)),
971
specialMask = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(temp);
975
TVectorUInt64 vx = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_OFF);
976
TVectorDouble n = ConvertToDouble<TVectorInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorUInt64, TVectorInt64>(vx) >> 52);
980
TVectorDouble r = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(vx) - TVectorDouble.One;
1027
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask),
1114
TVectorUInt32 specialMask = TVectorUInt32.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_MIN), TVectorUInt32.Create(V_MAX - V_MIN));
1143
TVectorSingle subnormalMask = TVectorSingle.AndNot(Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask), temp);
1147
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x * 8388608.0f) - TVectorUInt32.Create(23u << 23)),
1151
specialMask = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(temp);
1154
TVectorUInt32 vx = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_OFF);
1155
TVectorSingle n = ConvertToSingle<TVectorInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorUInt32, TVectorInt32>(vx) >> 23);
1159
TVectorSingle r = Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(vx) - TVectorSingle.Create(1.0f);
1186
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask),
1253
TVectorUInt64 specialMask = TVectorUInt64.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_MIN), TVectorUInt64.Create(V_MAX - V_MIN));
1282
TVectorDouble subnormalMask = TVectorDouble.AndNot(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask), temp);
1287
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x * 4503599627370496.0) - TVectorUInt64.Create(52ul << 52)),
1291
specialMask = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(temp);
1295
TVectorUInt64 vx = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_OFF);
1296
TVectorDouble n = ConvertToDouble<TVectorInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorUInt64, TVectorInt64>(vx) >> 52);
1300
TVectorDouble r = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(vx) - TVectorDouble.One;
1347
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask),
1430
TVectorUInt32 specialMask = TVectorUInt32.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_MIN), TVectorUInt32.Create(V_MAX - V_MIN));
1459
TVectorSingle subnormalMask = TVectorSingle.AndNot(Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask), temp);
1464
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x * 8388608.0f) - TVectorUInt32.Create(23u << 23)),
1468
specialMask = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(temp);
1472
TVectorUInt32 vx = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_OFF);
1473
TVectorSingle n = ConvertToSingle<TVectorInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorUInt32, TVectorInt32>(vx) >> 23);
1477
TVectorSingle r = Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(vx) - TVectorSingle.One;
1504
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask),
1803
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
1842
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
1848
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
1853
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
1856
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
1862
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
1873
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
1879
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
1922
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
1997
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2003
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2019
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2025
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2030
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2033
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2039
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
2123
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
2153
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2158
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2161
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2172
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
2253
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
2310
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2325
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2330
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2333
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2880
TVectorInt64 region = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(npi2);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (1)
28
return Unsafe.
BitCast
<T, ushort>(value) - 1u < 254u;
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (23)
36
vector = new Vector<byte>(Unsafe.
BitCast
<T, byte>(value));
40
vector = (Vector<byte>)new Vector<ushort>(Unsafe.
BitCast
<T, ushort>(value));
46
? (Vector<byte>)new Vector<float>(Unsafe.
BitCast
<T, float>(value))
47
: (Vector<byte>)new Vector<uint>(Unsafe.
BitCast
<T, uint>(value));
53
? (Vector<byte>)new Vector<double>(Unsafe.
BitCast
<T, double>(value))
54
: (Vector<byte>)new Vector<ulong>(Unsafe.
BitCast
<T, ulong>(value));
58
vector = Unsafe.
BitCast
<T, Vector<byte>>(value);
64
vector = Vector256.Create(Unsafe.
BitCast
<T, Vector128<byte>>(value)).AsVector();
68
vector = Vector512.Create(Unsafe.
BitCast
<T, Vector128<byte>>(value)).AsVector();
80
vector = Vector512.Create(Unsafe.
BitCast
<T, Vector256<byte>>(value)).AsVector();
1310
return PackedSpanHelpers.Contains(ref Unsafe.As<T, short>(ref searchSpace), Unsafe.
BitCast
<T, short>(value), length);
1487
? PackedSpanHelpers.IndexOf(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value), length)
1488
: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value), length);
1673
char char0 = Unsafe.
BitCast
<TValue, char>(value0);
1674
char char1 = Unsafe.
BitCast
<TValue, char>(value1);
1900
? 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)
1901
: 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);
3484
char charLowInclusive = Unsafe.
BitCast
<T, char>(lowInclusive);
3485
char charRange = (char)(Unsafe.
BitCast
<T, char>(highInclusive) - charLowInclusive);
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\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (30)
184
=> Unsafe.
BitCast
<int, float>(Exchange(ref Unsafe.As<float, int>(ref location1), Unsafe.
BitCast
<float, int>(value)));
193
=> Unsafe.
BitCast
<long, double>(Exchange(ref Unsafe.As<double, long>(ref location1), Unsafe.
BitCast
<double, long>(value)));
261
return Unsafe.
BitCast
<byte, T>(
264
Unsafe.
BitCast
<T, byte>(value)));
269
return Unsafe.
BitCast
<ushort, T>(
272
Unsafe.
BitCast
<T, ushort>(value)));
277
return Unsafe.
BitCast
<int, T>(
280
Unsafe.
BitCast
<T, int>(value)));
284
return Unsafe.
BitCast
<long, T>(
287
Unsafe.
BitCast
<T, long>(value)));
432
=> Unsafe.
BitCast
<int, float>(CompareExchange(ref Unsafe.As<float, int>(ref location1), Unsafe.
BitCast
<float, int>(value), Unsafe.
BitCast
<float, int>(comparand)));
442
=> Unsafe.
BitCast
<long, double>(CompareExchange(ref Unsafe.As<double, long>(ref location1), Unsafe.
BitCast
<double, long>(value), Unsafe.
BitCast
<double, long>(comparand)));
513
return Unsafe.
BitCast
<byte, T>(
516
Unsafe.
BitCast
<T, byte>(value),
517
Unsafe.
BitCast
<T, byte>(comparand)));
522
return Unsafe.
BitCast
<ushort, T>(
525
Unsafe.
BitCast
<T, ushort>(value),
526
Unsafe.
BitCast
<T, ushort>(comparand)));
531
return Unsafe.
BitCast
<int, T>(
534
Unsafe.
BitCast
<T, int>(value),
535
Unsafe.
BitCast
<T, int>(comparand)));
539
return Unsafe.
BitCast
<long, T>(
542
Unsafe.
BitCast
<T, long>(value),
543
Unsafe.
BitCast
<T, long>(comparand)));
src\libraries\System.Private.CoreLib\src\System\Version.cs (2)
252
((uint)value).TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination), out valueCharsWritten) :
253
((uint)value).TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination), out valueCharsWritten, default, CultureInfo.InvariantCulture);
System.Runtime.Numerics (4)
System\Numerics\Complex.cs (4)
2216
m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider) :
2217
m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(1)), out realChars, format, provider))
2227
m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(2)), out imaginaryChars, format, provider) :
2228
m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(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)));