499 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)
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 (468)
src\libraries\Common\src\System\HexConverter.cs (4)
209
EncodeTo_Vector128(source, Unsafe.
BitCast
<Span<char>, Span<ushort>>(destination), casing);
299
return TryDecodeFrom_Vector128(Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<ushort>>(source), destination, out charsProcessed);
448
fallbackResult = TryDecodeFromUtf8_Scalar(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(source.Slice((int)offset)), destination.Slice((int)(offset / 2)), out elementsProcessed);
453
fallbackResult = TryDecodeFromUtf16_Scalar(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(source.Slice((int)offset)), destination.Slice((int)(offset / 2)), out elementsProcessed);
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)
909
public static long DoubleToInt64Bits(double value) => Unsafe.
BitCast
<double, long>(value);
917
public static double Int64BitsToDouble(long value) => Unsafe.
BitCast
<long, double>(value);
925
public static int SingleToInt32Bits(float value) => Unsafe.
BitCast
<float, int>(value);
933
public static float Int32BitsToSingle(int value) => Unsafe.
BitCast
<int, float>(value);
962
public static ulong DoubleToUInt64Bits(double value) => Unsafe.
BitCast
<double, ulong>(value);
971
public static double UInt64BitsToDouble(ulong value) => Unsafe.
BitCast
<ulong, double>(value);
980
public static uint SingleToUInt32Bits(float value) => Unsafe.
BitCast
<float, uint>(value);
989
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)
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\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (28)
271
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencyDecimalSeparator) :
272
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencyDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_currencyDecimalSeparator));
363
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencyGroupSeparator) :
364
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencyGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_currencyGroupSeparator));
385
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_currencySymbol) :
386
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_currencySymbolUtf8 ??= Encoding.UTF8.GetBytes(_currencySymbol));
431
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_nanSymbol) :
432
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_nanSymbolUtf8 ??= Encoding.UTF8.GetBytes(_nanSymbol));
516
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_negativeInfinitySymbol) :
517
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_negativeInfinitySymbolUtf8 ??= Encoding.UTF8.GetBytes(_negativeInfinitySymbol));
539
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_negativeSign) :
540
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_negativeSignUtf8 ??= Encoding.UTF8.GetBytes(_negativeSign));
575
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_numberDecimalSeparator) :
576
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_numberDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_numberDecimalSeparator));
596
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_numberGroupSeparator) :
597
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_numberGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_numberGroupSeparator));
633
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_positiveInfinitySymbol) :
634
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_positiveInfinitySymbolUtf8 ??= Encoding.UTF8.GetBytes(_positiveInfinitySymbol));
656
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_positiveSign) :
657
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_positiveSignUtf8 ??= Encoding.UTF8.GetBytes(_positiveSign));
692
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentDecimalSeparator) :
693
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentDecimalSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_percentDecimalSeparator));
713
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentGroupSeparator) :
714
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentGroupSeparatorUtf8 ??= Encoding.UTF8.GetBytes(_percentGroupSeparator));
734
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_percentSymbol) :
735
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_percentSymbolUtf8 ??= Encoding.UTF8.GetBytes(_percentSymbol));
756
Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(_perMilleSymbol) :
757
Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(_perMilleSymbolUtf8 ??= Encoding.UTF8.GetBytes(_perMilleSymbol));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (7)
902
ReadOnlySpan<char> charSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(str);
931
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(new ReadOnlySpan<char>(chArr, 0, newLength));
937
ReadOnlySpan<byte> srcUtf8Span = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(str);
990
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(destUtf8Span.Slice(0, newLength));
1094
return Unsafe.
BitCast
<Guid, Vector128<byte>>(left) == Unsafe.
BitCast
<Guid, Vector128<byte>>(right);
1530
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),
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),
1925
Unsafe.
BitCast
<T, byte>(lowInclusive),
1926
Unsafe.
BitCast
<T, byte>(highInclusive),
1934
Unsafe.
BitCast
<T, ushort>(lowInclusive),
1935
Unsafe.
BitCast
<T, ushort>(highInclusive),
1943
Unsafe.
BitCast
<T, uint>(lowInclusive),
1944
Unsafe.
BitCast
<T, uint>(highInclusive),
1952
Unsafe.
BitCast
<T, ulong>(lowInclusive),
1953
Unsafe.
BitCast
<T, ulong>(highInclusive),
1990
Unsafe.
BitCast
<T, byte>(lowInclusive),
1991
Unsafe.
BitCast
<T, byte>(highInclusive),
1999
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2000
Unsafe.
BitCast
<T, ushort>(highInclusive),
2008
Unsafe.
BitCast
<T, uint>(lowInclusive),
2009
Unsafe.
BitCast
<T, uint>(highInclusive),
2017
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2018
Unsafe.
BitCast
<T, ulong>(highInclusive),
2055
Unsafe.
BitCast
<T, byte>(lowInclusive),
2056
Unsafe.
BitCast
<T, byte>(highInclusive),
2064
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2065
Unsafe.
BitCast
<T, ushort>(highInclusive),
2073
Unsafe.
BitCast
<T, uint>(lowInclusive),
2074
Unsafe.
BitCast
<T, uint>(highInclusive),
2082
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2083
Unsafe.
BitCast
<T, ulong>(highInclusive),
2120
Unsafe.
BitCast
<T, byte>(lowInclusive),
2121
Unsafe.
BitCast
<T, byte>(highInclusive),
2129
Unsafe.
BitCast
<T, ushort>(lowInclusive),
2130
Unsafe.
BitCast
<T, ushort>(highInclusive),
2138
Unsafe.
BitCast
<T, uint>(lowInclusive),
2139
Unsafe.
BitCast
<T, uint>(highInclusive),
2147
Unsafe.
BitCast
<T, ulong>(lowInclusive),
2148
Unsafe.
BitCast
<T, ulong>(highInclusive),
2193
Unsafe.
BitCast
<T, byte>(value),
2199
Unsafe.
BitCast
<T, short>(value),
2205
Unsafe.
BitCast
<T, int>(value),
2211
Unsafe.
BitCast
<T, long>(value),
2234
Unsafe.
BitCast
<T, byte>(value),
2240
Unsafe.
BitCast
<T, short>(value),
2246
Unsafe.
BitCast
<T, int>(value),
2252
Unsafe.
BitCast
<T, long>(value),
2389
Unsafe.
BitCast
<T, byte>(value),
2396
Unsafe.
BitCast
<T, short>(value),
2403
Unsafe.
BitCast
<T, int>(value),
2410
Unsafe.
BitCast
<T, long>(value),
2435
Unsafe.
BitCast
<T, byte>(value),
2442
Unsafe.
BitCast
<T, short>(value),
2449
Unsafe.
BitCast
<T, int>(value),
2456
Unsafe.
BitCast
<T, long>(value),
2652
Unsafe.
BitCast
<T, byte>(value0),
2653
Unsafe.
BitCast
<T, byte>(value1),
2660
Unsafe.
BitCast
<T, short>(value0),
2661
Unsafe.
BitCast
<T, short>(value1),
2687
Unsafe.
BitCast
<T, byte>(value0),
2688
Unsafe.
BitCast
<T, byte>(value1),
2695
Unsafe.
BitCast
<T, short>(value0),
2696
Unsafe.
BitCast
<T, short>(value1),
2752
Unsafe.
BitCast
<T, byte>(value0),
2753
Unsafe.
BitCast
<T, byte>(value1),
2754
Unsafe.
BitCast
<T, byte>(value2),
2761
Unsafe.
BitCast
<T, short>(value0),
2762
Unsafe.
BitCast
<T, short>(value1),
2763
Unsafe.
BitCast
<T, short>(value2),
2790
Unsafe.
BitCast
<T, byte>(value0),
2791
Unsafe.
BitCast
<T, byte>(value1),
2792
Unsafe.
BitCast
<T, byte>(value2),
2799
Unsafe.
BitCast
<T, short>(value0),
2800
Unsafe.
BitCast
<T, short>(value1),
2801
Unsafe.
BitCast
<T, short>(value2),
3072
Unsafe.
BitCast
<T, byte>(value0),
3073
Unsafe.
BitCast
<T, byte>(value1),
3080
Unsafe.
BitCast
<T, short>(value0),
3081
Unsafe.
BitCast
<T, short>(value1),
3107
Unsafe.
BitCast
<T, byte>(value0),
3108
Unsafe.
BitCast
<T, byte>(value1),
3115
Unsafe.
BitCast
<T, short>(value0),
3116
Unsafe.
BitCast
<T, short>(value1),
3173
Unsafe.
BitCast
<T, byte>(value0),
3174
Unsafe.
BitCast
<T, byte>(value1),
3175
Unsafe.
BitCast
<T, byte>(value2),
3182
Unsafe.
BitCast
<T, short>(value0),
3183
Unsafe.
BitCast
<T, short>(value1),
3184
Unsafe.
BitCast
<T, short>(value2),
3211
Unsafe.
BitCast
<T, byte>(value0),
3212
Unsafe.
BitCast
<T, byte>(value1),
3213
Unsafe.
BitCast
<T, byte>(value2),
3220
Unsafe.
BitCast
<T, short>(value0),
3221
Unsafe.
BitCast
<T, short>(value1),
3222
Unsafe.
BitCast
<T, short>(value2),
4459
Unsafe.
BitCast
<T, byte>(oldValue),
4460
Unsafe.
BitCast
<T, byte>(newValue),
4471
Unsafe.
BitCast
<T, ushort>(oldValue),
4472
Unsafe.
BitCast
<T, ushort>(newValue),
4482
Unsafe.
BitCast
<T, int>(oldValue),
4483
Unsafe.
BitCast
<T, int>(newValue),
4493
Unsafe.
BitCast
<T, long>(oldValue),
4494
Unsafe.
BitCast
<T, long>(newValue),
4525
Unsafe.
BitCast
<T, byte>(oldValue),
4526
Unsafe.
BitCast
<T, byte>(newValue),
4537
Unsafe.
BitCast
<T, ushort>(oldValue),
4538
Unsafe.
BitCast
<T, ushort>(newValue),
4548
Unsafe.
BitCast
<T, int>(oldValue),
4549
Unsafe.
BitCast
<T, int>(newValue),
4559
Unsafe.
BitCast
<T, long>(oldValue),
4560
Unsafe.
BitCast
<T, long>(newValue),
4637
Unsafe.
BitCast
<T, byte>(oldValue),
4638
Unsafe.
BitCast
<T, byte>(newValue),
4648
Unsafe.
BitCast
<T, ushort>(oldValue),
4649
Unsafe.
BitCast
<T, ushort>(newValue),
4658
Unsafe.
BitCast
<T, int>(oldValue),
4659
Unsafe.
BitCast
<T, int>(newValue),
4668
Unsafe.
BitCast
<T, long>(oldValue),
4669
Unsafe.
BitCast
<T, long>(newValue),
4723
Unsafe.
BitCast
<T, byte>(oldValue),
4724
Unsafe.
BitCast
<T, byte>(newValue),
4734
Unsafe.
BitCast
<T, ushort>(oldValue),
4735
Unsafe.
BitCast
<T, ushort>(newValue),
4744
Unsafe.
BitCast
<T, int>(oldValue),
4745
Unsafe.
BitCast
<T, int>(newValue),
4754
Unsafe.
BitCast
<T, long>(oldValue),
4755
Unsafe.
BitCast
<T, long>(newValue),
5409
Unsafe.
BitCast
<T, byte>(value),
5416
Unsafe.
BitCast
<T, short>(value),
5423
Unsafe.
BitCast
<T, int>(value),
5430
Unsafe.
BitCast
<T, long>(value),
5458
Unsafe.
BitCast
<T, byte>(value),
5465
Unsafe.
BitCast
<T, short>(value),
5472
Unsafe.
BitCast
<T, int>(value),
5479
Unsafe.
BitCast
<T, long>(value),
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (2)
652
if (source.TryCopyTo(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination)))
663
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)
932
ReadOnlySpan<char> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span);
933
ReadOnlySpan<char> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(value);
940
ReadOnlySpan<byte> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span);
941
ReadOnlySpan<byte> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
952
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span).Trim());
958
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span).TrimUtf8());
968
ReadOnlySpan<char> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span);
969
ReadOnlySpan<char> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(value);
976
ReadOnlySpan<byte> typedSpan = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span);
977
ReadOnlySpan<byte> typedValue = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(value);
1090
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)
230
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)
267
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)
252
return Unsafe.
BitCast
<Vector256<TFrom>, Vector256<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (1)
251
return Unsafe.
BitCast
<Vector512<TFrom>, Vector512<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (1)
251
return Unsafe.
BitCast
<Vector64<TFrom>, Vector64<TTo>>(vector);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (102)
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)),
412
if (TVectorUInt64.LessThanOrEqualAll(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(x)), TVectorUInt64.Create(V_ARG_MAX)))
418
TVectorUInt64 n = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(dn);
455
return poly * Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>((n + TVectorUInt64.Create(V_DP64_BIAS)) << 52);
543
if (TVectorUInt32.GreaterThanAny(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(x)), TVectorUInt32.Create(V_ARG_MAX)))
570
TVectorUInt64 n = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(dn);
589
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(poly) + (n << 52));
609
TVectorUInt64 xBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ax);
610
TVectorUInt64 yBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ay);
619
TVectorDouble insignificanMask = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(
628
TVectorDouble expFix = TVectorDouble.ConditionalSelect(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(scaleDownMask), TVectorDouble.Create(4.149515568880993E+180), TVectorDouble.One);
634
expFix = TVectorDouble.ConditionalSelect(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(scaleUpMask), TVectorDouble.Create(2.409919865102884E-181), expFix);
649
ax = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xBits);
650
ax -= subnormalFix & Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xSubnormalMask);
654
ay = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(yBits);
655
ay -= subnormalFix & Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(ySubnormalMask);
657
xBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ax);
658
yBits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(ay);
668
xBits = TVectorUInt64.ConditionalSelect(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(lessThanMask), yBits, xBits);
669
yBits = TVectorUInt64.ConditionalSelect(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(lessThanMask), tmpBits, yBits);
676
TVectorDouble xHead = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(xBits & headMask);
677
TVectorDouble yHead = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(yBits & headMask);
699
TVectorDouble equalExponentsMask = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(TVectorUInt64.IsZero(expDiff));
777
TVectorUInt32 bits = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(vector));
794
return Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(result);
802
TVectorUInt64 bits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(vector));
819
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(result);
827
TVectorUInt32 bits = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(TVectorSingle.Abs(vector));
840
return Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(result);
848
TVectorUInt64 bits = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(TVectorDouble.Abs(vector));
861
return Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(result);
934
TVectorUInt64 specialMask = TVectorUInt64.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_MIN), TVectorUInt64.Create(V_MAX - V_MIN));
963
TVectorDouble subnormalMask = TVectorDouble.AndNot(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask), temp);
968
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x * 4503599627370496.0) - TVectorUInt64.Create(52ul << 52)),
972
specialMask = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(temp);
976
TVectorUInt64 vx = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_OFF);
977
TVectorDouble n = ConvertToDouble<TVectorInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorUInt64, TVectorInt64>(vx) >> 52);
981
TVectorDouble r = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(vx) - TVectorDouble.One;
1028
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask),
1115
TVectorUInt32 specialMask = TVectorUInt32.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_MIN), TVectorUInt32.Create(V_MAX - V_MIN));
1144
TVectorSingle subnormalMask = TVectorSingle.AndNot(Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask), temp);
1148
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x * 8388608.0f) - TVectorUInt32.Create(23u << 23)),
1152
specialMask = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(temp);
1155
TVectorUInt32 vx = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_OFF);
1156
TVectorSingle n = ConvertToSingle<TVectorInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorUInt32, TVectorInt32>(vx) >> 23);
1160
TVectorSingle r = Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(vx) - TVectorSingle.Create(1.0f);
1187
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask),
1254
TVectorUInt64 specialMask = TVectorUInt64.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_MIN), TVectorUInt64.Create(V_MAX - V_MIN));
1283
TVectorDouble subnormalMask = TVectorDouble.AndNot(Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask), temp);
1288
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x * 4503599627370496.0) - TVectorUInt64.Create(52ul << 52)),
1292
specialMask = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(temp);
1296
TVectorUInt64 vx = Unsafe.
BitCast
<TVectorDouble, TVectorUInt64>(x) - TVectorUInt64.Create(V_OFF);
1297
TVectorDouble n = ConvertToDouble<TVectorInt64, TVectorDouble>(Unsafe.
BitCast
<TVectorUInt64, TVectorInt64>(vx) >> 52);
1301
TVectorDouble r = Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(vx) - TVectorDouble.One;
1348
Unsafe.
BitCast
<TVectorUInt64, TVectorDouble>(specialMask),
1431
TVectorUInt32 specialMask = TVectorUInt32.GreaterThanOrEqual(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_MIN), TVectorUInt32.Create(V_MAX - V_MIN));
1460
TVectorSingle subnormalMask = TVectorSingle.AndNot(Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask), temp);
1465
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x * 8388608.0f) - TVectorUInt32.Create(23u << 23)),
1469
specialMask = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(temp);
1473
TVectorUInt32 vx = Unsafe.
BitCast
<TVectorSingle, TVectorUInt32>(x) - TVectorUInt32.Create(V_OFF);
1474
TVectorSingle n = ConvertToSingle<TVectorInt32, TVectorSingle>(Unsafe.
BitCast
<TVectorUInt32, TVectorInt32>(vx) >> 23);
1478
TVectorSingle r = Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(vx) - TVectorSingle.One;
1505
Unsafe.
BitCast
<TVectorUInt32, TVectorSingle>(specialMask),
1804
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
1843
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
1849
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
1854
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
1857
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
1863
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
1874
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
1880
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
1923
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
1998
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2004
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2020
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2026
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2031
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2034
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2040
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals((region + TVectorInt64.One) & TVectorInt64.Create(2), TVectorInt64.Zero)),
2124
TVectorInt64 ux = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(ax);
2154
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2159
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2162
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2173
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.GreaterThan(ux, TVectorInt64.Create(ARG_SMALLER - 1))),
2254
TVectorInt32 ux = Unsafe.
BitCast
<TVectorSingle, TVectorInt32>(ax);
2311
Unsafe.
BitCast
<TVectorInt32, TVectorSingle>(TVectorInt32.GreaterThan(ux, TVectorInt32.Create(ARG_SMALLER - 1))),
2326
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(region & TVectorInt64.One, TVectorInt64.Zero)),
2331
TVectorInt64 sign = Unsafe.
BitCast
<TVectorDouble, TVectorInt64>(x) >>> 63;
2334
Unsafe.
BitCast
<TVectorInt64, TVectorDouble>(TVectorInt64.Equals(((sign & (region >>> 1)) | (~sign & ~(region >>> 1))) & TVectorInt64.One, TVectorInt64.Zero)),
2885
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);
1491
? PackedSpanHelpers.IndexOf(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value), length)
1492
: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.
BitCast
<TValue, char>(value), length);
1681
char char0 = Unsafe.
BitCast
<TValue, char>(value0);
1682
char char1 = Unsafe.
BitCast
<TValue, char>(value1);
1908
? 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)
1909
: 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);
3492
char charLowInclusive = Unsafe.
BitCast
<T, char>(lowInclusive);
3493
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)
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)));
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 (23)
src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (2)
102
result = Encoding.UTF8.GetString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(slice));
107
result = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(slice).ToString();
System\Number.BigInteger.cs (9)
783
spanSuccess = value._sign.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination), out charsWritten, formatSpan, info);
788
spanSuccess = value._sign.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination), out charsWritten, formatSpan, info);
871
sNegative = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(sNegative),
923
strResult = Encoding.UTF8.GetString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(vlb.AsSpan()));
928
strResult = Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(vlb.AsSpan()).ToString();
1408
return uint.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(input), TParser.BlockNumberStyle, null, out result);
1413
return uint.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(input), TParser.BlockNumberStyle, null, out result);
1454
? (Convert.FromHexString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(input), MemoryMarshal.AsBytes(destination), out _, out _) != OperationStatus.Done)
1455
: (Convert.FromHexString(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(input), MemoryMarshal.AsBytes(destination), out _, out _) != OperationStatus.Done))
System\Number.Polyfill.cs (4)
112
? Rune.DecodeFromUtf8(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(span), out result, out elemsConsumed)
113
: Rune.DecodeFromUtf16(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(span), out result, out elemsConsumed);
122
return Unsafe.
BitCast
<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(Encoding.UTF8.GetBytes(value));
127
return Unsafe.
BitCast
<ReadOnlySpan<char>, ReadOnlySpan<TChar>>(value);
System\Numerics\Complex.cs (8)
2171
? !double.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(slice), style, provider, out double real)
2172
: !double.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(slice), style, provider, out real))
2191
? !double.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(slice), style, provider, out double imaginary)
2192
: !double.TryParse(Unsafe.
BitCast
<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(slice), style, provider, out imaginary))
2279
? m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(1)), out int realChars, format, provider)
2280
: m_real.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider))
2289
? m_imaginary.TryFormat(Unsafe.
BitCast
<Span<TChar>, Span<byte>>(destination.Slice(2)), out int imaginaryChars, format, provider)
2290
: 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)));