Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public static explicit operator BFloat16(double value)
// Extract sign bit
ulong sign = (bitValue & double.SignMask) >> 48;
// Detecting NaN (~0u if a is not NaN)
ulong realMask = (ulong)(Unsafe.BitCast<bool, sbyte>(double.IsNaN(value)) - 1);
ulong realMask = double.IsNaN(value) ? 0uL : ~0uL;
// Clear sign bit
value = double.Abs(value);
// Rectify values that are Infinity in BFloat16. (float.Min now emits vminps instruction if one of two arguments is a constant)
Expand Down
Loading